You are not logged in.

#1 2019-07-23 09:30:43

Markus00000
Member
Registered: 2011-03-27
Posts: 318

[SOLVED] Check if font package can provide ttf-font

How can I make sure a font package containing sans-serif, serif and monospace variants can provide ttf-font?

Any commands that tell me the matching will work?

SOLUTION

Read Todo List: Fix 'ttf-font' default font setup.

Let’s look at an example. The noto-fonts package installs sans-serif, serif and monospace fonts. To be able to provide ttf-font, fontconfig files must be installed that create the following font aliases:

sans-serif -> Noto Sans
serif -> Noto Serif
monospace -> Noto Sans Mono

To achieve this, noto-fonts installs these files and symlinks:

etc/
└── fonts
    ├── conf.avail
    │   ├── 66-noto-mono.conf
    │   ├── 66-noto-sans.conf
    │   └── 66-noto-serif.conf
    └── conf.d
        ├── 66-noto-mono.conf -> ../conf.avail/66-noto-mono.conf
        ├── 66-noto-sans.conf -> ../conf.avail/66-noto-sans.conf
        └── 66-noto-serif.conf -> ../conf.avail/66-noto-serif.conf

For example, 66-noto-sans.conf contains:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Noto Sans</family>
    </prefer>
  </alias>
  <alias>
    <family>Noto Sans</family>
    <default>
      <family>sans-serif</family>
    </default>
  </alias>
</fontconfig>

With the font aliases configured and the other requirements mentioned in the above link met, the package can provide ttf-font.

Last edited by Markus00000 (2019-07-28 07:45:12)

Offline

#2 2019-07-23 12:35:04

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [SOLVED] Check if font package can provide ttf-font

Archlinux has a virtual pacakge, ttf-font .

Every package with True Type Fonts should have provides=ttf-font .
pacman -Qi ( or -Si if pacakge is not installed) and repo webinterface all show provides.

If you want to know which font will be used on a specific machine,  man fc-match .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2019-07-26 08:44:55

Markus00000
Member
Registered: 2011-03-27
Posts: 318

Re: [SOLVED] Check if font package can provide ttf-font

I read that ttf-font is a virtual package that can be provided by other packages if they contain sans-serif, serif and monospace fonts. Is this correct?

If so, then the question becomes how to make sure that the fonts in a package will actually provide the ttf-font fonts. That is, the fonts are found/matched correctly when another package relies on ttf-font to be present.

Offline

#4 2019-07-26 20:51:09

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [SOLVED] Check if font package can provide ttf-font

I read that ttf-font is a virtual package that can be provided by other packages if they contain sans-serif, serif and monospace fonts. Is this correct?

https://www.archlinux.org/todo/fix-ttf- … ont-setup/ has some more details.


I do have a feeling however we have an x-y problem and/or I don't understand your issue .

Please elaborate on what you want to achieve with the package /application you're working on.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2019-07-27 08:15:33

Markus00000
Member
Registered: 2011-03-27
Posts: 318

Re: [SOLVED] Check if font package can provide ttf-font

Thanks for your patience and help so far!

Goal: Determine whether or not a package should provide ttf-font.

From the linked page:

3. have at least three families, one each an alias of:
- sans-serif
- serif
- monospace

as determined by fontconfig.

How to determine this with fontconfig?

I tried running

fc-match -s monospace

, but the output includes many fonts that are not monospace. For example, it shows Libertinus Sans, Libertinus Serif and Libertinus Mono. It seems to me that this is not the command I am looking for.

Offline

#6 2019-07-27 18:00:32

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: [SOLVED] Check if font package can provide ttf-font

Can we stop working in hypotheticals.  What font(s) are you actually working with?  In your first post, your stated that the package in question provides a sans, serif, and monospace variant.  That package then meets the criteria for ttf-font.

fc-match gives information about the fonts currently installed and configured on your system - that's not relevant to what it seems this thread was about.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2019-07-27 18:48:46

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [SOLVED] Check if font package can provide ttf-font

