You are not logged in.

#1 2018-11-04 13:53:32

S7.L
Member
Registered: 2018-09-16
Posts: 338

[Solved] Fontconfig question

Could someone point me in the right direction on how best to modify the fontconfig file.

Mine is as per below, but i would like to utilize only the google raleway font, would this be viable and how would i modify this file to suit?

$HOME/.config/fontconfig/fonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <match target="font">
        <edit mode="assign" name="hinting" >
            <bool>true</bool>
        </edit>
        <edit mode="assign" name="autohint" >
            <bool>true</bool>
        </edit>
        <edit mode="assign" name="hintstyle" >
            <const>hintslight</const>
        </edit>
        <edit mode="assign" name="rgba" >
            <const>rgb</const>
        </edit>
        <edit mode="assign" name="antialias" >
            <bool>true</bool>
        </edit>
        <edit mode="assign" name="lcdfilter">
            <const>lcddefault</const>
        </edit>
    </match>

<!--
    This section allows the user to define the fonts used for the
    "serif", "sans-serif" and "monospace" aliases.

    These aliases can then be set in lxappearance (the theme-changing
    GUI used by BunsenLabs) and also in individual programs to allow
    this file to be used for desktop-wide font configuration.

    By default, BunsenLabs uses one of these aliases everywhere
    a font needs to be specified. Set your favourite fonts here
    to ensure consistency across your working environment.
    You can still change fonts on a per-application basis if you want.
-->

    <alias>
        <family>serif</family>
        <prefer>
            <family>Noto Serif</family>
        </prefer>
    </alias>
    <alias>
        <family>sans-serif</family>
        <prefer>
            <family>Noto Sans</family>
        </prefer>
    </alias>
    <alias>
        <family>monospace</family>
        <prefer>
            <family>Noto Mono</family>
        </prefer>
    </alias>

</fontconfig>

Last edited by S7.L (2018-11-05 11:00:58)

Offline

#2 2018-11-04 14:05:19

S7.L
Member
Registered: 2018-09-16
Posts: 338

Re: [Solved] Fontconfig question

disregard

Last edited by S7.L (2018-11-04 14:08:28)

Offline

#3 2018-11-04 19:09:13

ohnonot
...again
Registered: 2015-09-29
Posts: 3,674
Website

Re: [Solved] Fontconfig question

^ disregard what?
problem solved?

anyhow, a while ago, when infinality died, i decided to get under the hood of fontconfig and see what can be done.
this page, and other documents linked therein, helped me a lot.

so, this is my ~/.config/fontconfig/fonts.conf, but I made many more changes in /etc/fonts.
Proper font substitutions and/or install microsoft fonts (they look quite good).

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

<!-- CAREFUL!
USER CONFIGURATION PRIORITY RAISED FROM 50- TO 21- 
IN /etc/fonts/conf.d -->

<!-- Generic name aliasing -->
<alias>
	<family>sans</family>
	<prefer>
		<family>Segoe UI</family>
	</prefer>
</alias>
<alias>
	<family>sans-serif</family>
	<prefer>
		<family>Segoe UI</family>
	</prefer>
</alias>
<alias>
	<family>serif</family>
	<prefer>
		<family>Georgia</family>
	</prefer>
</alias>
<alias binding="same">
	<family>monospace</family>
	<accept>
		<family>xos4 Terminus</family>
		<family>Terminus</family>
		<family>Monaco</family>
		<family>Andale Mono</family>
	</accept>
</alias>

<!-- Bitstream Charter is a non true type font, and will look bad. This
replaces it with whatever is the default sans-serif font -->
<match target="pattern">
	<test name="family" qual="any">
		<string>Bitstream Charter</string>
	</test>
	<edit mode="assign" name="family" binding="same">
		<string>sans-serif</string>
	</edit>
</match>

<!-- Helvetica is a non true type font, and will look bad. This
replaces it with whatever is the default sans-serif font -->
<match target="pattern">
	<test name="family" qual="any">
		<string>Helvetica</string>
	</test>
	<edit mode="assign" name="family">
		<string>sans-serif</string>
	</edit>
