MacOS – How to Change default fallback font (for non-latin languages)

fontmacosterminalxml

My question is: How do I change the default fallback font for Thai (or any non-latin language for that matter) so that the terminal app shows the Thai font of my choice while keeping the English font.

Forgive the long extra details, but I’m really stuck here on Mac OS 10.11.1 and my terminal font is set to Menlo at a font size that is comfortable to me. Menlo does not have any Thai characters, which I double-checked in Fontbook > View > Repertoire and also via the Menu bar > Show Emoji and Symbols. (But interestingly has Lao.) However, when I type Thai characters in the terminal, miraculously Thai appears. Apparently, there is a system wide default fallback font. However, one Thai character does not display properly. (Sara Am, สระ อำ) I can change the terminal font to CS Prajad and the Thai looks very good including the problem character. However the English font is hideously ugly and is useless as a programming font.

I disabled SIP (System Integrity Protection) in order to modify the xml file DefaultFontFallbacks.plist located in

/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework/Versions/A/Resources then rebooted thinking that this would solve my problem. However, the original default Thai font is still showing in the terminal.

(Changes I made to DefaultFontFallbacks.plist.)

Substitute default string.

<default>...
    ...
    <string>Thonburi</string> to <string>CSPrajad</string> (no space)
    ...
</default>

add CS Prajad as monospace font as per Han Chinese and Korean xml strings.

<monospace>
    ...
    <array>
        ...
        <array>
            <string>th</string>
            <string>CSPrajad-Regular</string>
        </array>
        ...
    </array>
    ...
</monospace>

How do I change the default fallback font for Thai (or any non-latin language for that matter) so that the terminal app shows the Thai font of my choice while keeping the English font.

Best Answer

You were almost there!

Add it in the Language Preferred Fallback List as you did, but make sure you are using the PostScript name for the font. It has to be exact!

<array>
    <!-- for Thai  -->
    <string>th</string>
    <!-- below is the case sensitive PostScript name  -->
    <string>CSPraJad</string>
</array>

References:
https://gist.github.com/Moligaloo/3180490
https://github.com/zerustech/font-fallbacks-tutorial
https://github.com/zonble/tcfail/