Hello,
I have about 600 fonts files. They are special fonts. The font starts at offset 0x21 and have symbols. Number of symbol in the font file are random. I need to display the symbol consecutively on the screen in a loop;
for example
for (int i = 0 ; i < 0x60 ; i++)
displayfontcharacter (i);
The problem is that the characters in every font file are not consecutive. For example, I might have symbols from 0x21 to 0x40 then starting at offset 0x40 to 0x50 are empty (does not show in the character list), then 0x50 to 0x60 have symbols.
When i try to display the characters in a loop, the empty characters show up as boxes.
The questions are:
How can I remove these empty characters from a file without going through every file by hand?
Can I map empty characters to a space character of width 0?
Can I know programtically in the C++ code that a charcter for example is empty?
Thanks for your help.
Sam
Please Help - How to remove Empty characters
-
- Top Typographer
- Posts: 9878
- Joined: Tue Oct 29, 2002 5:28 am
- Location: Seven Kings, London UK
- Contact:
-
- Moderator
- Posts: 11159
- Joined: Fri Oct 04, 2002 12:41 am
- Location: Bilthoven, The Netherlands
- Contact:
I don’t think removing incomplete glyphs solves the problem, as this problem relates to the character to glyph index mappings.
As Bhikkhu Pesala suggests, setting the advance width of all incomplete glyphs to zero might help, but missing characters will still be presented as a box. To overcome that, you should clear the missing glyph and set it’s advance width to zero, but I wouldn't recommend that.
Best solution, is to either put the mappings in successive order or write code that can read the fonts mappings.
Note: We develop font related software for several companies. If you would like a quote for a specific project, please contact our sales department.
As Bhikkhu Pesala suggests, setting the advance width of all incomplete glyphs to zero might help, but missing characters will still be presented as a box. To overcome that, you should clear the missing glyph and set it’s advance width to zero, but I wouldn't recommend that.
Best solution, is to either put the mappings in successive order or write code that can read the fonts mappings.
Note: We develop font related software for several companies. If you would like a quote for a specific project, please contact our sales department.
I'm sorry I do not think i was clear.
The problem is that the characters in every font file are not consecutive. For example, I might have symbols from 0x21 to 0x40. Then starting at offset 0x40 to 0x50 the characters DO NOT EXIST (does not show in the font file), then 0x50 to 0x60 have symbols.
So when I try loop through to display the symbols from 0x21 to 0x60, the non existing characters display boxes. I want to map these non existing characters to 0 width. I hope this clears things up.
THanks for your help
The problem is that the characters in every font file are not consecutive. For example, I might have symbols from 0x21 to 0x40. Then starting at offset 0x40 to 0x50 the characters DO NOT EXIST (does not show in the font file), then 0x50 to 0x60 have symbols.
So when I try loop through to display the symbols from 0x21 to 0x60, the non existing characters display boxes. I want to map these non existing characters to 0 width. I hope this clears things up.
THanks for your help
-
- Moderator
- Posts: 11159
- Joined: Fri Oct 04, 2002 12:41 am
- Location: Bilthoven, The Netherlands
- Contact:
Add an empty glyph, and make sure its advance width is 0. Then manually add character to glyph index mappings to that glyph. I suggest you add them to all platforms, but at least to the Microsoft Platform. The mappings should include all characters that currently are not available in the font. Let us know your results.bm_masri wrote:So when I try loop through to display the symbols from 0x21 to 0x60, the non existing characters display boxes. I want to map these non existing characters to 0 width. I hope this clears things up.