fonts.conf - use fontes Droid sempre que possível

2

Eu quero onde for possível usar fontes Droid. Então eu criei ~/.fonts.conf com este conteúdo:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
  <alias>
    <family>serif</family>
    <prefer>
      <family>Droid</family>
    </prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Droid</family>
    </prefer>
  </alias>
  <alias>
    <family>sans</family>
    <prefer>
      <family>Droid</family>
    </prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer>
      <family>Liberation</family>
    </prefer>
  </alias>
 <match target="font">
  <edit mode="assign" name="rgba">
   <const>none</const>
  </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>
 <dir>~/.fonts</dir>
 <match target="font">
  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>
 </match>
</fontconfig>

Mas eu entendo isso no console:

vic@wic:~/Documents$ fc-match sans
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.
DejaVuSans.ttf: "DejaVu Sans" "Book"

Eu tentei reiniciar o computador, mas recebo o mesmo resultado.

Como faço para forçar o Ubuntu a usar fontes Droid sempre que possível?

    
por warvariuc 30.09.2012 / 19:46

1 resposta

2

Ok, eu substituí 'Droid' por 'Droid Sans', 'Droid Serif', etc., e funcionou:

vic@wic:~/Documents$ fc-match sans
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.
DroidSans.ttf: "Droid Sans" "Regular"
vic@wic:~/Documents$ fc-match serif
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.
DroidSerif-Regular.ttf: "Droid Serif" "Regular"
vic@wic:~/Documents$ fc-match sans-serif
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.
DroidSans.ttf: "Droid Sans" "Regular"
vic@wic:~/Documents$ fc-match mono
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.
LiberationMono-Regular.ttf: "Liberation Mono" "Regular"
vic@wic:~/Documents$ 

Em seguida, adicionei mais padrões ao arquivo e agora as fontes são substituídas no navegador:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
  <alias>
    <family>serif</family>
    <prefer>
      <family>Droid Serif</family>
    </prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Droid Sans</family>
    </prefer>
  </alias>
  <alias>
    <family>sans</family>
    <prefer>
      <family>Droid Sans</family>
    </prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer>
      <family>Liberation Mono</family>
    </prefer>
  </alias>

  <!-- Replace Arial, Times New Roman, Verdana and Courier New -->
  <!-- with their counterparts. Strong binding used to override -->
  <!-- distribution defaults -->
  <match target="pattern" name="family">
    <test name="family" qual="any">
      <string>Arial</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>Dorid Sans</string>
    </edit>
  </match>
  <match target="pattern" name="family">
    <test name="family" qual="any">
      <string>Times New Roman</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>Droid Serif</string>
    </edit>
  </match>
  <match target="pattern" name="family">
    <test name="family" qual="any">
      <string>Verdana</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>Droid Sans</string>
    </edit>
  </match>
  <match target="pattern" name="family">
    <test name="family" qual="any">
      <string>Helvetica</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>Droid Sans</string>
    </edit>
  </match>
  <match target="pattern" name="family">
    <test name="family" qual="any">
      <string>Courier New</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>Liberation Mono</string>
    </edit>
  </match>
  <match target="pattern" name="family">
    <test name="family" qual="any">
      <string>Courier</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>Liberation Mono</string>
    </edit>
  </match>


  <match target="font">
  <edit mode="assign" name="rgba">
   <const>none</const>
  </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>
 <dir>~/.fonts</dir>
 <match target="font">
  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>
 </match>
</fontconfig>
    
por warvariuc 30.09.2012 / 19:50