Fontconfig/ko

From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page Fontconfig and the translation is 68% complete.
Outdated translations are marked like this.
Resources

fontconfig 라이브러리(media-libs/fontconfig)는 GUI 프로그램에서 사용할 단일 글꼴 선택, 설정 수단을 제공합니다. 다양한 데스크톱 환경에서 자체적으로 글꼴을 우선 적용하거나 설정 수단을 제공하고 있지만, fontconfig는 여전한 기반 라이브러리 역할을 합니다.

설치

fontconfig가 필요할 때는 대부분 이미 설치한 상태입니다. fontconfig가 없다면 그래픽 하위시스템 (예. X 또는 Wayland)과 데스크톱 환경 을 제대로 설정했는지 확인하십시오.

USE 플래그

fontconfig에는 알려진 USE 플래그가 많지 않습니다.

USE flags for media-libs/fontconfig A library for configuring and customizing font access

doc Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
nls Add Native Language Support (using gettext - GNU locale utilities)
test Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)

설정

참고
fontconfig 파일을 바꾸고 나면 다시 시작한 프로그램에만 설정이 반영됩니다!

일반

fontconfig/etc/fonts/ 디렉터리의 XML 파일을 사용하여 내부 설정을 만듭니다. 기본적으로 제대로 된 기본값을 설정하며, /etc/fonts/conf.d/ 내용을 해석하기도 하는 코드가 들었는 /etc/fonts/fonts.conf를 해석합니다(사용자는 이 파일을 편집하면 안됩니다!). 게다가 fontconfig의 일부 양상을 다루는 다양하게 사용할 수 있는 설정 파일이 /etc/fonts/conf.avail/ 에 들어있습니다. /etc/fonts/conf.d/ 경로에 필요한 파일을 개별적으로 심볼릭 링크를 걸어둡니다. 이 파일은 이름 순으로 실행합니다. 이런 이유로 이름 앞에 파일에 영향을 주는 요소를 나타내는 두자리 숫자로 시작(클래스라고 함)하는 이름을 정합니다.

젠투 관련

젠투 배포판에는 일반적으로 정확하게 설명해드린 eselect 모듈(eselect fontconfig)이 들어있습니다. /etc/fonts/conf.avail/에 있는 파일의 심볼릭 링크를 /etc/fonts/conf.d/ 디렉터리에 추가하거나 제거하여 관리합니다. 명백한 이유로 인해 시스템 전역에 영향을 주는 설정 파일을 바꾸려면 그에 합당한 권한이 필요합니다.

다음 하위섹션에서는 fontconfig eselect 모듈을 다루는 방법을 설명하겠습니다.

존재 파일 나타내기

list 명령은 기존의 fontconfig 파일을 보여주며, 활성화 항목은 애스터리스크(*)로 표시합니다.

root #eselect fontconfig list
Available fontconfig .conf files (* is enabled):
  [1]   10-autohint.conf *
  [2]   10-no-sub-pixel.conf
  [3]   10-sub-pixel-bgr.conf
  [4]   10-sub-pixel-rgb.conf
  [5]   10-sub-pixel-vbgr.conf
  [6]   10-sub-pixel-vrgb.conf
  [7]   10-unhinted.conf
  [8]   11-lcdfilter-default.conf
  [9]   11-lcdfilter-legacy.conf
  ...
경고
각기 다른 시스템의 fonts.avail에 각기 다른 파일이 존재하므로 출력은 다를 수도 있습니다. 다른 참고 원문(블로그 게시글, 위키 게시글)에 있지만 보이지 않는 번호는 사용하시면 안됩니다.

파일 활성화

파일은 파일 이름 또는 각 괄호의 번호로 활성화할 수 있습니다. 다음 두가지 경우는 같습니다:

root #eselect fontconfig enable 10-sub-pixel-rgb.conf
root #eselect fontconfig enable 4

파일 비활성화

다음과 같이 파일을 비활성화할 수 있습니다:

root #eselect fontconfig disable 10-sub-pixel-rgb.conf
root #eselect fontconfig disable 4

시스템 영역 범위 개별 설정

개별적인 시스템 범위 fontconfig 파일을 만들려면 51-local.conf를 활성화하고 /etc/fonts/local.conf(XML 파일)을 만드십시오.

파일 /etc/fonts/local.conf산세리프 글꼴을 대체 순서로 원하는대로 설정한 파일 예제
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Ubuntu</family>
      <family>TakaoPGothic</family>
      <family>Droid Sans</family>
    </prefer>
    <default><family>DejaVu Sans</family></default>
  </alias>
</fontconfig>

분명하게 말하자면 이 부분은 산세리프 글꼴과 함께 사용할 경우 (순서대로) Ubuntu, TakaoPGothic, Droid Sans 글꼴을 DejaVu 산스(필요할 때 "기본 값"으로만 사용할 수 있음)보다 더욱 "선호"함을 나타냅니다. 분명하게 말해서, 다른식으로도 설정할 수 있습니다.

사용자별 설정

사용자별 fontconfig 파일을 만들려면 50-user.conf 파일(기본으로 활성화한 상태)을 활성화하고, 최종 사용자에게 ~/.config/fontconfig/fonts.conf 파일을 사용하게 하십시오. 이 파일은 local.conf와 동일한 XML 형식입니다.

참고
데스크톱 환경 폰트 렌더링에 영향을 줄 수 있는 방법입니다. 실제로 개별적으로 설정할 때 시스템 영역에 영향을 미치는 설정인지 확인하여 신중하게 비활성화해야합니다. 이 항목을 비활성화하면 여러 사용자 계정에 좀 더 동일하게 글꼴 모양새 표현을 할 수도 있습니다.
참고
이전에 사용한 ~/.fonts.conf 파일은 이제 $XDG_CONFIG_HOME 기반 위치의 방식을 사용하면서 더이상 사용하지 않는 방식입니다. 이 변수는 기본적으로 ~/.config 위치를 가리킵니다.

설정 점검

예를 들어 기본 글꼴을 에이리얼로 바꿀 때 다음과 같이 입력하십시오:

user $fc-match Arial

앤티 애일리어싱, 힌팅, 하위픽셀 렌더링

마찬가지로 표현 방식도 조절할 수 있습니다. 다음 섹션에서 앤티 애일리어싱, 힌팅, 하위픽셀 렌더링 기능을 조절해보겠습니다.

기능 설명
안티 애일리어싱 기본적으로 활성화상태이며, 글꼴을 각진 모양새로 보이지 않도록 합니다.
힌팅 현재 디스플레이 영역의 픽셀 계수 단위로 대응을 시도합니다. 제대로 된 힌팅처리 설정을 하면 글꼴이 약간 선명해 보일 수 있지만 글꼴 측정 단위가 (그리고 바뀐다 하더라도 거의 안바뀝니다) 전체적으루다가 텍스트가 어떻게 바뀌어 보이는지는 영향을 주지 않습니다.
하위픽셀 렌더링 LCD 행렬은 텍스트 해상도의 3배수에 해당하는 광 3원색을 활용하는게 사실이지만 문자가 실제로 완전한 검은색으로 나타나지 않을 수 있습니다. lcdfilter를 하위 픽셀 렌더링(fontconfig 새 버전에서 사용할 수 있음)에 활용하지 못하게 할 수 있지만, 문자를 상당히 뭉개져보이게 할 수 있습니다. 결론적으로 이 기능은 전적으로 사용자가 텍스트의 어떤 모양새를 좋아하는지에 달려있습니다.

강제 힌팅

기본 fontconfig 동작에서 기대하고자 하는 힌팅은 문서로 남겨두지 않았지만, 시스템 전반적으로 기본 설정이 되게 끔 결정적인 차선의 설정으로 만들 수 있습니다.

  1. 우선 /etc/fonts/local.conf 파일을 활성화하십시오
  2. 기본적으로 완전한 힌팅을 하도록 local.conf 파일을 편집하십시오

local.conf 일부에서는 완전한 힌팅을 활성화합니다:

파일 /etc/fonts/local.conf완전한 힌팅 설정
<match target="font">
  <edit mode="assign" name="hintstyle">
    <const>hintfull</const>
  </edit>
</match>
참고
대부분의 글꼴은 완전한 힌팅을 적용하면 더욱 보기 좋지만 어떤 글꼴은 약하게 적용하든지 아주아주아주 드물게 사용하는 다른 힌팅 옵션이 필요합니다. 어떤 글꼴은 한가지 이상의 이유로 항상 못생긴 모양새를 보여줄 수 있습니다.

하위픽셀 렌더링 사용

LCD 행렬의 하위 픽셀 배치 결정은 상당히 중요합니다. 보통 RGB(10-sub-pixel-rgb.conf)지만, 확인하는 유일한 방법은 디스플레이 명세를 확인하든지 sub-pixel 배치 시험을 통해 확인하는 방법뿐입니다.

하위 픽셀 배치를 설정하고 나면, 적합한 10-sub-pixel-<matrix type>.conf 파일을 활성화하십시오.

