본문 바로가기

IT/리눅스

우분투에서 한글 글꼴 안티앨리어싱(Anti-aliasing) 설정하기

우분투에서는 기본적으로 한글 글꼴에 안티앨리어싱이 적용되지 않도록 설정되어 있습니다. 이것은 한글 글꼴은 안티앨리어싱이 적용싱되지 않는 게 더 가독성이 높다는 이야기 때문이라고 하는데요. 이로 인해 안티앨리어싱이 적용되지 않을 경우, 한글 글꼴이 일그러져 보이기도 합니다.

여기에서는 한글 글꼴에 안티앨리어싱 기능을 켜는 방법에 대해 설명하도록 하겠습니다.

1. 터미널을 열어 다음 명령어를 입력합니다.
(터미널은 보통 '프로그램' 메뉴의 '보조 프로그램'에 들어 있습니다.)

sudo gedit /etc/fonts/conf.d/29-language-selector-ko-kr.conf

2. 관리자 권한으로 한글 설정 파일이 열립니다.
이제 'Turn off antialias and autohint for Korean fonts depending on pixelsize'와 'Turn off antialias and autohint for ttf-alee depending on pixelsize' 부분을 주석 처리합니다.

그러려면 다음과 같이 빨간 부분을 추가하면 됩니다.

<!-- 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>false</bool>
    </edit>
        <edit name="autohint" mode="assign">
        <bool>false</bool>
    </edit>
        <edit name="hintstyle" 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>false</bool>
    </edit>
        <edit name="autohint" mode="assign">
        <bool>false</bool>
    </edit>
</match> -->

3. 저장 단추를 누르고 텍스트 편집기를 끕니다.

이제 한글 글꼴에도 안티앨리어싱이 적용된 상태로 나오게 됩니다.

위와 같은 작업을 하지 않고 다음과 같이 29-language-selector-ko-kr.conf 파일을 삭제하는 것이 더 나을 것 같기도 합니다.

Alt + F2를 눌러 '프로그램 실행' 창이 뜨면 다음을 입력합니다.

gksu rm /etc/fonts/conf.d/29-language-selector-ko-kr.conf

혹시 모르니 /etc/fonts/conf.d/29-language-selector-ko-kr.conf 파일을 다음에 옮겨 써 둡니다.

<fontconfig>

<!-- 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>false</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>false</bool>
   </edit>
        <edit name="autohint" mode="assign">
      <bool>false</bool>
   </edit>
</match>

</fontconfig>

이 글을 쓸 때에는 다음 블로그 글을 참고했습니다. http://opensea.egloos.com/4352020