Goal: Determine whether or not a package should provide ttf-font.

Why do you need that info and what do you want to do with it ?


How to determine this with fontconfig?

I tried running

fc-match -s monospace

, but the output includes many fonts that are not monospace. For example, it shows Libertinus Sans, Libertinus Serif and Libertinus Mono. It seems to me that this is not the command I am looking for.

You may be misunderstanding what those terms mean.

Monospace refers to a font where all symbols have the same width aka non-proportional .
The best known example of a monospaced font is the font used by typewriter machines .

Serif and sans-serif are very close to eachother, the difference is best shown visually .
https://en.wikipedia.org/wiki/Serif , look at top right image.
I do think both are a proportional font, but don't know if that's mandatory or not.


fc-match -s monospace shows a list of all installed alternatives for a monospaced font that fontconfig2 is aware of.
If that list includes Libertinus sans, the author/packager of Libertinus sans feels it's suitable to be used when a document or application requests a monospaced font.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#8 2019-07-27 20:37:49

Markus00000
Member
Registered: 2011-03-27
Posts: 318

Re: [SOLVED] Check if font package can provide ttf-font

Trilby wrote:

Can we stop working in hypotheticals.  What font(s) are you actually working with?

Right now: Noto Sans, Noto Serif, Noto Sans Mono and others from the Noto family.

Another time the fonts will be different. That is why I was asking generally.

Trilby wrote:

In your first post, your stated that the package in question provides a sans, serif, and monospace variant. That package then meets the criteria for ttf-font.

The above link goes beyond this requirement.

In particular, the fonts must be aliases of sans-serif, serif and monospace “as determined by fontconfig.” I do not know if the font files I have fulfill this requirement as I do not know how fontconfig determines this. Hence the question.

Trilby wrote:

fc-match gives information about the fonts currently installed and configured on your system - that's not relevant to what it seems this thread was about.

As I have these fonts installed, I wondered if fc-match could tell me whether the fonts are aliases of sans-serif, serif and monospace.

Lone_Wolf wrote:

Why do you need that info and what do you want to do with it ?

To decide whether my PKGBUID should contain `provides=('ttf-font')` or not.

If, for example, the Noto package in question provided ttf-font, users would not need to install another package when they need ttf-font. On the other hand, if the package provided ttf-font but was not working correctly, I would supply users with a broken ttf-font provider, which I would rather not do.

Lone_Wolf wrote:

You may be misunderstanding what those terms mean.

Thanks for the explanation, however, I know the terms.

Offline

#9 2019-07-27 20:54:16

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: [SOLVED] Check if font package can provide ttf-font

Markus00000 wrote:

In particular, the fonts must be aliases of sans-serif, serif and monospace “as determined by fontconfig.” I do not know if the font files I have fulfill this requirement as I do not know how fontconfig determines this. Hence the question.

That's what the remainder of the content at that link is all about.   If the font in question is one of the one's listed, their alias's are convered by fontconfig, otherwise, your package should provide a alias config file.  Look at the existing one's for an example of what's needed.

But still it's not clear what angle you're coming at this from: are you packaging existing fonts, modifying existing fonts, creating your own brand new fonts from scratch, or what?

Markus00000 wrote:

If, for example, the Noto package in question provided ttf-font, users would not need to install another package when they need ttf-font. On the other hand, if the package provided ttf-font but was not working correctly, I would supply users with a broken ttf-font provider, which I would rather not do.

Where's the PKGBUILD and associated files for this?  Is it already up in the AUR?  Which packages?  Does the package provide alias config file(s)?  How is this package different from the noto-fonts package(s) in the repos?

Last edited by Trilby (2019-07-27 20:54:41)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#10 2019-07-27 21:27:16

Markus00000
Member
Registered: 2011-03-27
Posts: 318

Re: [SOLVED] Check if font package can provide ttf-font

Trilby wrote:

If the font in question is one of the one's listed, their alias's are convered by fontconfig

Okay, Noto is not listed.

Trilby wrote:

otherwise, your package should provide a alias config file.  Look at the existing one's for an example of what's needed.

I think I’m starting to understand. So, “as determined by fontconfig” means “if a fontconfig file contains an <alias> section for the sans-serif, serif and monospace families,” which, for example, noto-fonts does.

Trilby wrote:

are you packaging existing fonts, modifying existing fonts, creating your own brand new fonts from scratch, or what?

Packaging existing fonts.

Trilby wrote:

Where's the PKGBUILD and associated files for this?  Is it already up in the AUR?  Which packages?  Does the package provide alias config file(s)?  How is this package different from the noto-fonts package(s) in the repos?

It’s noto-fonts-main in the AUR. It doesn’t contain alias config files. It contains a different selection of fonts.

If I understand correctly, I can add fontconfig files to configure the aliases and then make the package provide ttf-font.

If so, you solved this issue – even in the hypothetical general case. Thank you very much!

Offline

#11 2019-07-27 21:49:35

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: [SOLVED] Check if font package can provide ttf-font

Markus00000 wrote:

If I understand correctly, I can add fontconfig files to configure the aliases and then make the package provide ttf-font.

I believe so, yes.  Though with a big caveate that fontconfig has always seemed like some weird dark magic to me.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#12 2019-10-10 05:12:11

polarathene
Member
Registered: 2019-10-10
Posts: 2

Re: [SOLVED] Check if font package can provide ttf-font

Lone_Wolf wrote:

You may be misunderstanding what those terms mean.

Monospace refers to a font where all symbols have the same width aka non-proportional .

fc-match -s monospace shows a list of all installed alternatives for a monospaced font that fontconfig2 is aware of.
If that list includes Libertinus sans, the author/packager of Libertinus sans feels it's suitable to be used when a document or application requests a monospaced font.

Hey, just wanted to chime in about a misunderstanding here. fc-match monospace is going to return results for fonts that based on fontconfig conf files assign themselves to the generic monospace font family.

On my system, running `FC_DEBUG=4 fc-match monospace | grep -A2 "done"` shows this font list:

family: "Bitstream Vera Sans Mono"(w) "Inconsolata"(w) "Andale Mono"(w) "Courier New"(w) "Cumberland AMT"(w) "Luxi Mono"(w) "Nimbus Mono L"(w) "Nimbus Mono PS"(w) "Nimbus Mono"(w) "Nimbus Mono PS"(w) "Nimbus Mono PS"(w) "Courier"(w) "Nimbus Mono PS"(w) "Nimbus Mono"(w) "Nimbus Mono L"(w) "Miriam Mono"(w) "VL Gothic"(w) "IPAMonaGothic"(w) "IPAGothic"(w) "Sazanami Gothic"(w) "Kochi Gothic"(w) "AR PL KaitiM GB"(w) "MS Gothic"(w) "UmePlus Gothic"(w) "NSimSun"(w) "MingLiu"(w) "AR PL ShanHeiSun Uni"(w) "AR PL New Sung Mono"(w) "HanyiSong"(w) "AR PL SungtiL GB"(w) "AR PL Mingti2L Big5"(w) "ZYSong18030"(w) "NanumGothicCoding"(w) "NanumGothic"(w) "UnDotum"(w) "Baekmuk Dotum"(w) "Baekmuk Gulim"(w) "TlwgTypo"(w) "TlwgTypist"(w) "TlwgTypewriter"(w) "TlwgMono"(w) "Hasida"(w) "Mitra Mono"(w) "GF Zemen Unicode"(w) "Hapax Berbère"(w) "Lohit Bengali"(w) "Lohit Gujarati"(w) "Lohit Hindi"(w) "Lohit Marathi"(w) "Lohit Maithili"(w) "Lohit Kashmiri"(w) "Lohit Konkani"(w) "Lohit Nepali"(w) "Lohit Sindhi"(w) "Lohit Punjabi"(w) "Lohit Tamil"(w) "Meera"(w) "Lohit Malayalam"(w) "Lohit Kannada"(w) "Lohit Telugu"(w) "Lohit Oriya"(w) "LKLUG"(w) "Noto Sans Mono"(w) "FreeMono"(w) "Nimbus Mono PS"(w) "Droid Sans Mono"(w) "monospace"(s) "Terafik"(w) "monospace"(w) "Courier"(w) "Courier"(w) "monospace"(w) "Courier"(w) "monospace"(w)

That's before the next step which seems to go through the rules again to identify the best font to match to, with the --sort param, it appears to be rather excessive at this step(for each font result I guess) and does provide a list of fonts it seems to think match better based on some sort of score/logic:

fc-match -s monospace

VeraMono.ttf: "Bitstream Vera Sans Mono" "Roman"
Inconsolata-Regular.ttf: "Inconsolata" "Regular"
NimbusMonoPS-Regular.otf: "Nimbus Mono PS" "Regular"
NotoSansMono-Regular.ttf: "Noto Sans Mono" "Regular"
FiraSans-Regular.otf: "Fira Sans" "Regular"
FiraMono-Regular.otf: "Fira Mono" "Regular"
Hack-Regular.ttf: "Hack" "Regular"
DejaVuMathTeXGyre.ttf: "DejaVu Math TeX Gyre" "Regular"
DejaVuSans.ttf: "DejaVu Sans" "Book"
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
DejaVuSerif.ttf: "DejaVu Serif" "Book"
NotoSansArmenian-Regular.ttf: "Noto Sans Armenian" "Regular"
SourceCodePro-Regular.otf: "Source Code Pro" "Regular"
NotoSans-Regular.ttf: "Noto Sans" "Regular"
NotoSansChakma-Regular.ttf: "Noto Sans Chakma" "Regular"
NotoSansKhmer-Regular.ttf: "Noto Sans Khmer" "Regular"
NotoSansMyanmar-Regular.ttf: "Noto Sans Myanmar" "Regular"
NotoSerifAhom-Regular.ttf: "Noto Serif Ahom" "Regular"
NotoSerifKannada-Regular.ttf: "Noto Serif Kannada" "Regular"
NotoSerifSinhala-Regular.ttf: "Noto Serif Sinhala" "Regular"
NotoSansCJK-Regular.ttc: "Noto Sans CJK JP" "Regular"
D050000L.otf: "D050000L" "Regular"
LiberationMono-Regular.ttf: "Liberation Mono" "Regular"
LiberationSerif-Regular.ttf: "Liberation Serif" "Regular"
NotoMusic-Regular.ttf: "Noto Music" "Regular"
NotoNastaliqUrdu-Bold.ttf: "Noto Nastaliq Urdu" "Bold"
NotoSansAdlam-Regular.ttf: "Noto Sans Adlam" "Regular"
NotoSansAnatolianHieroglyphs-Regular.ttf: "Noto Sans Anatolian Hieroglyphs" "Regular"
NotoSansArabic-Regular.ttf: "Noto Sans Arabic" "Regular"
NotoSansAvestan-Regular.ttf: "Noto Sans Avestan" "Regular"
NotoSansBamum-Regular.ttf: "Noto Sans Bamum" "Regular"
NotoSansBassaVah-Regular.ttf: "Noto Sans Bassa Vah" "Regular"
NotoSansBatak-Regular.ttf: "Noto Sans Batak" "Regular"
NotoSansBengali-Regular.ttf: "Noto Sans Bengali" "Regular"
NotoSansBhaiksuki-Regular.ttf: "Noto Sans Bhaiksuki" "Regular"
NotoSansBrahmi-Regular.ttf: "Noto Sans Brahmi" "Regular"
NotoSansBuginese-Regular.ttf: "Noto Sans Buginese" "Regular"
NotoSansBuhid-Regular.ttf: "Noto Sans Buhid" "Regular"
NotoSansCanadianAboriginal-Regular.ttf: "Noto Sans Canadian Aboriginal" "Regular"
NotoSansCarian-Regular.ttf: "Noto Sans Carian" "Regular"
NotoSansCaucasianAlbanian-Regular.ttf: "Noto Sans Caucasian Albanian" "Regular"
NotoSansCham-Regular.ttf: "Noto Sans Cham" "Regular"
NotoSansCherokee-Regular.ttf: "Noto Sans Cherokee" "Regular"
NotoSansCoptic-Regular.ttf: "Noto Sans Coptic" "Regular"
NotoSansCuneiform-Regular.ttf: "Noto Sans Cuneiform" "Regular"
NotoSansCypriot-Regular.ttf: "Noto Sans Cypriot" "Regular"
NotoSansDeseret-Regular.ttf: "Noto Sans Deseret" "Regular"
NotoSansDevanagari-Regular.ttf: "Noto Sans Devanagari" "Regular"
NotoSansDuployan-Regular.ttf: "Noto Sans Duployan" "Regular"
NotoSansEgyptianHieroglyphs-Regular.ttf: "Noto Sans Egyptian Hieroglyphs" "Regular"
NotoSansElbasan-Regular.ttf: "Noto Sans Elbasan" "Regular"
NotoSansEthiopic-Regular.ttf: "Noto Sans Ethiopic" "Regular"
NotoSansGeorgian-Regular.ttf: "Noto Sans Georgian" "Regular"
NotoSansGlagolitic-Regular.ttf: "Noto Sans Glagolitic" "Regular"
NotoSansGothic-Regular.ttf: "Noto Sans Gothic" "Regular"
NotoSansGrantha-Regular.ttf: "Noto Sans Grantha" "Regular"
NotoSansHanunoo-Regular.ttf: "Noto Sans Hanunoo" "Regular"
NotoSansHatran-Regular.ttf: "Noto Sans Hatran" "Regular"
NotoSansImperialAramaic-Regular.ttf: "Noto Sans Imperial Aramaic" "Regular"
NotoSansInscriptionalPahlavi-Regular.ttf: "Noto Sans Inscriptional Pahlavi" "Regular"
NotoSansInscriptionalParthian-Regular.ttf: "Noto Sans Inscriptional Parthian" "Regular"
NotoSansJavanese-Regular.ttf: "Noto Sans Javanese" "Regular"
NotoSansKaithi-Regular.ttf: "Noto Sans Kaithi" "Regular"
NotoSansKayahLi-Regular.ttf: "Noto Sans Kayah Li" "Regular"
NotoSansKharoshthi-Regular.ttf: "Noto Sans Kharoshthi" "Regular"
NotoSansKhojki-Regular.ttf: "Noto Sans Khojki" "Regular"
NotoSansKhudawadi-Regular.ttf: "Noto Sans Khudawadi" "Regular"
NotoSansLao-Regular.ttf: "Noto Sans Lao" "Regular"
NotoSansLepcha-Regular.ttf: "Noto Sans Lepcha" "Regular"
NotoSansLimbu-Regular.ttf: "Noto Sans Limbu" "Regular"
NotoSansLinearA-Regular.ttf: "Noto Sans Linear A" "Regular"
NotoSansLinearB-Regular.ttf: "Noto Sans Linear B" "Regular"
NotoSansLycian-Regular.ttf: "Noto Sans Lycian" "Regular"
NotoSansLydian-Regular.ttf: "Noto Sans Lydian" "Regular"
NotoSansMahajani-Regular.ttf: "Noto Sans Mahajani" "Regular"
NotoSansMalayalam-Regular.ttf: "Noto Sans Malayalam" "Regular"
NotoSansMandaic-Regular.ttf: "Noto Sans Mandaic" "Regular"
NotoSansManichaean-Regular.ttf: "Noto Sans Manichaean" "Regular"
NotoSansMarchen-Regular.ttf: "Noto Sans Marchen" "Regular"
NotoSansMath-Regular.ttf: "Noto Sans Math" "Regular"
NotoSansMeeteiMayek-Regular.ttf: "Noto Sans Meetei Mayek" "Regular"
NotoSansMendeKikakui-Regular.ttf: "Noto Sans Mende Kikakui" "Regular"
NotoSansMeroitic-Regular.ttf: "Noto Sans Meroitic" "Regular"
NotoSansMiao-Regular.ttf: "Noto Sans Miao" "Regular"
NotoSansModi-Regular.ttf: "Noto Sans Modi" "Regular"
NotoSansMro-Regular.ttf: "Noto Sans Mro" "Regular"
NotoSansMultani-Regular.ttf: "Noto Sans Multani" "Regular"
NotoSansNKo-Regular.ttf: "Noto Sans NKo" "Regular"
NotoSansNabataean-Regular.ttf: "Noto Sans Nabataean" "Regular"
NotoSansNewTaiLue-Regular.ttf: "Noto Sans New Tai Lue" "Regular"
NotoSansNewa-Regular.ttf: "Noto Sans Newa" "Regular"
NotoSansOlChiki-Regular.ttf: "Noto Sans Ol Chiki" "Regular"
NotoSansOldHungarian-Regular.ttf: "Noto Sans Old Hungarian" "Regular"
NotoSansOldItalic-Regular.ttf: "Noto Sans Old Italic" "Regular"
NotoSansOldNorthArabian-Regular.ttf: "Noto Sans Old North Arabian" "Regular"
NotoSansOldPermic-Regular.ttf: "Noto Sans Old Permic" "Regular"
NotoSansOldPersian-Regular.ttf: "Noto Sans Old Persian" "Regular"
NotoSansOldSouthArabian-Regular.ttf: "Noto Sans Old South Arabian" "Regular"
NotoSansOldTurkic-Regular.ttf: "Noto Sans Old Turkic" "Regular"
NotoSansOsage-Regular.ttf: "Noto Sans Osage" "Regular"
NotoSansOsmanya-Regular.ttf: "Noto Sans Osmanya" "Regular"
NotoSansPahawhHmong-Regular.ttf: "Noto Sans Pahawh Hmong" "Regular"
NotoSansPalmyrene-Regular.ttf: "Noto Sans Palmyrene" "Regular"
NotoSansPauCinHau-Regular.ttf: "Noto Sans Pau Cin Hau" "Regular"
NotoSansPhagsPa-Regular.ttf: "Noto Sans PhagsPa" "Regular"
NotoSansPhoenician-Regular.ttf: "Noto Sans Phoenician" "Regular"
NotoSansPsalterPahlavi-Regular.ttf: "Noto Sans Psalter Pahlavi" "Regular"
NotoSansRejang-Regular.ttf: "Noto Sans Rejang" "Regular"
NotoSansRunic-Regular.ttf: "Noto Sans Runic" "Regular"
NotoSansSamaritan-Regular.ttf: "Noto Sans Samaritan" "Regular"
NotoSansSaurashtra-Regular.ttf: "Noto Sans Saurashtra" "Regular"
NotoSansSharada-Regular.ttf: "Noto Sans Sharada" "Regular"
NotoSansShavian-Regular.ttf: "Noto Sans Shavian" "Regular"
NotoSansSoraSompeng-Regular.ttf: "Noto Sans Sora Sompeng" "Regular"
NotoSansSundanese-Regular.ttf: "Noto Sans Sundanese" "Regular"
NotoSansSylotiNagri-Regular.ttf: "Noto Sans Syloti Nagri" "Regular"
NotoSansSymbols-Regular.ttf: "Noto Sans Symbols" "Regular"
NotoSansSyriac-Regular.ttf: "Noto Sans Syriac" "Regular"
NotoSansTagalog-Regular.ttf: "Noto Sans Tagalog" "Regular"
NotoSansTagbanwa-Regular.ttf: "Noto Sans Tagbanwa" "Regular"
NotoSansTaiLe-Regular.ttf: "Noto Sans Tai Le" "Regular"
NotoSansTaiViet-Regular.ttf: "Noto Sans Tai Viet" "Regular"
NotoSansTakri-Regular.ttf: "Noto Sans Takri" "Regular"
NotoSansTamil-Regular.ttf: "Noto Sans Tamil" "Regular"
NotoSansThaana-Regular.ttf: "Noto Sans Thaana" "Regular"
NotoSansThai-Regular.ttf: "Noto Sans Thai" "Regular"
NotoSansTifinagh-Regular.ttf: "Noto Sans Tifinagh" "Regular"
NotoSansTirhuta-Regular.ttf: "Noto Sans Tirhuta" "Regular"
NotoSansUgaritic-Regular.ttf: "Noto Sans Ugaritic" "Regular"
NotoSansVai-Regular.ttf: "Noto Sans Vai" "Regular"
NotoSansWarangCiti-Regular.ttf: "Noto Sans Warang Citi" "Regular"
NotoSansYi-Regular.ttf: "Noto Sans Yi" "Regular"
NotoSerifBalinese-Regular.ttf: "Noto Serif Balinese" "Regular"
NotoSerifGujarati-Regular.ttf: "Noto Serif Gujarati" "Regular"
NotoSerifGurmukhi-Regular.ttf: "Noto Serif Gurmukhi" "Regular"
NotoSerifTibetan-Regular.ttf: "Noto Serif Tibetan" "Regular"
Pothana2000.ttf: "Pothana2000" "Regular"
NotoSansTelugu-Regular.ttf: "Noto Sans Telugu" "Regular"
NotoSansMongolian-Regular.ttf: "Noto Sans Mongolian" "Regular"
NotoSansTaiTham-Regular.ttf: "Noto Sans Tai Tham" "Regular"
NotoSansOriya-Regular.ttf: "Noto Sans Oriya" "Regular"
TAMu_Kalyani.ttf: "TAMu_Kalyani" "Regular"
TSCu_Comic.ttf: "TSCu_Comic" "Normal"
DroidSansArabic.ttf: "Droid Sans" "Regular"
malayalam.ttf: "malayalam" "Regular"
NotoSansSymbols2-Regular.ttf: "Noto Sans Symbols2" "Regular"
padmaa-Medium-0.5.ttf: "padmaa" "regular"
oriya.ttf: "orya" "Medium"
GurbaniBoliLite.ttf: "GurbaniBoliLite" "Medium"
DejaVuSansMono-Bold.ttf: "DejaVu Sans Mono" "Bold"
TSCu_paranarb.ttf: "TSCu_Paranar" "Bold"
DejaVuSerif-Italic.ttf: "DejaVu Serif" "Italic"
LiberationSerif-Italic.ttf: "Liberation Serif" "Italic"
TSCu_paranari.ttf: "TSCu_Paranar" "Italic"
Gargi-1.2b.ttf: "Gargi-1.2b" "1.2b"
DejaVuSans-Oblique.ttf: "DejaVu Sans" "Oblique"
DejaVuSans-BoldOblique.ttf: "DejaVu Sans" "Bold Oblique"
ter-x12n.pcf.gz: "xos4 Terminus" "Regular"
twemoji.ttf: "Twemoji" "Regular"

