Opened 6 months ago

Closed 5 months ago

#18716 closed defect (fixed)

tuning-fontconfig is out of date since fontconfig-2.14.

Reported by: ken@… Owned by: ken@…
Priority: normal Milestone: 12.1
Component: BOOK Version: git
Severity: normal Keywords:
Cc:

Description

I was reading a list today where somebody said that fontconfig now prefers Noto fonts.

That turns out to be true: in the README under 2.13.95 (2.14-RC5) it says:

conf.d/60-latin.conf: Make Noto default.

In fact, Noto fonts appear in various conf.d/ files. This change came from Fedora, after dissatisfaction with DejaVu in some writing systems. They apparently made the change in FC36. For their language packs this apparently saves some space. Their rationale is at https://fedoraproject.org/wiki/Changes/DefaultToNotoFonts

A page listing what they planned to use for various languages is at https://tagoh.fedorapeople.org/fonts/noto/f36-noto.html

Looking at this, I found a page explaining, among other things, how to override the Serif arabic font (apparently, the urdu font is preferred), and how to set an alias for Arial to use with webpages which specify that for arabic and persion https://www.baeldung.com/linux/configure-multilingual-fonts

It appears that in 2.14.1 the monospace font was screwed up, the correct general mono font should be Noto Sans Mono.

This affects the detail, but having missed it at the time I don't think correcting all the details is too urgent - I can look at that part after I've finished updating my details of (latin, cyrillic, greek) fonts.

For the moment, I'll put a note on the page.

Change History (7)

comment:1 by ken@…, 5 months ago

I think it's ready, but with a LOT more changes to the tuning fontconfig page than I had expected. Example book at https://www.linuxfromscratch.org/~ken/fontconfig-systemd/ - no changelog, only the 'Tuning Fontconfig' and 'TTF and OTF fonts' pages have any changes.

As I said on -dev and -support lists (marked up to stop the web view separating the numbered lines)

1. I had been looking at fonts, and came1. back to the machine which
had inherited some old settings. I'd always wondered why new Firefox
installs defaulted to VL Gothic, eventually I understood why
(inadequate overrides for my preferences), fixed that, and updated
trunk. But to get there I realised that the commands I'd shown in
the past were inadequate.
2. Looking for information about Fontconfig either finds postings
from several years ago, or from BLFS. In the absence of easily
available reliable info I decided BLFS ought to have details and
external links as appropriate - these will let people determine
which other random pages they come across are worth considering, and
which are out of date or only releevant for patched FreeType.

3. It is easy to look at the preferences in the conf files, but less
easy to immediately identify which of them are freely-available
fonts (I assume most users of BLFS do not spend money buying fonts).

4. While looking at fonts with multiple weights, I decided to see if
I could get bolder text on a machine where the monitor is cheap and
nasty. That was not wholy conclusive, I've documented the apparent
results.

5. The whole business of hinting and font choice is complicated, and
many things can override what you think you have specified.  I've
attempted to document how to make GNOME, Plasma, LXQt and Xfce match
waht you want to do, and similarly how to get Firefox to match your
settings.  Libreoffice appears to have its own rules, and Pango no
longer supports hintfull.

(summarising the rest)

It could do with review to see if anything looks incorrect. Also,
I've linked it from 'About font weights' to a page at ~ken/ for
people to copy, edit to specify an installed font (if not edited,
it should use your default Serif font - assumes you are using a
Latin font) to show which weights are available. For older fonts
with only normal and bold weights I anticipate that everything
up to Medium will use the normal font, Bold and heavier will use
bold, and SemiBold ought to use normal but often looks as if it
uses Bold, at least in firefox. More importantly, do the
instructions for downloading, editing and using it make sense ?

comment:2 by Douglas R. Reno, 5 months ago

Hi Ken,

It probably won't be today, but I will look through your branch soon and will get back to you with any feedback.

comment:3 by Douglas R. Reno, 5 months ago

Hi Ken,

Tonight I read through the new page. Here's some things I think we could improve on/change:

  • In the Xft Font Protocol section, I think we should change

"Symlinks were created from the OTF and TTF X font directories to /usr/share/fonts/X11-{OTF,TTF}."

to

"Symlinks were created from the OTF and TTF X font directories to /usr/share/fonts/X11-{OTF,TTF} in Xorg Fonts."

  • In Useful Commands, do we need to specify the amount of time to wait in "fc-list | less"? I was thinking we could just say "If you recently installed a font and it doesn't show, then the font the directory it's contained in is not readable by your user." instead, what do you think?
  • In Useful Commands, under 'fc-match -a Type | less', is this a typo? "that type (Monospace, Sans Sans-serif, Serif (capital letters optional))". Is there supposed to be a comma between Sans and Sans-serif?
  • In Useful Commands, under "fc-match 'Serif :lang=ja:weight=bold'", should we change "For language codes use ISO-639 value such as 'fr', 'ja', 'zh-cn'" to "For language codes, use ISO-639 values such as 'fr', 'ja', 'zh-cn'" (add a comma and say value instead of values)
  • In Useful Commands, there's a small typo for "fc-match 'Serif :lang=ja[...]" where we're saying "wherei" instead of "where"
  • Under "the rules to choose a font", it looks like you've got an extra parenthesis at the end of the text for zarniwhoop.uk
  • Under "the rules to choose a font", should Persion be Persian?
  • Under "the rules to choose a font", should we change

