Skip to content

Fix: enumerate the fonts fontconfig knows about on art - #225

Open
DTW-Thalion wants to merge 3 commits into
gnustep:masterfrom
DTW-Thalion:fix/art-fontconfig-enumerator
Open

Fix: enumerate the fonts fontconfig knows about on art#225
DTW-Thalion wants to merge 3 commits into
gnustep:masterfrom
DTW-Thalion:fix/art-fontconfig-enumerator

Conversation

@DTW-Thalion

Copy link
Copy Markdown
Contributor

art enumerates the .nfont and .font bundles under the Library Fonts
directories, and this repository installs just the Helvetica bundle, so art
sees a single family. With no fixed pitch face to answer with,
userFixedPitchFontOfSize: falls back to the system font: at 24pt its i
advances 5 and its W 23.

art now uses the fontconfig enumerator that cairo, opal and xlib use, so it
sees what the system has. FTFontEnumerator becomes a subclass of
FCFontEnumerator, and FTFaceInfo a subclass of FCFaceInfo that reads the file,
the face index and the hinting out of the pattern fontconfig matched. That
drops the private font scanning, 570 lines of it, and the renderer takes its
hinting from the desktop settings rather than from a plist. The FreeType cache
keys on the face, so a face index other than 0 now opens correctly.

Measured here, art goes from 1 family with no fixed pitch face to 61 with 7,
the system font from Helvetica to DejaVuSans, and the fixed pitch font to
DejaVuSansMono, whose i and W both advance 14.

Tests/art/fixedpitch.m is new. The art set is 32 passed 3 failed against
master and 35 passed 0 failed here.

Closes #206

@DTW-Thalion
DTW-Thalion requested a review from fredkiefer as a code owner August 6, 2026 13:37
@fredkiefer

Copy link
Copy Markdown
Member

I am unsure about this PR. It is great to remove so much code, but now the art backend would depend on FontConfig. Up to now the art backend was a great option for old machines where there was no suitable FontConfig implementation available. That is computers where cairo, our preferred backend, was not possible.

@DTW-Thalion

Copy link
Copy Markdown
Contributor Author

I am fine with that too - this was done for parity amongst the backends to try to ensure upstream compatibility at the application level, but I can certainly see the use case of art as a "backend of last resort" if you will.

We can let people think about it for a bit, and then if not desired, we can close it and move on.

@rmottola

Copy link
Copy Markdown
Member

I would keep this open right now and have the time to test it, I think there is no hurry with the art backend anyway.
I found it nice that art could use nfont packages, albeit a little bit foreign on Linux, very OpenStep/Mac like. Also with remote display export it uses host and not server fonts. Interesting alternative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

art fonts: userFixedPitchFontOfSize: returns a proportional font because only one family is enumerated

3 participants