From the looks of it, the order might actually be based off of what is described here: https://linux.die.net/man/3/fcfontsort

Returns the list of fonts sorted by closeness to p. If trim is FcTrue, elements in the list which don't include Unicode coverage not provided by earlier elements in the list are elided

Presumably with twemoji at the end there, as well as more alternatives straying from "Regular" style/weight, it is doing something like that. Returning a list of fonts to fallback to, rather than a list of fonts that match a specific pattern(like the earlier monospace one). Looking at the list of fonts, the first monospace ones are respecting the order of the earlier list, presumably the fonts inbetween those do not match or offer additional coverage, thus being redundant for fallback use.

So it should be clear that these are not a list of what is considered a monospace font, the earlier list I provided is. The 2nd list is a font stack for what would be used to render specific glyphs(when the applied font family is the generic "monospace" family).

If you want to see an actual list of fonts that fontconfig deems as actually being suitable for monospace usage, run `FC_DEBUG=4 fc-match monospace:spacing=100 | grep -A2 "done"`, monospace is specified as due to `/etc/fonts/conf.d/49-sansserif.conf`, a lack of a generic family will default to sans-serif and end up returning the wrong fonts anyway. Fontconfig configs can adjust the spacing property, which will affect these fc-match results, but not for any font selection lists like with terminal apps listing monospace width fonts only. Those fonts can be listed with `fc-list :spacing=100` or `fc-list :spacing=100 family` if you'd rather see font family names instead of filepaths for each variant on a newline. You'll get results like this:

