Skip to content

Instantly share code, notes, and snippets.

@zhao-gang
Created April 21, 2012 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhao-gang/2435708 to your computer and use it in GitHub Desktop.
Save zhao-gang/2435708 to your computer and use it in GitHub Desktop.
kindle touch custom chinese font config file -- put it under /etc/fonts/conf.d/
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Load customization font files -->
<dir>/mnt/us/fonts</dir>
<!-- font family -->
<!-- Serif Family -->
<!-- scanning Regular font -->
<match target="scan">
<test name="file" compare="eq">
<!-- make sure change all the file names to your own -->
<string>/mnt/us/fonts/CJK Regular.ttf</string>
</test>
<edit name="family" mode="assign">
<string>CJK</string>
</edit>
<edit name="style" mode="assign">
<string>Regular</string>
</edit>
<edit name="weight" mode="assign">
<const>medium</const>
</edit>
</match>
<!-- scanning Bold font -->
<match target="scan">
<test name="file" compare="eq">
<string>/mnt/us/fonts/CJK/CJK Bold.ttf</string>
</test>
<edit name="family" mode="assign">
<string>CJK</string>
</edit>
<edit name="style" mode="assign">
<string>Bold</string>
</edit>
<edit name="weight" mode="assign">
<const>bold</const>
</edit>
</match>
<!-- scanning Italic font -->
<match target="scan">
<test name="file" compare="eq">
<string>/mnt/us/fonts/CJK Italic.ttf</string>
</test>
<edit name="family" mode="assign">
<string>CJK</string>
</edit>
<edit name="style" mode="assign">
<string>Italic</string>
</edit>
<edit name="weight" mode="assign">
<const>italic</const>
</edit>
</match>
<!-- scanning BoldItalic font -->
<match target="scan">
<test name="file" compare="eq">
<string>/mnt/us/fonts/CJK Bold Italic.ttf</string>
</test>
<edit name="family" mode="assign">
<string>CJK</string>
</edit>
<edit name="style" mode="assign">
<string>BoldItalic</string>
</edit>
<edit name="weight" mode="assign">
<const>bold</const>
</edit>
</match>
<!-- serif -->
<match target="pattern" name="family">
<test name="family">
<string>HeiseiMaruGoth_JIS0213_E</string>
</test>
<edit name="family" mode="prepend">
<string>CJK</string>
</edit>
</match>
</fontconfig>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment