2/Server

fc-cache

berry-hi 2019. 4. 10. 10:43


Fontconfig

Fontconfig는 주로 Graphical Linux 데스크톱에서 폰트 설정을 위해 사용된다.

 

fc 명령어 옵션

fc 뒤에 띄어쓰기 없이 바로 -옵션으로 사용해야 한다.

  • fc-list: Lists all fonts fontconfig knows about or all fonts matching a pattern.
    • 패턴에 맞는 모든 폰트나 fontconfig가 아는 모든 폰트의 List 출력
    • 패턴이란? 명령어 뒤에 | grep 글꼴 이름 처럼 사용하는 것!
  • fc-match: Matches font-pattern (empty pattern by default) using the normal fontconfig matching rules to find the most appropriate font available.
    • 매치된 글꼴을 정보 출력
  • fc-cache: Creates a cache of all FreeType readable fonts in a specified directory or create a cache of all FreeType readable fonts from all directories specified in Configuration files.
    • 글꼴 추가 후 글꼴 캐시를 재 생성하여 추가 글꼴을 사용 가능하게 함.
      • -f : 강제 갱신
      • -r : 존재하는 폰트 캐시 지우고 갱신
      • -s : 시스템 전반적인 디렉토리만 갱신
      • -v: status 정보 출력
      • -V: font config 버전 출력
  • fc-cat: Reads the font information from cache files or related to font directories and emits it in ASCII form.
    • 폰트 캐시파일로 부터 폰트 정보 읽어옴
  • fc-query: Querys font files and reports resulting pattern(s).
    • 폰트 파일에 대한 정보 볼 수 있음
      • fc-query /usr/share/fonts/폰트이름처럼 사용
  • fc-scan: Scans font files and directories and reports resulting pattern(s).
    • 폰트 파일이랑 디렉토리 읽어옴
    • 패턴에 맞는 결과 출력
  • fc-pattern: Lists best font(s) matching the supplied pattern(s).
    • 리눅스 지원 안됨
  • fc-validate: Validate font file(s) and reports the results.
    • 리눅스 지원 안됨

 

 

 

[root@localhost ~]# fc-cache --help
usage: fc-cache [-frsvVh] [--force|--really-force] [--system-only] [--verbose] [--version] [--help] [dirs]
Build font information caches in [dirs]
(all directories in font configuration by default).

  -f, --force          scan directories with apparently valid caches
  -r, --really-force   erase all existing caches, then rescan
  -s, --system-only    scan system-wide directories only
  -v, --verbose        display status information while busy
  -V, --version        display font config version and exit
  -h, --help           display this help and exit
  
  
[root@localhost ~]# fc-scan
usage: fc-scan [-Vh] [-f FORMAT] [--format FORMAT] [--version] [--help] font-file...
Scan font files and directories, and print resulting pattern(s)

  -f, --format=FORMAT  use the given output format
  -V, --version        display font config version and exit
  -h, --help           display this help and exit

[root@localhost ~]# fc-query
usage: fc-query [-Vh] [-i index] [-f FORMAT] [--index index] [--format FORMAT] [--version] [--help] font-file...
Query font files and print resulting pattern(s)

  -i, --index INDEX    display the INDEX face of each font file only
  -f, --format=FORMAT  use the given output format
  -V, --version        display font config version and exit
  -h, --help           display this help and exit

 

 

 

출처 : https://en.wikipedia.org/wiki/Fontconfig#Files