kas-gui / kas-text

Rich text processing
Apache License 2.0
58 stars 2 forks source link

Replace font-kit with fontdb #46

Closed dhardy closed 3 years ago

dhardy commented 3 years ago

This works on Fedora Linux for English texts (including Markdown formatting), but exposes the need for font fallbacks since the first font choice now supports fewer scripts.

This results in a very minor reduction of the file size of the gallery example (release build after stripping: from 13210680 to 12948200 bytes), and and much larger reduction in the dynamic lib dependencies (according to ldd, from 19 to 8).

@RazrFalcon this is one approach to https://github.com/RazrFalcon/fontdb/issues/11. Also, it would be nice if fontdb::Family would support PartialEq and Hash. Shall I make a PR regarding the latter (also against ttf_parser::Width)? Several other trait-derivations are possible too, e.g. Eq and on ttf_parser::Weight.

RazrFalcon commented 3 years ago

Sure, I don't mind those changes.