Linux: a family name matching a fontconfig substring rule resolves silently to an unrelated face #187
Labels
No labels
Area/ci
Area/cli
Area/client
Area/client-core
Area/daemon
Area/deps
Area/docs
Area/grid
Area/manual
Area/nix
Area/protocol
Area/pty
Area/render
Area/shaping
Area/skills
Area/transport
Area/vt
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Performance
Kind/Security
Kind/Testing
perf-regression-accepted
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Blocked
Status
Need More Info
Status
Upstream
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
felis-terminal/felis#187
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
On Linux,
font.familynames that are not installed can resolve to an unrelated face with no warning. The unknown-family check incrates/felis-shaping/src/provider/fontconfig.rs(substitutes_as_unknown) calls a name unknown only when fontconfig substitution treats it exactly as it treats a name no rule mentions. Stock fontconfig rules match on part of the family name, so a name that hits one of them counts as known even when no installed family carries it.Observed on this host (NixOS, stock fontconfig rules), with
font.familyset to each name:font.familyQwxyzQwxyz Nerd FontQwxyz MonoJetBrainsMono Nerd Fnt(typo)Noto Sans Qwxyzfc-matchgives the same faces, so felis follows fontconfig here. The result is still wrong for felis's purpose:Mono.Noto Sansmakes a proportional face the primary, with no warning.It is not known yet which rules are responsible; the
contains-style tests in the stock config are the first suspects.Constraint
docs/explanation/rendering/text-shaping.md "Linux faces" records that unknown families are detected by the config rules fontconfig applies, not by comparing names, so that an
<alias>mapping a requested name elsewhere is honored. A fix must keep that: an explicit alias for the exact name still counts as known, while a generic rule that matched only part of the name does not.Possible direction
Treat a name as known when an installed family matches it (fontconfig's comparison: case-insensitive, ignoring blanks), or when substitution put a family other than the generic ones (
monospace,sans-serif,serif, and their expansions) ahead of where the unknown sentinel puts them. This needs a design, and the "Linux faces" record updated.