20

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.

  • Oddly Menlo has glyphs for Lao and Arabic which are not attached to unicode values and thus cannot be used for input/display. – Tom Gewecke Dec 16 '17 at 17:47
  • Is the font you're trying to use installed for the system? or as a user font? Also, is it installed as a TrueType font? – user3052786 Feb 21 '18 at 20:08
1

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/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .