You are not logged in.

#1 2011-01-30 23:21:05

lamnk
Member
Registered: 2008-01-30
Posts: 65
Website

Chromium refuses to render Helvetica, uses Arial instead

This problem makes me scratching my head:

I've installed the Helvetica font in /usr/share/fonts/Helvetica/ and ran fc-cache. With that I can use Helvetica in OpenOffice Writer. But when I specify Helvetica in Gimp or Chromium, they render Arial instead.

Maybe this is the reason?

% fc-match Helvetica
arial.ttf: "Arial" "Normal"

However fc-match shows that Helvetica is indeed there.

% fc-match -a | grep Helvetica
Helvetica.otf: "Helvetica" "Medium"
helvR12-ISO8859-1.pcf.gz: "Helvetica" "Regular"
helvR12.pcf.gz: "Helvetica" "Regular"
helvB12-ISO8859-1.pcf.gz: "Helvetica" "Bold"
helvB12.pcf.gz: "Helvetica" "Bold"

So why does my system always use Arial instead of Helvetica ??

Last edited by lamnk (2011-01-30 23:29:19)

Offline

#2 2011-01-31 00:55:54

frabjous
Member
Registered: 2010-07-13
Posts: 367

Re: Chromium refuses to render Helvetica, uses Arial instead

Is there anything in one of these files (especially the first or the last) which looks like it  might be the culprit? Try grepping them for Helvetica....


   /etc/fonts/fonts.conf
   /etc/fonts/fonts.dtd
   /etc/fonts/conf.d/30-metric-aliases.conf (especially, and...)
   /etc/fonts/conf.d/* (generally)
   ~/.fonts.conf.d/*
   ~/.fonts.conf

Last edited by frabjous (2011-01-31 00:58:34)

Offline

#3 2011-01-31 01:26:34

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

Re: Chromium refuses to render Helvetica, uses Arial instead

Somewhere in your ~/.fonts.conf or in /etc/fonts.d/ there is a substitution or preference setting, telling fontconfig to use Arial whenever Helvetica is asked for by an application.

I'd search through ~/.fonts.conf first, to see if there is a substitution of Arial for Helvetica; that's commonly done when people are using a customized fonts.conf.

You can search through /etc/fonts.d for the files where "Helvetica" occurs with something like this command:

grep -nTr "Helvetica" /etc/fonts/conf.d

That will print a table with the filename, the line number in the file, and finally the line itself for any matches that occur.

OpenOffice, Java and some versions of Firefox ignore fontconfig.  I don't know about Chromium, but I would have thought Gimp would pull the true Helvetica.  If you're using Gnome or KDE, I'd check their system font settings too.

Offline

#4 2011-01-31 17:10:52

lamnk
Member
Registered: 2008-01-30
Posts: 65
Website

Re: Chromium refuses to render Helvetica, uses Arial instead

Thank you thisoldman and frabjous, there is a file named 29-replace-bitmap-fonts.conf in /etc/font/confs.d/ with this content:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <!-- Replace generic bitmap font names by generic font families.
         These font-families will get replaced by other rules and
         default to scaled ones. -->
    <match target="pattern" name="family">
        <test name="family" qual="any">
            <string>Helvetica</string>
        </test>
        <edit mode="assign" name="family">
            <string>Arial</string>
            <string>Liberation Sans</string>        
            <string>sans-serif</string>
        </edit>
    </match>
    <match target="pattern" name="family">
        <test name="family" qual="any">
            <string>Courier</string>
        </test>
        <edit mode="assign" name="family">
            <string>Courier New</string>
            <string>Liberation Mono</string>
            <string>monospace</string>
        </edit>
    </match>
    <match target="pattern" name="family">
        <test name="family" qual="any">
            <string>Times</string>
        </test>
        <edit mode="assign" name="family">
            <string>Times New Roman</string>
            <string>Liberation Serif</string>
            <string>serif</string>
        </edit>
    </match>
</fontconfig>

I comment out the section relevant to Helvetica, run fc-cache and it works now !

Offline

Board footer

Powered by FluxBB