Droid Sans Mono
Fira Code
Source Code Pro,Source Code Pro Light
DejaVu Sans Mono
Twemoji
Fira Code,Fira Code Retina
Bitstream Vera Sans Mono
Source Code Pro,Source Code Pro ExtraLight
Nimbus Mono PS
Fira Mono
Source Code Pro,Source Code Pro Medium
Fira Code,Fira Code Medium
Source Code Pro
Fira Mono,Fira Mono Medium
Hack
Source Code Variable
Fira Code,Fira Code Light
Noto Color Emoji
Source Code Pro,Source Code Pro Black
Noto Mono
Inconsolata
Source Code Pro,Source Code Pro Semibold

For a font to be listed here, fontconfig must decide that the font should be assigned a spacing value of 100(equivalent to monospace), this is only given if all glyphs defined in the font have the same advance width.

"Noto Sans Mono" in my case is defined for the monospace family in it's related fontconfig, but is known to have mixed advance widths(0, 600, 1200, 1800) for it's glyphs, so it won't show up in font lists that try to filter via fc-list and spacing property, regardless if it's generally a font that would work fine in a terminal with fixed width characters(a single glyph no matter how rare or unlikely to be entered will prevent assignment of spacing=100).

"Fira Mono" does have a spacing of 100(but "Fira Sans" does not). `fc-match -s :spacing=100` will place both of these as fallbacks above "Noto Sans Mono", "Fira Mono" probably because of having `spacing=100` and "Fira Sans" before that which is unclear why. "Fira Sans" even appears above "Fira Mono" (as can be seen above in fc-match results) when the query specifies the generic monospace family, likely because without a fontconfig config file to assign it, neither are considered it, note that "Noto Sans Mono" takes priority due to having one more property matching the query(without monospace in the query, it is listed below "Fira Mono"). It does appear to progressively work through the fonts in alphabetical order for the most part? Also giving an alias a binding of "strong" or "same" seems to be able to affect if the preferred fonts are omitted or not.

