Fonts.conf에서 글꼴의 기본 스타일 설정

Fonts.conf에서 글꼴의 기본 스타일 설정

fonts.conf어떤 이유로든 굵은 버전이 항상 일치하기 때문에 글꼴의 기본 스타일을 설정하려고 합니다 .

$ fc-match monospace
LigaOperatorMonoSSm-Bold.otf: "Liga Operator Mono SSm" "Bold"

이것은 나의 fonts.conf:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
  <edit name="antialias" mode="assign"><bool>true</bool></edit>

  <match target="pattern">
    <test qual="any" name="family"><string>Liga Operator Mono SSm</string></test>
    <edit name="style" mode="assign" binding="same"><string>Medium</string></edit>
  </match>

  <alias>
    <family>serif</family>
    <prefer><family>Circular Std</family></prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer><family>Circular Std</family></prefer>
  </alias>
  <alias>
    <family>sans</family>
    <prefer><family>Circular Std</family></prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer><family>Liga Operator Mono SSm</family></prefer>
  </alias>
  <alias>
    <family>terminal</family>
    <prefer><family>Liga Operator Mono SSm</family></prefer>
  </alias>
</fontconfig>

보시다시피 기본 너비를 로 설정하려고 했지만 Medium불행히도 작동하지 않습니다. 사용 가능한 스타일은 다음과 같습니다.

/usr/share/fonts/OTF/LigaOperatorMonoSSm-LightItalic.otf: Liga Operator Mono SSm:style=Light Italic,Italic
/usr/share/fonts/OTF/LigaOperatorMonoSSm-MediumItalic.otf: Liga Operator Mono SSm:style=Medium Italic,Italic
/usr/share/fonts/OTF/LigaOperatorMonoSSm-Medium.otf: Liga Operator Mono SSm:style=Medium,Regular
/usr/share/fonts/OTF/LigaOperatorMonoSSm-BoldItalic.otf: Liga Operator Mono SSm:style=Bold Italic,Italic
/usr/share/fonts/OTF/LigaOperatorMonoSSm-Book.otf: Liga Operator Mono SSm:style=Book,Regular
/usr/share/fonts/OTF/LigaOperatorMonoSSm-Bold.otf: Liga Operator Mono SSm:style=Bold,Regular
/usr/share/fonts/OTF/LigaOperatorMonoSSm-BookItalic.otf: Liga Operator Mono SSm:style=Book Italic,Italic
/usr/share/fonts/OTF/LigaOperatorMonoSSm-Light.otf: Liga Operator Mono SSm:style=Light,Regular

실수가 어디에 있는지 아는 사람이 있나요? 감사해요!

답변1

Operator Mono에서 잘못된 메타데이터를 수정하는 데 사용한 방법은 다음과 같습니다.

 <!-- Fixup Operator Mono weights -->
 <match target="scan">
   <test name="family">
     <string>Operator Mono Bold</string>
   </test>
   <edit name="weight">
     <const>bold</const>
   </edit>
 </match>
 <match target="scan">
   <test name="family">
     <string>Operator Mono Book</string>
   </test>
   <edit name="weight">
     <const>book</const>
   </edit>
 </match>
 <match target="scan">
   <test name="family">
     <string>Operator Mono XLight</string>
   </test>
   <edit name="weight">
     <const>extralight</const>
   </edit>
 </match>

글꼴 이름을 바꾸고 나중에 바꾸는 것을 잊지 마십시오 fc-cache -f.

답변2

나는 (다른 글꼴로) 같은 문제에 직면했습니다. 이런 종류의 일이 나를 위해 일한 것입니다.

<match target="pattern">
    <test name="family" compare="eq">
        <string>Liga Operator Mono SSm</string>
    </test>
    <edit name="style" mode="append">
        <string>Medium</string>
    </edit>
</match>

기본적으로 이는 "Liga Operator Mono SSm" 제품군을 검색할 때마다 검색할 스타일 목록 끝에 "Medium"을 추가하라는 의미입니다. 따라서 지정된 다른 스타일이 있는 경우 해당 스타일이 우선적으로 적용되지만, 없는 경우에는 "Medium"을 사용하여 글꼴을 찾습니다.

...제 생각에는. Fontconfig 문서는 약간 혼란스럽습니다.

관련 정보