Is there a cross-platform way to detemine if an installed font is not “ABC…XYZ” (ie. Symbol, ZapfDingbats or some other glyph format)
I of course to create a list of fonts to exclude, but things change, Apple or Microsoft might add Webding27 next week
I have a method to determine if a font is fixed with (Courier, Menlo etc) by comparing the width of “l” vs “W” which works
parts of this app just need an “ABC…XYZ” font, other parts must have a fixed width font
The fallback is to allow all the fonts, and let the user sort it out, but I’d like to shorten the list
Don’t get caught into stuff that fortunately Unicode freed us from. If you limit in any way the user choice, you are bound to have support requests and will eventually have to implement everything.
Michel the point is… if someone writes in “Symbol” or “ZapfdingBat”… sure my app “knows” the “translation”, but writing code in “smiley” faces has no point… Regardless of you “native” language, the programming code requires “ABC…XYZ”
but if it can’t be done, I’ll let the user deal with the consequences…
I could of course also offer to write a class with declares for CoreText for the Mac part.
Not sure if Windows provides the features at all!
e.g. get list of glyphs in a font.
[quote=329782:@Dave S]Michel the point is… if someone writes in “Symbol” or “ZapfdingBat”… sure my app “knows” the “translation”, but writing code in “smiley” faces has no point… Regardless of you “native” language, the programming code requires “ABC…XYZ”
but if it can’t be done, I’ll let the user deal with the consequences…[/quote]
You never know when a user wants to do something like
Fonts are messy and often inconsitent so I would say try and avoid it if possible.
However, if you have a real need to do this (or want to spend time on this as a research project) and don’t want to rely on 3rd party plug-ins to help, you will either have to write declares for each operating system or write code to read and interpret the font file tables.
The cmap table will tell you if the font is a symbol font.
The OS/2 table can also tell you which scripts / languages the font is supposed to support. However, this information is defined by the font foundry (ie: creator) and I have found by experience that it is usually wrong. The only semi-reliable way I have found to identify which scripts are used, is to check for the existence of glyphs within each Unicode range. This gets more complicated when dealing with CJK due to issues such as Han Unification as the glyph may not identify which script the font is for.