What is the default value of Chrome’s minimum font size?

Background

One fine day at work, I took up a task which involves reducing the font size of a text from the current 12px to 9px. From my experience, this won’t turn up well in some versions of Chrome, as Chrome imposes some minimum font size, when the browser is set to a specific language. This minimum font size restriction, apparently, is controllable at the browser settings (ref 1, ref 2).

Question

I would go and raise this issue to the designer and product manager, but one question popped up:

What is the default value of this minimum font size setting?

Methodology

Googling DuckDuckGo-ing this question does not help very much, as the results of such Stack Overflow thread keep coming up.

Thinking that my settings have been changed, I installed a fresh ungoogled-chromium, and was perplexed to see that the value of this minimum font size is zero.

Feeling that this default value must be something hard coded in Chromium’s source code, I started my code search. My search began in GitHub, which hosts a mirror of Chromium’s source code. (Fun fact: the repo is over 10GB! which making the clone so very slow and not fun at all)

Guessing that this minimum font size setting must be a reasonably named variable, I could try to search minimumFontSize, getMinimumFontSize, MINIMUM_FONT_SIZE, or something like that.

Eureka! Apparently, the variable I was looking for is called IDS_MINIMUM_FONT_SIZE.

From the organization of the files there, I believe that these files hosts default values for the browser settings, which differs depending on the browser’s Operating System and also language. I also believe that the OS-specific files provide the base default value, and then the OS-plus-locale-specific files overrides those values.

For example in locale_settings_linux.grd, the IDS_MINIMUM_FONT_SIZE is 0, but if the OS-plus-locale-specific file specifies another IDS_MINIMUM_FONT_SIZE, it will override this value. For example, in locale_settings_linux_zh-TW.xtb, this value is 12. Therefore, I would assume that if I open Chrome in Linux in zh-TW language, I will have my browser settings defaulted with 12 as the minimum font size.

Results

From such methods (read: guesswork and deduction), my finding is that the default value of minimum font size is zero, except for the following languages:

LanguageValue (px)
Arabic (ar)10
Farsi (fa)10
Japanese (ja)10
Korean (ko)10
Thai (th)10
Chinese Simplified (zh-CN)12
Chinese Traditional (zh-TW)12

Conclusion

tl;dr: Chrome’s minimum font size is controllable at browser setting and the default value varies depends on the browser’s language. After searching in Chromium’s source code, I deduced that the default value of this minimum font size is 10px for Japanese (ja), Thai (th), Farsi (fa), Arabic (ar), and Korean (ko); 12px for Chinese Simplified (zh-CN) and Chinese Traditional (zh-TW); and zero for the rest of languages.

Update 2023-08-04: https://groups.google.com/a/chromium.org/g/blink-dev/c/QpQeCiNGhDs/m/LNQlYXcmAwAJ?pli=1 Looks like Chrome team intends to remove this default settings on Chrome 118

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.