lagrange
lagrange copied to clipboard
Fontconfig support
Most GUI programs on Linux use, in some capacity, Fontconfig, which allows the user/system to manage fonts, set preferred fonts for various styles (serif, sans-serif, monospace), set font rendering options such as hinting and subpixel filtering, use fallback fonts for glyph support, and so on.
Having to install font packs in a custom format is unusual and wastes disk space when the user's preferred fonts are already present on the system. It also means that features like hinting, subpixel filtering, and fallback fonts for missing glyphs can't be configured without having to manually add a UI for it to Lagrange. It may be worth considering adding Fontconfig support.
Issue #195 is relevant here: https://github.com/skyjake/lagrange/issues/195#issuecomment-798891517
I fully agree that the end goal here should be to use the platform's "native" text and font APIs: FreeType/Fontconfig on Linux, Core Text on macOS/iOS, and DirectWrite on Windows, for example. However, I don't want to implement a fundamental feature like this only for a single platform like Linux. After all, a key goal for Lagrange is to be a truly cross-platform application, running natively and equally well on all desktop and mobile operating systems (that are supported by SDL). Therefore, this isn't a trivial enhancement.
The current implementation with platform-agnostic font rasterization and independently packaged fonts can be used on any operating system, and will ultimately be the fallback solution where native APIs are unavailable or infeasible.