https://drafts.csswg.org/css-fonts/#font-matching-algorithm specifies a fairly precise algorithm. font-kit has Source::select_best_match which claims part of it, but which takes no text or code point and only returns a single font.
Skribo’s input at the moment is a FontCollection which contains FontFamily’s which contains fonts. In CSS the input has an ordered list of family names (each a string, or one of the 5 generic categories). There is also special handing of @font-face fonts v.s. system fonts.
For the use case of implementing CSS, how much of this should be implemented in Skribo v.s. font-kit? How much should be left to the user?
CC @raphlinus, @pcwalton
https://drafts.csswg.org/css-fonts/#font-matching-algorithm specifies a fairly precise algorithm. font-kit has
Source::select_best_matchwhich claims part of it, but which takes no text or code point and only returns a single font.Skribo’s input at the moment is a
FontCollectionwhich containsFontFamily’s which contains fonts. In CSS the input has an ordered list of family names (each a string, or one of the 5 generic categories). There is also special handing of@font-facefonts v.s. system fonts.For the use case of implementing CSS, how much of this should be implemented in Skribo v.s. font-kit? How much should be left to the user?
CC @raphlinus, @pcwalton