"These now come in many variations, probably anyone who uses these will not install any other CJK fonts."

to

"These fonts now come in many variations, and most users who use these will not install any other CJK fonts."

  • Under "the rules to choose a font", we've got a minor typo under the Serif fonts - "compatilbe" should become "compatible". Let's also add "and" before "Times" in the remaining order list.
  • Under "the rules to choose a font", let's add "and" prior to "anything mapped to Helvetica."
  • Under "the rules to choose a font", let's add "and" prior to "anything mapped to Courier."
  • Under Hinting and Anti-Aliasing, should we change "see Items which can override Fontconfig below" to "see Items which can override Fontconfig below for more details." ?
  • Under Hinting and Anti-Aliasing, we've got a paranthesis in the Note which isn't closed: "(Spoiler: there is NO sub-pixel hinting, the code simply ignores all horizontal hinting instructions."
  • Under Synthetic changes, let's reword "With just the embolden[...]" to "With just the embolden, Epiphany showed darker fonts, while Firefox did not - so although Cairo is now used by Firefox, the comment about setting weight is still valid. After setting both, Epiphany will show bold text by default, but it will show heavy text if markup for bold is used."
  • Under "Editing Old-Style conf files", should we wrap both configuation blocks around a <screen>? I feel like this would make it easier to read as it feels out of place with just the raw text.
  • Under "Items which can override Fontconfig", we should probably mention that GNOME Tweaks (xref linkend="gnome-tweaks") can also update the font settings in a GUI form instead of having to edit them directly through dconf-editor.
  • Under "Items which can override Fontconfig", we've got an extra 'i' before Xfce Desktop, and let's add a "->" before "Appearance".
  • Under "Items which can override Fontconfig", let's also mention that Thunderbird's font settings can be changed by going to "Edit -> Settings" and then scrolling down to "Fonts & Colors".

Other than the above minor tweaks, the content of the page looks good to me! In addition, the downloading/editing of the font-weights file makes sense.

comment:4 by ken@…, 5 months ago

Doug, many thanks for your time on that detailed review.

Some of those points sound like obvious improvements, for one or two others I need to take a look at what is there before agreeing or clarifying. Of the others, I did not know about what GNOME Tweaks can do, nor about Thunderbird's settings.

Meanwhile, I keep wondering about recommending the TTF fonts instead of OTF (on some modern fonts the TTFs have hinting, the OTFs don't), but for the moment I'm ambivalent, particularly since only limited hinting is available to many applications and I could not find out if fontspec in latex / lualatex / xelatex uses any hints.

Will work through the items.

in reply to:  3 comment:5 by ken@…, 5 months ago

Replying to Douglas R. Reno:

Just a couple of points:

  • In Useful Commands, under 'fc-match -a Type | less', is this a typo? "that type (Monospace, Sans Sans-serif, Serif (capital letters optional))". Is there supposed to be a comma between Sans and Sans-serif?

I looked at this, and thought there was probably supposed to be a comma - but was not sure about exactly what is acceptable for the type. So I tried a few invocations and it seems that (with far too many fonts installed, for updating my website docs) everything seems to show up, even for Monospace or Serif.

I need to think about that some more, for the moment I've added the comma.

  • Under "Editing Old-Style conf files", should we wrap both configuation blocks around a <screen>? I feel like this would make it easier to read as it feels out of place with just the raw text.

Yes, good idea. I originally had <literallayout> tags for that, but those are not valid within <screen>. Trying <literal> was accepted, but made the text lightweight so I've gone with only <screen>.

Committing, but not pushing until I've had a think about the other issue.

comment:6 by ken@…, 5 months ago

Went to a machine with a recent system and not so many fonts.

fc-match 'Font Name' (the previous example command) is fine.

fc-match with -a ignores any following arguments and acts as a synonym for fc-list (i.e. all fonts, all styles, all weights).

fc-match with a Type returns the best match (and if the Type is mis-spelled or not sensible it assumes Sans).

And any of Mono Monospace mono monospace Sans sans Serif serif work for the Type. I cannot distinguish if Sans-serif is accepted as a variant of Sans or just falls into 'whatever, give him the default Sans font'.

So, 'fc-match -a anything | less' is rubbish. Will change it to fc-match Type and simplify the explanation. Probably not today.

Based on the following example, using quotes around 'Type :lang=xx' can provide different results for CJK ISO codes if any CJK fonts have been installed and proves that Type (or anything else) defaults to Sans. Obviously we do not need to spell that part out. Will simplify that example command, probably not today.

comment:7 by ken@…, 5 months ago

Resolution: fixed
Status: assignedclosed

Pushed after a few more tweaks, merged, cleaned up in sha:r12.0-943-ged3fb2ca4a17

Note: See TracTickets for help on using tickets.