You are not logged in.

#1 2009-08-20 19:29:09

Xartrix
Member
Registered: 2009-07-28
Posts: 3

Ignorant Fontconfig

Hello,

I've installed the following font packages: ttf-bitstream-vera, ttf-inconsolata, ttf-liberation, ttf-linux-libertine, xorg-font-encodings, xorg-font-utilities, freetype2 (and some others I think are not important right now). The problem is, that none of the above have serif, sans-serif and monospace fonts, but default fontconfig settings should alias serif, sans-serif, monospace to their Bitstream Vera versions (that is done in 60-latin.conf), however that is not the case. Instead, every time I want to use serif, sans-serif or monospace, I get Linux Libertine O instead (tried with pango-view --font="sans-serif" --text="test text"). I'm using x86_64 by the way.

So, I thought that removing /etc/fonts/conf.d/* should make serif, sans-serif and monospace disappear from my system (it's only an alias, after all, right?), but here is the catch, they didn't. I've tried replacing:

<match target="pattern" name="family" >
 <test name="family" qual="any" >
  <string>sans-serif</string>
 </test>
 <edit mode="assign" name="family" >
  <string>bitstream vera sans</string>
 </edit>
</match>

, but fontconfig happily ignored it (it was in local.conf and I've kept conf.d/51-local.conf, so local.conf gets parsed).

But hey, there's more! if I use the exact same code from above (taken from wiki and fontconfig docs), just change it so that serif is replaced by inconsolata, for example, serif is successfully replaced. (On a side note, serif also gets replaced by *any* other font, except bitstream vera fonts - same ignorant case as with sans-serif). I haven't tried to replace monospace.

I have also tried second possible way of replacing, i.e:

 <alias>
        <family>sans-serif</family>
        <prefer><family>liberation sans</family></prefer>    <!-- or any other font here, again except bitstream vera family -->
  </alias>

, which seems to be working, but again, bitstream vera {serif, sans, sans mono} doesn't work here


Although I am now able to replace sans-serif with what I want, I still am not able to alias anything to bitstream vera. Also, there is this problem of "ghost" fonts, namely sans-serif, serif and monospace (I had removed configs, which aliased them to bitstream vera, remember?).

Am I missing something obvious here?

Anyway, what's the deal with this wierd (one might almost say bugged!) fontconfig? Or, is it my system only?
Note that I didn't install xorg-fonts-misc.

I hope someone will find some time and answer these questions smile
Thank you.

EDIT: fixed typos

Last edited by Xartrix (2009-08-20 23:10:49)

Offline

#2 2009-08-22 19:41:29

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: Ignorant Fontconfig

Am I missing something obvious here?

I'm stating the obvious in this reply with hope that you've overlooked something. Nothing "obvious" is apparent to my eye. It also sounds like you have done a more thorough reading of the fonts-conf man page than I have. It might be good to remember that apps can ignore the font.conf files and do their own font matching.

none of the above have serif, sans-serif and monospace fonts

Liberation fonts include serif, san-serif and monospace variations.

Here are some random suggestions.

    - Uninstall the Linux-Libertine fonts and then see what happens.
    - Reinstall BitstreamVera.
    - Force a rebuild of the font cache with "fc-cache -f".
    - Have you checked ~/.fonts.conf? Have you tried removing it?
    - Run "fc-match serif", "fc-match sans" and "fc-match mono". My output lists include BitstreamVera.
    - Run your edited config files through an XML validator. Typing errors are my frequent downfall.
    - Could you have a problem with a desktop or theme setting?

I hope one of these suggestions helps you find a solution.

Offline

#3 2009-08-23 11:51:26

Xartrix
Member
Registered: 2009-07-28
Posts: 3

Re: Ignorant Fontconfig

First of all, thanks for the reply wink

thisoldman wrote:

- Uninstall the Linux-Libertine fonts and then see what happens.

fontconfig falls back to another font

thisoldman wrote:

- Reinstall BitstreamVera.

didn't help, still can't use it in aliasing

thisoldman wrote:

- Force a rebuild of the font cache with "fc-cache -f".

doesn't help either smile

thisoldman wrote:

- Run "fc-match serif", "fc-match sans" and "fc-match mono". My output lists include BitstreamVera.

fc-match -a "somerandomfont" include vera, but as a last option. I tried removing every font, leaving only vera, and that worked.

thisoldman wrote:

- Run your edited config files through an XML validator. Typing errors are my frequent downfall.

fc-cache reports error in its conf files, none found

thisoldman wrote:

- Could you have a problem with a desktop or theme setting?

Hardly, I use blackbox and I don't have any other thing that could play with fonts in any other way.


I tested fonts with Tux Commander, which seems to add Sans, Serif and Monospace fonts, even if they aren't installed (and then fallback to Linux Libertine, because they haven't been found). That was my first pitfall. Now it makes sense, that replacing with <match ... > didn't work, because those fonts weren't there to begin with.

My second pitfall was pango-view's way of handling missing fonts... that is, pango seems to fall back to some random font, if requested font is not installed (I'm talking about font named sans-serif, I'm aware that Liberation has sans-like font, but it's not called sans-serif directly) and doesn't bother to report, that the font is missing. Almost like fc-match, but the order is different.

That solves most of the puzzle, but being unable to alias fonts to vera bugs me...
I will look into it later, as I have some ideas what may cause it...

Offline

#4 2009-08-23 14:53:33

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: Ignorant Fontconfig

Seems thera are many problems with fonts in pango. I did a search for "font" on the GNOME Bugzilla page and I came up with this:

http://bugzilla.gnome.org/buglist.cgi?q … ntent=font

It does look like you are not alone with pango font alias problems.

Offline

Board footer

Powered by FluxBB