root #eselect fontconfig enable 10-sub-pixel-rgb.conf

가능하다면 진심으로 하위픽셀 렌더링에 lcdfilter를 사용하시는게 좋겠습니다. 다양한 설정이 딸려오지만 모든 일반 글꼴에는 (11-lcdfilter-default.conf) 설정이 적당합니다.

root #eselect fontconfig enable 11-lcdfilter-default.conf

자동 힌터 관련

자동 힌터는 어떤 기존의 힌팅 정보와는 무관하게 자동 힌팅을 시도합니다. 이 기능이 기본이 되기 전에는 TrueType2가 특허를 다루었기 때문이었지만 지금은 만료됐고, 이걸 사용할 이유가 별로 없습니다. 기술적 관점에서 보면 글자가 깨져보이거나 힌팅 정보가 없거나 하는 것보단 낫지만, 바람직한 힌팅 정보를 통해 글꼴에 대한 차선 적용책이 될 수 있습니다. 일반 시스템 글꼴은 후자 방식을 적용하므로 자동 힌터는 사용할 일이 없습니다.

경고
자동 힌터는 하위픽셀 렌더링과 호환성이 없으니 함께 사용하지 마십시오!

글꼴 선택

올바른 글꼴 선택은 올바른 힌팅 형식을 결정하는 것보다 더욱 까다로울 수 있습니다. 이런 이유 때문이거나 또는 다른 어떤 글꼴이... 완벽하게 보일리는 없겠지만 동일해보이는 글꼴이면서 더욱 멋드러져보이게 만들 수 있다면, 윈도우 7 기본 글꼴 설정을 넣어보십시오.

참고
Many fonts don't provide glyphs for every assigned Unicode codepoint, due to the size of Unicode. If a font doesn't provide a glyph for a given codepoint, the character might be represented by a substitute character (such as a rectangle containing the hexadecimal value of the code point), or by a glyph from a different font (the "fallback font"), depending on the application.

젠투에 잘 알려졌으리라 생각되는 몇 가지 추천 글꼴을 소개합니다:

Font family

Pros

Cons

Liberation
media-fonts/liberation-fonts

Red Hat's fonts, which are metric-compatible with MS TrueType corefonts, have a decent, modern look. This is the Gentoo Fonts team recommendation for default Latin fonts. Covers about 2,600 code points.

Latin, Greek, Cyrillic, and Hebrew only. A few glyphs may have hinting trouble.

Linux Libertine
media-fonts/libertine

Very similar to Liberation, covering about 2,700 code points. Linux Libertine itself is proportional serif only, but the package contains less extensive sans and mono fonts, as well. Can be used as a fallback for some glyphs not in Liberation.

Latin, Greek, Cyrillic, and Hebrew only. Sans and mono fonts are limited.

Noto
media-fonts/noto

Google's font family that aims to support all the world's languages (so, well over 60,000 code points). It goes well with Liberation or Droid. Adobe's Source Han Sans fonts are included for CJK. Recommended as a fallback for many glyphs not covered by Liberation.

Big download.

DejaVu
media-fonts/dejavu

Many styles and covers a lot of code points (about 6,100 for sans).

Exceptionally wide — even condensed is wider than same-height monospace. Overall second to Verdana (an MS font) in width. Sans-serif font is only average.

Droid
media-fonts/droid

Covers a lot of code points and scripts.

Very dry, wide yet thin glyphs. Clearly designed with handheld devices and their small screens in mind.

Gentium Plus
media-fonts/sil-gentium

Fairly distinctive; might appeal to people who like narrow fonts.

Serif only. As with other SIL fonts, the hinting is questionable.

Ubuntu
media-fonts/ubuntu-font-family

Used in Ubuntu (obviously). A distinctive font family with a style which might not appeal to everyone. Overall looks good and covers a fair number of code points.

Only the sans-serif font is truly polished; narrow and monospaced versions are unfinished. No known serif font that would accompany it well.

URW
media-fonts/urw-fonts

Metric compatible with popular Adobe fonts (among others?).

Seem to require slight hinting.

MS TrueType corefonts
media-fonts/corefonts

Includes most fonts used in documents and on the web.

MS does not distribute them nowadays, so the available fonts are from many years ago and do not reflect their current state (not to mention the state of the art). Obviously, lacks fonts introduced more recently. Require full hinting.

Unifont
media-fonts/unifont

Covers a lot of code points.

In addition to being ugly as sin, it also fails some basic requirements to be considered a typeface. Is it sans-serif? Is it serif? Please never use this.


외부 자료