20
850
Fork
You've already forked fuzzel
83

docs: provide a primer on the fontconfig format #563

Manually merged
dnkl merged 2 commits from markstos/fuzzel:document-fontconfig-format into master 2025年06月18日 10:25:27 +02:00
Collaborator
Copy link

For those who aren't familiar with the fontconfig format, provide a quick reference to it so save an additional documentation look up.

( I wasn't aware it supported fallback until today!)

For those who aren't familiar with the fontconfig format, provide a quick reference to it so save an additional documentation look up. ( I wasn't aware it supported fallback until today!)
docs: provide a primer on the fontconfig format
Some checks are pending
ci/woodpecker/pr/woodpecker Pipeline is pending approval
builds.sr.ht/freebsd-x64 Job completed
78157c4fc0
@ -625,0 +640,4 @@
- *width* - condensed, normal, expanded
Fontconfig supports fallback fonts. You can specify multiple font
families separated by commas, and fontconfig will try them in order:
Owner
Copy link

This section is not factually correct, though I can see how one would arrive at this conclusion.

I looked at fcft's documentation, and it's too ambiguous as well. Foot's docs are the best, but could probably be improved as well:

The fallback fonts are searched in the order they appear. If a glyph cannot be found in any of the fallback fonts, the dynamic fallback list from fontconfig (for the primary font) is searched.

To expand on this; fontconfig always returns "something" (unless you don't have any fonts installed), regardless of what font name you give it (try fc-match foobar). It's also almost always a list of fonts (unless you only have a single font installed (try fc-match -s foobar).

This is what foot's documentation refers to as the dynamic fallback list from fontconfig.

The fallback list in foot and fuzzel is an fcft feature, where fcft will search the "explicit" fallbacks first, whenever a glyph cannot be found in the primary font. When it cannot find a glyph in any of the explicit fallbacks, then it searches the fontconfig fallbacks (of the primary font only, i.e. the first font in the foot/fuzzel list).

Why do we allow this? First, to allow a custom fallback sequence. Second, and perhaps more importantly, it allows you to specify custom font options for each fallback font, something not possible with the fontconfig fallbacks. This includes everything, from size, style, weight, to limiting the codepoint range etc.

This section is not factually correct, though I can see how one would arrive at this conclusion. I looked at fcft's documentation, and it's too ambiguous as well. Foot's docs are the best, but could probably be improved as well: > The fallback fonts are searched in the order they appear. If a glyph cannot be found in any of the fallback fonts, the dynamic fallback list from fontconfig (for the primary font) is searched. To expand on this; fontconfig **always** returns "something" (unless you don't have any fonts installed), regardless of what font name you give it (try `fc-match foobar`). It's also almost always a list of fonts (unless you only have a single font installed (try `fc-match -s foobar`). This is what foot's documentation refers to as _the dynamic fallback list from fontconfig_. The fallback list in foot and fuzzel is an fcft feature, where fcft will search the "explicit" fallbacks first, whenever a glyph cannot be found in the primary font. When it cannot find a glyph in any of the explicit fallbacks, then it searches the fontconfig fallbacks (of the primary font only, i.e. the first font in the foot/fuzzel list). Why do we allow this? First, to allow a custom fallback sequence. Second, and perhaps more importantly, it allows you to specify custom font options for each fallback font, something not possible with the fontconfig fallbacks. This includes everything, from size, style, weight, to limiting the codepoint range etc.
Owner
Copy link

Finally, this also means that we will not use the fallback font only, if the primary font doesn't exist. FontConfig will still give us "a" font for the primary font, but it may not be the "correct" font.

Finally, this also means that we will **not** use the fallback font only, if the primary font doesn't exist. FontConfig will still give us "a" font for the primary font, but it may not be the "correct" font.
dnkl marked this conversation as resolved
docs: second attempt at documenting font fallback behavior.
Some checks are pending
builds.sr.ht/freebsd-x64 Job completed
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline is pending approval
bdcea21c9b
dnkl manually merged commit 67f93a2261 into master 2025年06月18日 10:25:27 +02:00
Owner
Copy link

Thanks!

Thanks!
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dnkl/fuzzel!563
Reference in a new issue
dnkl/fuzzel
No description provided.
Delete branch "markstos/fuzzel:document-fontconfig-format"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?