8

Firefox has a great feature that lets you customize fonts for each language, individually. For example, when browsing English-language sites, I prefer to use SF Pro Text as my font. However, when browsing Japanese-language sites, I prefer to use YuGothic. Further, the Firefox feature lets you change font sizes and serif/sans-serif/monospace fonts per language. It's very handy.

There is a Chrome extension that does something similar called Advanced Font Settings, but I've found it a bit more awkward to use.

  • Vlad replied to this.

    monkey34 Interesting! Do you know what Firefox uses to determine the language of the site (and thus switch to selected font?)

      Vlad If I had to guess, probably the lang="" attribute commonly found in the <html> tag.

        I get the sense (though I'm not positive) that it's per-language, but I'm not quite sure how it's implemented. I say that because even if a page sets the lang attribute, when viewing multiple languages alongside each other, it doesn't render all of the text using whatever font is mapped to that particular language, it mixes the fonts based on the glyph being rendered.

        I'd imagine WebKit has some kind of definition somewhere that says, "if we're rendering a Japanese glyph on a page, use [default Japanese font], but if the next glyph is Latin-based, use [default Latin font]", because SF Pro Text doesn't support Japanese characters, but I'm able to render them side-by-side with having only specified that my preferred display font is SF Pro Text.

          4 months later

          It seems that Firefox also use webpage language settings to determine fallback font priority.

            3 years later

            Hey Vlad hopefully I'm posting this in the right place: I'm a new Orion user. On a MacBook Air M2 with macOS 15.1.1 and I'm running into an issue with CJK fonts.

            Long story short: My OS language and locale is set to Japanese, I use Japanese websites, Japanese IP etc. but inside of Orion it will always use a Chinese font to display characters. All other apps on my system and all other browsers (I also have Safari and Chrome) will properly use a Japanese font without failure on all websites.

            While it's not impossible to read Japanese text even if a Chinese font is used, many characters look different and weird. It's a bit like 𝔯𝔢𝔞𝔡𝔦𝔫𝔤 𝔱𝔢𝔵𝔱 𝔦𝔫 𝔉𝔯𝔞𝔨𝔱𝔲𝔯 𝔥𝔞𝔫𝔡, it works but is not as enjoyable. Is there any remedy for this? Of course it would be ideal if Orion would switch font appropriately based on the language of the text[1], but I think for 99% of CJK users it would already be a great solution if we could just force Chinese, Japanese or Korean versions whenever any Chinese characters are displayed, as we're mostly mono-lingual anyway.

            [1] Chinese, Japanese, and to some extent Korean and other languages that are being or have used to been written with Chinese characters all have different versions of these characters, and unfortunately at least when it comes to the very pervasive Unicode encoding, there's no way of differentiating them on the encoding level because of something they called Han unification.

            System info:
            Orion Version 0.99.129-beta (WebKit 619.1.11.111.2)
            Build date Oct 27 2024
            MacBook Air M2 (macOS Sequoia 15.1.1 build 24B91)

            Edit: / Addition: I found a solution for me. One thing I didn't notice after installing Orion is that it defaulted to English as display language, even though the OS settings are set to Japanese. I manually switched to Japanese in the Orion settings and this made website text render properly now. Interestingly when I now open a Chinese website like https://www.ltn.com.tw (major Taiwanese newspaper) it does still use Chinese font there. Now, I cannot read any Chinese, but the character shapes are proper for Traditional Chinese. Which makes me think it should also be possible somehow for Orion to select the correct font for Japanese websites even if a user doesn't manually change the language settings, but personally now I'm very happy.

              No one is typing