</match>

<match target="font">
 <edit mode="assign" name="rgba">
  <const>rgb</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>hintslight</const>
 </edit>
</match>
<match target="font">
 <edit mode="assign" name="antialias">
  <bool>true</bool>
 </edit>
</match>
<match target="font">
 <edit mode="assign" name="lcdfilter">
   <const>lcddefault</const>
 </edit>
</match>

<match target="font">
 <edit mode="assign" name="autohint">
  <bool>false</bool>
 </edit>
</match>

<!--
Interesting! This one overrides EVERYTHING
<match target="pattern">
    <edit name="family" mode="prepend" binding="strong">
        <string>Comic Sans MS</string>
    </edit>
</match>
-->

</fontconfig>

Last edited by ohnonot (2018-11-04 19:11:58)

Offline

#4 2018-11-05 05:12:41

S7.L
Member
Registered: 2018-09-16
Posts: 338

Re: [Solved] Fontconfig question

I thought i figured it out but nothing changed.

Thanks for the link, help and config i will look into it later tonight.

Cheers

Offline

#5 2018-11-05 10:55:28

S7.L
Member
Registered: 2018-09-16
Posts: 338

Re: [Solved] Fontconfig question

Ok i dont quite understand what to do with the infinality side of things in that link just yet but your config helped a lot especially the last area as per below code block, I also downloaded the ttf core ms fonts and the rest of the fonts you have in that list and they are quite nice too. Thanks for your help ohnonot.

The raleway font is nice and probably could render a little darker on my laptop but all in all i am happy with it.

Interesting! This one overrides EVERYTHING
<match target="pattern">
    <edit name="family" mode="prepend" binding="strong">
        <string>Raleway</string>
    </edit>
</match>

edit: Ok so that code indeed does change everything, i see why it was commented out. Further playing around is in order. Raleway does not look good in the terminal!

Last edited by S7.L (2018-11-05 11:15:41)

Offline

#6 2018-11-06 02:51:50

hhh
That's it!
Registered: 2015-09-17
Posts: 7,470
Website

Re: [Solved] Fontconfig question

S7.L wrote:

Raleway does not look good in the terminal!

Just set a monospace font in your terminal's config.

Offline

#7 2018-11-06 04:04:56

ohnonot
...again
Registered: 2015-09-29
Posts: 3,674
Website

Re: [Solved] Fontconfig question

S7.L wrote:

i dont quite understand what to do with the infinality side of things in that link

probably nothing.
the article was written for people who used to use infinality on archlinux and bemoaned its loss.
but even if you never used infinality (or archlinux) it has a lot of good information.

Offline

#8 2018-11-06 11:43:32

S7.L
Member
Registered: 2018-09-16
Posts: 338

Re: [Solved] Fontconfig question

@hhh, i couldn't even change the font to any monospace fonts from the terminals config, that being terminator. That fontconfig setting overrides everything.

@ ohnonot, i vaguely remember using infinality fonts on an arch respin by a fellow named midfingr who had a youtube channel on lots of linux stuff to do with arch, unfortunately he passed away. I remember the fonts did look really nice and he had an instructions on how to set them up once you had the system installed from a text file. Ill have to re-download that spin and see if they are still there.

Offline

#9 2018-11-07 18:01:30

ohnonot
...again
Registered: 2015-09-29
Posts: 3,674
Website

Re: [Solved] Fontconfig question

i just remembered that there's some threads about fonts on debian over at fdn: http://forums.debian.net/
check it out.

Offline

#10 2018-11-08 13:12:40

S7.L
Member
Registered: 2018-09-16
Posts: 338

Re: [Solved] Fontconfig question

^ I am not a member there but i did come across a recent thread to do with sub pixel rendering that was interesting to note.

http://forums.debian.net/viewtopic.php?f=6&t=138984

Offline

Board footer

Powered by FluxBB