200 likes | 233 Views
Bob Rasmussen: Master layout Codeexamples Printout format Transitions __Notes. Font Coverage in Windows. Bob Rasmussen Rasmussen Software, Inc. ras@anzio.com. Introduction . The problem Display many character/diacritic combinations An approach Determining font coverage
E N D
Bob Rasmussen: • Master layout • Codeexamples • Printout format • Transitions • __Notes Font Coverage in Windows Bob Rasmussen Rasmussen Software, Inc. ras@anzio.com 17th International Unicode Conference
Introduction • The problem • Display many character/diacritic combinations • An approach • Determining font coverage • Fallbacks for missing characters • Filling in the details 17th International Unicode Conference
Statement of the Problem • Display/print a wide range of combos (some not in Unicode) • Use a single TrueType font • No operator interaction • Platforms: Win95 to Win2000 • Minor issues • Monospaced text, usually Courier New • Font coverage can vary with installed Windows options • Examples in Delphi 17th International Unicode Conference
Issues • Combo may be in private use area • Character or combo may not exist in font • Diacritic may not exist in font • Combining diacritic may not “backspace” • May need to adjust vertical position • Transparency issues 17th International Unicode Conference
Determining Font Coverage in a TrueType Font • Accessing the CMAP • Breaking apart the CMAP • Storing its information for easy use 17th International Unicode Conference
Determining Font Coverage in a TrueType Font • Accessing the CMAP • Breaking apart the CMAP • Storing its information for easy use 17th International Unicode Conference
Determining Font Coverage in a TrueType Font • Accessing the CMAP • Breaking apart the CMAP • Storing its information for easy use 17th International Unicode Conference
Determining Font Coverage in a TrueType Font • Accessing the CMAP • Breaking apart the CMAP • Storing its information for easy use 17th International Unicode Conference
Dealing with Missing Characters This routine will display a “tricky” character: 17th International Unicode Conference
Dealing with Missing Characters Pseudo code: if (not in font) or (in private use area) if we can decompose to character + combining diacritic print base character remember its "top" make sure next character is combining advance to next character if this is a Unicode combining character check its x_offset if not in font, but alternate diacritic IS, use alternate 17th International Unicode Conference
Dealing with Missing Characters Pseudo code: if (not in font) or (in private use area) if we can decompose to character + combining diacritic print base character remember its "top" make sure next character is combining advance to next character if this is a Unicode combining character check its x_offset if not in font, but alternate diacritic IS, use alternate 17th International Unicode Conference
Dealing with Missing Characters Pseudo code (continued): if character IS in font if it's a diacritic OVER a character check for vertical placement ExtTextOutW else if we have a bitmap for it, or for its alternate display the bitmap (watch for transparency) else if we have a fallback character, in the font display it else if we're trying to do a combining diacritic skip it else display inverted "?" 17th International Unicode Conference
Future Possibilities • Multiple diacritics on one base character • Checking the glyph index • Font switching • Using FoldStringW to decompose (NT/2000 only) 17th International Unicode Conference
References • Kano, Nadine, “Developing International Software for Windows 95 and Windows NT”, Microsoft Press, 1995, ISBN 1-55615-840-8 • Schmitt, David A., “International Programming for Microsoft Windows”, Microsoft Press, 2000, ISBN 1-57231-956-9 • “HOWTO: Translate Unicode Character Codes to TrueType Glyph Indices in Windows 95”, Microsoft Knowledge Base Article Q241020 • “cmap - Character To Glyph Index Mapping Table”http://msdn.microsoft.com/library/specs/cmap.htm 17th International Unicode Conference
¿Questions? 17th International Unicode Conference