Font fallback mechanism: how to extend OFL font with symbols (Unicode)

ChrisGr's picture

I'm a beginner in Typography (Inkscape and FontForge on Win7x32).

I try to explain my answer with an example:
I like to use the existing OFL font family "PT Sans" with different styles/weights and also Condensed/Extended variants for charts and drawings in a project. But this font-family (like any other good text font) misses some Unicode symbol chars (from Unicode-Block Dingbats, Miscellaneous Symbols, etc.) that I need.
Windows seems to automatically use sometimes weird fallback chars, coming from the installed fonts with extended Unicode support (Segoe UI Symbol, Arial Unicode MS, DejaVu Sans, etc.). Office/Word (Uniscribe?), MS IE (first Uniscribe, now DirectWrite), Firefox (first Uniscribe, now DirectWrite), Chrome (Uniscribe) seem to have sometimes different implementations of this "font fallback mechanism". I was unable to find enough information to understand this OS and software behaviour. I'm especially interested if it is possible to edit this mechanism, for example to prescribe the usage of the preferred Unicode font. This would be generally interesting also by using fonts like Linux Liberation/Biolinum. Here some links:
Wikipedia: Fallback font
Wikipedia: Uniscribe
MS Win UI Dev: Using Font Fallback
MS DirectWrite
Mozilla: Making font initialization lazier
Brett Wilson (Google Chrome Dev) / Uniscribe: The Missing Documentation & Examples

I think I have two options:
A) use the PT Sans fonts and modify/extend them with the risk to have to integrate future releases and to make errors as a beginner
B) create a new font with the PT Sans metrics and only the desired Unicode symbols. But the technical background and the fluid usage in texting/graphical software is not clear to me (without the need to change font family for certain characters in the text).

Is there more information about the Font fallback mechanism with rare Unicode characters in Windows, especially whether this behavior can be influenced?

I hope my question is clear enough and someone here can extend my knowledge about this complex behaviour. Thank you.

oldnick's picture

No single font can be all things to all people. If the EULA for PT Sans allows you to make modifications for your own use, fine; if not, you'll just to have to live with the limitations and change fonts as needed.

ChrisGr's picture

No single font can be all things to all people.
That is the reason why I try to add the characters I need to a free quality font. I'm asking how (way A or B).

If the EULA for PT Sans allows you to make modifications for your own use, fine; if not, you'll just to have to live with the limitations and change fonts as needed.
PT Sans is licenced under the SIL Open Font License 1.1 (OFL) and modifications can be made and also distributed.

hrant's picture

{To Follow}

oldnick's picture

If you're really a beginner, neither option is a guarantee of success: Experience is the best teacher.

However, if you pursue option A, you won't have to re-do kerning and feature building from scratch.

ChrisGr's picture

I have found some more info about DirectWrite Text Rendering in Firefox 6 (interesting, but no info on font fallback)
Rereading MSDN > Introducing DirectWrite > Support for International Text I found a maybe better describing of the crucial behaviours:
Unicode features such as surrogates, BIDI, line breaking, and UVS are supported. In this CCP-script (to complex for me) there are some comments about surrogates. In MSDN Surrogates and Supplementary Characters there is some interesting info: Applications automatically support supplementary characters if they support Unicode and use system controls and standard API functions, such as ExtTextOut and DrawText. and there are some registry settings about surrogates. Still I don't understand enough.

@oldnick: Option B is not a re-creation of the standard characters: only some of the desired characters mainly in Symbol Unicode blocks should be created and integrated. The core of my question is about the Windows Font fallback mechanism with Unicode characters. I have rewritten my question in the first post. If I don't get enough information about that, I don't feel to decide what to do. Maybe I have to ask in some programmers/Windows GUI Forum?

ChrisGr's picture

Some useful:
The Surrogate Pair Calculator etc.

I think I have found the crucal infos:
MSDN Surrogates and Supplementary Characters
WinVNKey: How To Set Up Surrogate fonts
TechNet FontSubstitutes

I think I go to test editing the registry settings:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\LanguagePack\SurrogateFallback]
Plane1=(Name for fallback font for characters in Plane 1)
Plane2=(Name for fallback font for characters in Plane 2)

and also "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes"
If this works well, probably I choose option B). Will report news about my experience here.

jdaggett's picture

I'm not quite sure what you're looking for here. All browsers implement the same basic algorithm for fallback within fonts in a given fontlist. If you specify font-family: FontA, FontB, sans-serif;, then all browsers will first test FontA for a given character, then FontB, etc. If system fallback occurs (i.e. none of the fonts in your specified fontlist contain a glyph for a given character), then the behavior will vary across browsers. Chrome used a hard-coded fallback list, IE uses an OS-level fallback routine and Firefox uses a hybrid approach. But if your goal is to always see a given set of symbols, make a font containing those symbols and include it in your font list. In that case, fallback will be consistent across browsers.

John Daggett
Mozilla Japan

Syndicate content Syndicate content