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 » Thu Jun 22, 2006 5:11 am

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: 7889
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Post by Bhikkhu Pesala » Thu Jun 22, 2006 12:37 pm

Edit, Select Incomplete, Delete.

Or, Edit Select Incomplete, Tools, Glyph Transformer, Metrics, Width, 0.
My FontsReviews: MainTypeFont CreatorHelpFC11.5 Pro + MT8.0 @ Win10 1809 build 17763.379

Erwin Denissen
Moderator
Moderator
Posts: 7784
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Post by Erwin Denissen » Thu Jun 22, 2006 1:31 pm

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 » Fri Jun 23, 2006 3:58 am

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: 7784
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Post by Erwin Denissen » Fri Jun 23, 2006 10:02 am

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