ubuntu 에서 폰트 우선순위 정하기 (7.10, 8.04)
Computing 2008. 6. 9. 13:27홈 디렉토리에
.fonts.conf 를 아래와 같이 만든다 :
필요하다면 /etc/fonts/conf.avail/ 디렉토리 아래의 language-selector 들 중 ko-kr 파일을 수정해 준다.
language selector 까지는 수정하지 않아도 그럭저럭 만족스러운 결과가 나온다.
위의 설정파일들은 맑은고딕을 설치한 후의 설정이니 주의할 것.
.fonts.conf 를 아래와 같이 만든다 :
- shawn.ygdrasil:~$ cat .fonts.conf
- <fontconfig>
- <!-- Always on antialiasing for Korean letters -->
- <match target="font">
- <edit name="antialias" mode="assign">
- <bool>true</bool>
- </edit>
- <edit name="autohint" mode="assign">
- <bool>false</bool>
- </edit>
- <edit name="hintstyle" mode="assign">
- <const>hintmedium</const>
- </edit>
- </match>
- <!-- Set preferred Korean fonts -->
- <match target="font">
- <test name="lang" compare="contains">
- <string>ko</string>
- </test>
- <alias>
- <family>serif</family>
- <prefer>
- <family>Malgun Gothic</family>
- </prefer>
- </alias>
- </match>
- <match target="font">
- <test name="lang" compare="contains">
- <string>ko</string>
- </test>
- <alias>
- <family>sans-serif</family>
- <prefer>
- <family>Malgun Gothic</family>
- <family>UnDotum</family>
- </prefer>
- </alias>
- </match>
- <match target="font">
- <test name="lang" compare="contains">
- <string>ko</string>
- </test>
- <alias>
- <family>monospace</family>
- <prefer>
- <family>Malgun Gothic</family>
- <family>UnDotum</family>
- </prefer>
- </alias>
- </match>
- </fontconfig>
필요하다면 /etc/fonts/conf.avail/ 디렉토리 아래의 language-selector 들 중 ko-kr 파일을 수정해 준다.
- shawn.ygdrasil:~$ cat ko_KR
- <fontconfig>
- <include ignore_missing="yes">CJK_aliases</include>
- <!-- Turn on antialias and hinting with hintmedium -->
- <match target="font" >
- <edit mode="assign" name="antialias" >
- <bool>true</bool>
- </edit>
- </match>
- <match target="font" >
- <edit mode="assign" name="hinting" >
- <bool>true</bool>
- </edit>
- </match>
- <match target="font" >
- <edit mode="assign" name="hintstyle" >
- <const>hintmedium</const>
- </edit>
- </match>
- <!-- Control spacing property for Korean -->
- <match target="font">
- <test name="lang" compare="contains">
- <string>ko</string>
- </test>
- <test name="spacing" compare="eq">
- <const>dual</const>
- </test>
- <edit name="spacing">
- <const>proportional</const>
- </edit>
- <edit name="globaladvance" binding="strong">
- <bool>false</bool>
- </edit>
- </match>
- <match target="font">
- <test name="lang" compare="contains">
- <string>ko</string>
- </test>
- <test name="outline" compare="eq">
- <bool>false</bool>
- </test>
- <test name="spacing" compare="eq">
- <const>mono</const>
- <const>charcell</const>
- </test>
- <edit name="spacing">
- <const>proportional</const>
- </edit>
- <edit name="globaladvance" binding="strong">
- <bool>false</bool>
- </edit>
- </match>
- <!-- Turn off antialias and autohint for Korean fonts depending on pixelsize -->
- <match target="font">
- <test name="lang" compare="contains">
- <string>ko</string>
- </test>
- <test name="pixelsize" compare="more">
- <int>10</int>
- </test>
- <test name="pixelsize" compare="less">
- <int>22</int>
- </test>
- <edit name="antialias" mode="assign">
- <bool>true</bool>
- </edit>
- <edit name="autohint" mode="assign">
- <bool>false</bool>
- </edit>
- <edit name="hintstyle" mode="assign">
- <const>hintmedium</const>
- </edit>
- </match>
- <!-- Turn on antialias and hinting with hintmedium for ttf-Unfonts -->
- <match target="font">
- <test name="family" compare="contains">
- <string>Un</string>
- </test>
- <edit name="antialias" mode="assign">
- <bool>true</bool>
- </edit>
- <edit name="hinting" mode="assign">
- <bool>true</bool>
- </edit>
- <edit name="hintsytle" mode="assign">
- <const>hintmedium</const>
- </edit>
- </match>
- <!-- Turn off antialias and autohint for ttf-alee depending on pixelsize -->
- <match target="font">
- <test name="family">
- <string>Guseul</string>
- </test>
- <edit name="autohint" mode="assign">
- <bool>true</bool>
- </edit>
- </match>
- <match target="font">
- <test name="family">
- <string>Guseul</string>
- <string>Guseul Mono</string>
- </test>
- <test name="pixelsize" compare="more">
- <int>11</int>
- </test>
- <test name="pixelsize" compare="less">
- <int>16</int>
- </test>
- <edit name="antialias" mode="assign">
- <bool>true</bool>
- </edit>
- <edit name="autohint" mode="assign">
- <bool>false</bool>
- </edit>
- </match>
- <!-- Set preferred Korean fonts -->
- <match target="font">
- <test name="lang" compare="contains">
- <string>ko</string>
- </test>
- <alias>
- <family>serif</family>
- <prefer>
- <family>UnBatang</family>
- </prefer>
- </alias>
- </match>
- <match target="font">
- <test name="lang" compare="contains">
- <string>ko</string>
- </test>
- <alias>
- <family>sans-serif</family>
- <prefer>
- <family>UnDotum</family>
- <family>Guseul</family>
- </prefer>
- </alias>
- </match>
- <match target="font">
- <test name="lang" compare="contains">
- <string>ko</string>
- </test>
- <alias>
- <family>monospace</family>
- <prefer>
- <family>UnDotum</family>
- <family>Guseul Mono</family>
- </prefer>
- </alias>
- </match>
- <!-- Bind EunGuseul with Bitstream Vera Sans -->
- <match target="pattern">
- <test name="family">
- <string>Guseul</string>
- </test>
- <edit mode="append" binding="strong" name="family">
- <string>Bitstream Vera Sans</string>
- </edit>
- </match>
- <!-- Bind EunGuseul Mono with Bitstream Vera Sans Mono -->
- <match target="pattern">
- <test name="family">
- <string>Guseul Mono</string>
- </test>
- <edit mode="append" binding="strong" name="family">
- <string>Bitstream Vera Sans Mono</string>
- </edit>
- </match>
- </fontconfig>
language selector 까지는 수정하지 않아도 그럭저럭 만족스러운 결과가 나온다.
위의 설정파일들은 맑은고딕을 설치한 후의 설정이니 주의할 것.