You are not logged in.

#1 2021-05-27 08:22:02

SPYAM
Member
From: IRAN
Registered: 2020-11-12
Posts: 156

[Solved] Tips for changing sans and sans-serif fonts

Hello
My friends, I want to change the following fonts to Ubuntu font. Can you help me?

[spy @ archlinux fonts] $ fc-match "Sans"
NimbusSans-Regular.otf: "Nimbus Sans" "Regular"
[spy @ archlinux fonts] $ fc-match "Serif"
NimbusRoman-Regular.otf: "Nimbus Roman" "Regular"
[spy @ archlinux fonts] $ fc-match "Sans Serif"
NimbusSans-Regular.otf: "Nimbus Sans" "Regular"

Last edited by SPYAM (2021-05-27 11:00:14)


Only progress!

Offline

#2 2021-05-27 08:57:48

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,337

Re: [Solved] Tips for changing sans and sans-serif fonts

Offline

#3 2021-05-27 09:26:11

SPYAM
Member
From: IRAN
Registered: 2020-11-12
Posts: 156

Re: [Solved] Tips for changing sans and sans-serif fonts

My Linux Arch does not have the bottom.
And what can I do if it is only in /etc/fonts/fonts.conf? Where can I add this configuration mentioned in the link?

[spy@archlinux fonts]$ cat $XDG_CONFIG_HOME/fontconfig/fonts.conf
cat: /fontconfig/fonts.conf: No such file or directory
[spy@archlinux fonts]$ cat /etc/fonts/fonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<!-- /etc/fonts/fonts.conf file to configure system font access -->
<fontconfig>
    <description>Default configuration file</description>

<!--
    DO NOT EDIT THIS FILE.
    IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
    LOCAL CHANGES BELONG IN 'local.conf'.

    The intent of this standard configuration file is to be adequate for
    most environments.  If you have a reasonably normal environment and
    have found problems with this configuration, they are probably
    things that others will also want fixed.  Please submit any
    problems to the fontconfig bugzilla system located at fontconfig.org

    Note that the normal 'make install' procedure for fontconfig is to
    replace any existing fonts.conf file with the new version.  Place
    any local customizations in local.conf which this file references.

    Keith Packard
-->

<!-- Font directory list -->

    <dir>/usr/share/fonts</dir>
    <dir>/usr/local/share/fonts</dir>

   
    <dir prefix="xdg">fonts</dir>
    <!-- the following element will be removed in the future -->
    <dir>~/.fonts</dir>

<!--
  Accept deprecated 'mono' alias, replacing it with 'monospace'
-->
    <match target="pattern">
        <test qual="any" name="family">
            <string>mono</string>
        </test>
        <edit name="family" mode="assign" binding="same">
            <string>monospace</string>
        </edit>
    </match>

<!--
  Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'
-->
    <match target="pattern">
        <test qual="any" name="family">
            <string>sans serif</string>
        </test>
        <edit name="family" mode="assign" binding="same">
            <string>sans-serif</string>
        </edit>
    </match>

<!--
  Accept deprecated 'sans' alias, replacing it with 'sans-serif'
-->
    <match target="pattern">
        <test qual="any" name="family">
            <string>sans</string>
        </test>
        <edit name="family" mode="assign" binding="same">
            <string>sans-serif</string>
        </edit>
    </match>
<!--
  Accept alternate 'system ui' spelling, replacing it with 'system-ui'
-->
    <match target="pattern">
        <test qual="any" name="family">
            <string>system ui</string>
        </test>
        <edit name="family" mode="assign" binding="same">
            <string>system-ui</string>
        </edit>
    </match>

<!--
  Load local system customization file
-->
    <include ignore_missing="yes">conf.d</include>

<!-- Font cache directory list -->

    <cachedir>/var/cache/fontconfig</cachedir>
    <cachedir prefix="xdg">fontconfig</cachedir>
    <!-- the following element will be removed in the future -->
    <cachedir>~/.fontconfig</cachedir>

    <config>
<!--
  Rescan configuration every 30 seconds when FcFontSetList is called
-->
        <rescan>
            <int>30</int>
        </rescan>
    </config>

</fontconfig>
[spy@archlinux fonts]$


Only progress!

Offline

#4 2021-05-27 10:46:48

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,527

Re: [Solved] Tips for changing sans and sans-serif fonts

Please edit yout post and use "code" tags, not "quote" tags.
$XDG_CONFIG_HOME defaults to ~/.config, so add ~/.config/fontconfig/fonts.conf

Offline

#5 2021-05-27 11:01:33

SPYAM
Member
From: IRAN
Registered: 2020-11-12
Posts: 156

Re: [Solved] Tips for changing sans and sans-serif fonts

seth wrote:

Please edit yout post and use "code" tags, not "quote" tags.
$XDG_CONFIG_HOME defaults to ~/.config, so add ~/.config/fontconfig/fonts.conf

Thank you , Solved.

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <match target="pattern">
  <test name="family" qual="any">
   <string>sans-serif</string>
  </test>
  <edit mode="assign" binding="same" name="family">
   <string>vazir</string>
  </edit>
 </match>
 <match target="pattern">
  <test name="family" qual="any">
   <string>sans</string>
  </test>
  <edit mode="assign" binding="same" name="family">
   <string>vazir</string>
  </edit>
 </match>
 <match target="pattern">
  <test name="family" qual="any">
   <string>serif</string>
  </test>
  <edit mode="assign" binding="same" name="family">
   <string>vazir</string>
  </edit>
 </match>
 <dir>~/.fonts</dir>
</fontconfig>

Only progress!

Offline

Board footer

Powered by FluxBB