You are not logged in.

#1 2013-01-06 04:41:57

Brok9n
Member
Registered: 2013-01-06
Posts: 10

[SOLVED] Github Fonts

Hey, I'm trying to fix up the fonts on Github, however I'm not having much luck.

Example

Font config:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

<match target="pattern">
	<test qual="any" name="family"><string>Courier</string></test>
	<edit name="family" mode="assign" binding="same"><string>Oxygen Mono</string></edit>
</match>

<match target="pattern">
	<test qual="any" name="family"><string>Courier New</string></test>
	<edit name="family" mode="assign" binding="same"><string>Oxygen Mono</string></edit>
</match>

</fontconfig>

I created that using this method. From what I can tell, it isn't replacing the fonts, or I'm replacing the wrong ones. Either way, I'd appreciate some help smile

Last edited by Brok9n (2013-01-07 21:23:24)

Offline

#2 2013-01-07 03:10:58

coproduct
Member
Registered: 2011-09-30
Posts: 22

Re: [SOLVED] Github Fonts

Github uses the following font families to display code (in order):

font-family: Consolas,"Liberation Mono",Courier,monospace;

So I would just replace Consolas.  From the looks of the 'f' character in the code comments of your screenshot, it does appear to be displaying Consolas.
Try creating the following file "50-ttf-oxygen-mono.conf":

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "../fonts.dtd">
<fontconfig>
     <!-- Microsoft -->
    <alias binding="same">
          <family>Consolas</family>
            <accept>
              <family>Oxygen Mono</family>
            </accept>
        </alias>
        <alias binding="same">
          <family>Oxygen Mono</family>
            <default>
               <family>Consolas</family>
            </default>
        </alias>
</fontconfig>

Note that the "50" prefix represents user overrides.
Place this in /etc/fonts/conf.avail/ and then create a symbolic link in /etc/fonts/conf.d/.
If you're using a laptop you may also want to link the lcdfilter-default conf as well, if you haven't done so. Consolas, and all other Microsoft fonts, should display nicely.

Offline

#3 2013-01-07 09:58:51

Brok9n
Member
Registered: 2013-01-06
Posts: 10

Re: [SOLVED] Github Fonts

Got it now smile I just used my original config but replaced Courier with Consolas and it changed within seconds, now to find a font I like smile

~/.config/fontsconfig/fonts.conf

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

<match target="pattern">
	<test qual="any" name="family"><string>Consolas</string></test>
	<edit name="family" mode="assign" binding="same"><string>Oxygen Mono</string></edit>
</match>

</fontconfig>

Thanks for the help smile

Last edited by Brok9n (2013-01-07 09:59:16)

Offline

#4 2013-01-07 16:26:20

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: [SOLVED] Github Fonts

Please mark this thread as solved editing the first post and prepending "[SOLVED]" to the title.


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

Board footer

Powered by FluxBB