You are not logged in.

#1 2014-03-01 10:55:31

flying sheep
Member
Registered: 2012-02-29
Posts: 96

disable tex gyre fonts

the fontconfig file /etc/fonts/conf.d/30-metric-aliases.conf makes firefox use TeX Gyre Heros (Helvetica lookalike) on pages like github.

i prefer hinted fonts on screen, and only want the gyre family for TeX, where i can specify the directly.

how to disable the gyre fonts as aliases for helvetica etc.?

Offline

#2 2014-03-01 11:21:42

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: disable tex gyre fonts

I use fontconfig-infinality and the free-font preset. Helvetica is replaced with Liberation Sans if available and Tex Gyre is only second choice for missing symbols.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#3 2014-03-01 11:55:36

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: disable tex gyre fonts

I use, in /etc/fonts/local.conf:

    <match>
        <test name="family"><string>Helvetica</string></test>
        <edit mode="assign" name="family" binding="strong"><string>Helvetica World</string></edit>
    </match>

So choose your replacement font (e.g.: Univers CE 55 Medium, Lato, Tex Gyre Heros, Liberation Sans). Test it with:

fc-match helvetica

Last edited by brebs (2014-03-01 11:56:37)

Offline

#4 2014-03-01 12:30:17

Iranon
Member
Registered: 2011-06-11
Posts: 146

Re: disable tex gyre fonts

Liberation Sans is very different from Helvetica stylistically, it just has the same metrics. They have very different uses, and mixing symbols is bound to look bad.

Offline

#5 2014-03-01 13:24:29

flying sheep
Member
Registered: 2012-02-29
Posts: 96

Re: disable tex gyre fonts

hmm, but i want github and the others just to fall back to my default sans-serif font. i want to *undo* the mapping of helvetica, not create a new one.

Offline

#6 2014-03-01 13:26:32

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: disable tex gyre fonts

Iranon wrote:

mixing symbols is bound to look bad.

Better to have bad looking symbols than none at all. Tex Gyre is AFAIK one of the few free fonts that include some special Adobe symbols like oldstyle digits. So you should have it always as last resort in a fontconfig chain.

Last edited by progandy (2014-03-01 13:26:53)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#7 2014-03-01 13:35:24

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: disable tex gyre fonts

flying sheep wrote:

hmm, but i want github and the others just to fall back to my default sans-serif font. i want to *undo* the mapping of helvetica, not create a new one.

Then try something like

$ cat ~/.config/fontconfig/fonts.conf 
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
    <alias>
        <family>Helvetica</family>
        <prefer>
            <family>sans-serif</family>
        </prefer>
    </alias>
</fontconfig>

Edit: Sorry, forgot to edit my post.

Last edited by progandy (2014-03-01 13:35:57)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#8 2014-03-01 13:35:30

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: disable tex gyre fonts

flying sheep wrote:

i want to *undo* the mapping of helvetica, not create a new one.

Then delete/edit /etc/fonts/conf.d/30-metric-aliases.conf as you see fit. Or use the method I described.

Remember, fontconfig has to map it to *something*, even if it's just Arial (the usual fallback).

Offline

#9 2014-03-01 14:37:12

flying sheep
Member
Registered: 2012-02-29
Posts: 96

Re: disable tex gyre fonts

this doesn’t do the trick:

 <match>
  <test name="family">
   <string>Helvetica</string>
  </test>
  <edit mode="assign" name="family" binding="strong">
   <string>sans-serif</string>
  </edit>
 </match>

and progandy’s neither. after both i got this.

$ fc-cache -f            
$ fc-match helvetica              
texgyreheros-regular.otf: "TeX Gyre Heros" "Regular"

and deleting 30-metric-aliases.conf is also bad, because it is useful in other cases.

the best thing would be a firefox/browser-specific override of just helvetica to sans-serif…

Offline

#10 2014-03-01 15:03:16

0strodamus
Member
Registered: 2014-01-22
Posts: 96

Re: disable tex gyre fonts

Not sure if this helps, but I use Stylish to override fonts on certain webpages that don't want to respect my system replacements.

@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document
domain("blogs.technet.com"),
domain("support.microsoft.com"),
domain("technet.microsoft.com")
{
*{font-family:Verdana,Arial !important;}
}

EDIT: removed sans-serif from code thanks to brebs.

Last edited by 0strodamus (2014-03-01 17:58:43)


archlinux | OpenRC | TOMOYO Linux | Xfce

"In his house at R'lyeh dead Cthulhu waits dreaming."

Offline

#11 2014-03-01 15:08:04

flying sheep
Member
Registered: 2012-02-29
Posts: 96

Re: disable tex gyre fonts

0strodamus wrote:

Not sure if this helps, but I use Stylish to override fonts on certain webpages that don't want to respect my system replacements.

@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document
domain("blogs.technet.com"),
domain("support.microsoft.com"),
domain("technet.microsoft.com")
{
*{font-family:Verdana,Arial,sans-serif !important;}
}

thanks, in fact i used sth. similar to fix bitmap fonts displaying on github before, but more sites than just github want to use helvetica

Offline

#12 2014-03-01 17:49:09

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: disable tex gyre fonts

"sans-serif" is not the name of a font, that's why it doesn't work. Obvious test:

$ fc-match "sans-serif"
arial.ttf: "Arial" "Normal"

Offline

#13 2014-03-01 18:04:42

0strodamus
Member
Registered: 2014-01-22
Posts: 96

Re: disable tex gyre fonts

Thanks brebs. I corrected the code I posted, although it works for me as posted. I'm not sure why there are 3 fonts even listed because the first one is what always gets used. I "borrowed" it from a userscript I found many years ago and it's always worked so I didn't change anything other than the domains. Anyway, thanks again for the correction.


archlinux | OpenRC | TOMOYO Linux | Xfce

"In his house at R'lyeh dead Cthulhu waits dreaming."

Offline

Board footer

Powered by FluxBB