đŸ’Ÿ Archived View for tilde.pink â€ș ~ssb22 â€ș yahei.gmi captured on 2022-04-29 at 11:46:15. Gemini links have been rewritten to link to archived content

View Raw

More Information

âŹ…ïž Previous capture (2022-04-28)

âžĄïž Next capture (2023-01-29)

-=-=-=-=-=-=-

Loophole in Microsoft YaHei font license?

Most free Chinese fonts are not well suited to being displayed at small pixel sizes on low-DPI devices. In general, you must choose between either:

Android users might think the Noto CJK font works well, but that’s only if your device has a high DPI and won’t carry over to an image file of limited size that also aims for compatibility with low-DPI devices. 

The non-free font “Microsoft YaHei” commissioned for Windows Vista was extremely well “hinted” for use at many small pixel sizes (9px+) and is also completely scalable. (Additionally it makes a reasonable font for the display of Pinyin—unlike the earlier “SimSun” font, it doesn’t display “a” as “ɑ” which pinyin’s inventor Zhou Youguang dismissed.) But is YaHei legal to use outside of Microsoft Windows? 

The 1996 through 2002 versions of Microsoft’s Latin “Core fonts for the Web” came with license agreements that did not restrict which operating system you may use, as long as the downloads were provided as-is with nothing added (so tools to adapt them for other operating systems were provided separately). This practice was stopped in 2002, apparently because they didn’t like how widely these fonts were being used in non-Microsoft systems, and subsequent font releases (including the Chinese YaHei font) came with more restrictive licenses that tended to require all users to be on Windows. 

Microsoft placed a file called VistaFont_CHS.EXE on the Official Microsoft Download Center (spelled the American way) on 20th May 2008, under the name “Simplified Chinese ClearType fonts for Windows XP” (the font was commissioned for Vista but backported to XP). The click-through EULA said you can “install and use any number of copies of the software on your devices running validly licensed copies of Microsoft Windows XP, Microsoft Windows Server 2003 and Microsoft Windows Vista” and “you may not copy, install or use the fonts on other devices.” 

So you might think “OK, let’s boot Windows on my old dual-boot machine, install the font onto that validly-licensed copy of Windows, and then reboot into GNU/Linux on the same machine and set it to use the font files on the Windows partition”. But the EULA comes back with “You may use the fonts that accompany this software only to display and print content from a device running a Microsoft Windows operating system” (emphasis mine). 

But there *might* be a loophole on this last point, because:

In some jurisdictions, there are also local laws that override Microsoft’s agreements and permit all copying for your personal, non-commercial use as long as you have legally obtained the original on a permanent basis—so if you purchased a second-hand laptop that came with a legal copy of Vista, you may copy its .ttf files to another GNU/Linux machine for your personal use. But the UK’s October 2014 “private copying exception” (a) didn’t apply to computer programs—TrueType hinting code might well count as a “program”—and (b) was quashed by a judicial review on 17th July 2015 (and the UK government said it was “not intending to take further action to reintroduce an exception”), so it seems if you are in the UK you must rely only on the permissions Microsoft itself gave—which, if my interpretation above is correct, means you must ensure the content you display was originally created on a Windows system. 

If you *do* determine it’s legal for you to use Microsoft YaHei in your particular circumstances, you can enable it for one non-root user of a modern GNU/Linux environment by adding the .ttf file to your ~/.fonts/TTF directory (create it if it’s not there) and running fc-cache -vf (you can verify this worked by checking that fc-list "Microsoft YaHei" produces output). 

It should then be available to Windows applications in WINE, although not all applications can be set to use it because WINE’s font-selection API doesn’t quite work like real Windows—a workaround is to edit .wine/system.reg and under [Software\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes] set "MS Shell Dlg"="Microsoft YaHei" then use “MS Shell Dlg” in the application (and if *that* doesn’t work, try adding a font like Droid Sans Fallback to the system and set "Droid Sans Fallback"="Microsoft YaHei" in FontSubstitutes so it can be selected that way). 

If Yahei is the *only* Chinese font on the system (e.g. on a VM) then Web browsers like Firefox should select it by default, in which case you’d better check it’s legal and that all Chinese text you display was created on a Windows system. If other Chinese fonts are installed, and you are rendering a website with CSS code that does not call for Microsoft YaHei but you wish to use it (if you’ve determined it’s legal and the website was created on a Windows system), you could either edit the CSS (e.g. via Web Adjuster’s --headAppend="<style> *:lang(cmn) { font-family: Microsoft Yahei !important } </style>" --js-upstream), or else add an override in ~/.fonts.conf but this is less reliable across rendering engines. 

Legal

This is not legal advice—I’m a computer scientist, not a lawyer; take my observations at your own risk! But it does seem like a loophole to me. All material © Silas S. Brown unless otherwise stated. Android is a trademark of Google LLC. Firefox is a registered trademark of The Mozilla Foundation. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. Microsoft is a registered trademark of Microsoft Corp. TeX is a trademark of the American Mathematical Society. TrueType is a trademark of Apple Inc., registered in the United States and other countries. Windows is a registered trademark of Microsoft Corp. Any other trademarks I mentioned without realising are trademarks of their respective holders.