I don't fully understand how that sorted list of fallbacks is working, but main point is, fontconfig is not claiming those results are monospace fonts on the system smile


Markus00000 wrote:

In particular, the fonts must be aliases of sans-serif, serif and monospace “as determined by fontconfig.” I do not know if the font files I have fulfill this requirement as I do not know how fontconfig determines this. Hence the question.
As I have these fonts installed, I wondered if fc-match could tell me whether the fonts are aliases of sans-serif, serif and monospace.

Use alias->prefer configs like official noto-fonts package provides as shared/mentioned in your original post. You can run the following command which should confirm your font is part of the generic family:

FC_DEBUG=4 fc-match monospace | grep -A2 "done"

You could additionally add( | grep "Noto Sans Mono") for example to further filter/highlight the results to confirm the specific font is there. If you want to ensure it is the first font for the generic font family, that is a bit more tricky, since any other part of the fontconfig could also be trying to achieve the same thing via approaches like match->edit with `mode="prepend_first"`.  AFAIK, a user config is probably the better way to go about it with alias->prefer(and possible a strong binding on the alias), otherwise you're already competing against 60-latin.conf and 60-generic.conf + any other package that tries similar.

Offline

#13 2019-10-10 13:17:57

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,784
Website

Re: [SOLVED] Check if font package can provide ttf-font

Thanks for sharing, however please don't use quote tags for terminal output -- use code tags instead: https://wiki.archlinux.org/index.php/Co … s_and_code

Mod note: closing this old topic now.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB