đŸ Archived View for tilde.pink âș ~ssb22 âș yahei.gmi captured on 2022-04-28 at 17:30:18. Gemini links have been rewritten to link to archived content
âŹ ïž Previous capture (2021-12-03)
âĄïž Next capture (2023-01-29)
-=-=-=-=-=-=-
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.â
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.