Please Help - How to remove Empty characters

Post general font related questions (e.g. how to install, convert and use fonts) and requests (looking for fonts, designers etc.) here.
Post Reply
bm_masri
Posts: 4
Joined: Sun Feb 19, 2006 3:42 pm

Please Help - How to remove Empty characters

Post by bm_masri »

Hello, :roll:

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
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9878
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Post by Bhikkhu Pesala »

Edit, Select Incomplete, Delete.

Or, Edit Select Incomplete, Tools, Glyph Transformer, Metrics, Width, 0.
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
Erwin Denissen
Moderator
Moderator
Posts: 11158
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Post by Erwin Denissen »

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.
Erwin Denissen
High-Logic
Proven Font Technology
bm_masri
Posts: 4
Joined: Sun Feb 19, 2006 3:42 pm

Post by bm_masri »

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
Erwin Denissen
Moderator
Moderator
Posts: 11158
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Post by Erwin Denissen »

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.
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.
Erwin Denissen
High-Logic
Proven Font Technology
Post Reply