fschutt / rust-fontconfig

Pure-Rust rewrite of the Linux fontconfig library (no system dependencies) - using ttf-parser and allsorts
MIT License
39 stars 8 forks source link

Process `include` directives in font config files and process all files that are found. #9

Closed zedseven closed 7 months ago

zedseven commented 7 months ago

This turned out to be a much bigger change than I expected it to be.

The processing obeys the rules specified here: https://www.freedesktop.org/software/fontconfig/fontconfig-user.html It also resolves ~ characters in font directory paths, since I found that was common (i.e. ~/.fonts.conf).

On my system, without this change, the library only found a single font. After the change, it found 120.

In addition to this change, I removed the limit of 32 font config directories and switched it to use a Vec instead of a fixed-size array. I'm not sure what the reason was for it originally, but it needed to be able to expand, since the library is likely to find way more directories than it found before.