Windows – What Font does Notepad use to display e.g. Hebrew, when it claims to use Lucida Console but Lucida Console doesn’t have those characters

fontsnotepadunicodewindowswindows 7

Courier New has the character \u05D0 hebrew letter aleph

some other fonts do too such as Miriam and David.

enter image description here

I can paste that into notepad

Lucida Console does not have the character. Character map shows that Lucida Console doesn't have the character.

Yet notepad displays it even when Lucida Console font is set

enter image description here

So what Font is notepad using?

Best Answer

Windows 7 has a technology called composite font

that is used to describe international font linking and fallback logic source

It allows you to have a virtual font linked from many fonts with limited ranges of character definitions.

Default composite font is called GlobalUserInterface and is located in file
C:\Windows\Fonts\GlobalUserInterface.CompositeFont.

You can use great BabelMap tool to play around and understand implementation of Unicode, Composite fonts and related things.

Also check Font Fallback subsection of Remarks section of this MSDN article to learn some interesting background how such a composite font is built and what are fallback rules.


Finding a font for character (based on the above information):

  1. In any plain text editor/viewer, display the file
    C:\Windows\Fonts\GlobalUserInterface.CompositeFont.
  2. In tag <FontFamily.FamilyMaps>, find definition range for your character.
  3. Search for tag FontFamilyMap containing your range in its Unicode attribute and get font (or list of fonts) given for that range (it is stored in attribute Target).
    Example: in case of character 05D0 the range found in file is 0590-05FF (Hebrew)
    and font substitutions are:
    "Segoe UI, Tahoma, Arial, Arial Unicode MS, Microsoft Sans Serif, Lucida Sans Unicode"

    1. If there was only single font, you have it. Otherwise, let's check the list in order: run BabelMap
    2. Navigate to given character
    3. Switch radio buttons from Composite Font to Single Font
      or alternatively: go to menu Fonts > Font Coverage... and press Calculate button
    4. Switch to fonts in order as they appear in step 3. First font having the glyph displayed is your font.

Note: there are 4 composite font files available, but I verified the right one for your case is GlobalUserInterface.CompositeFont.

This technique is reliable because by searching through the definitions you are doing the same as the Windows is doing.

Related Question