Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot load generic font family on MacOS #26

Open
38 opened this issue Oct 25, 2019 · 2 comments
Open

Cannot load generic font family on MacOS #26

38 opened this issue Oct 25, 2019 · 2 comments

Comments

@38
Copy link

38 commented Oct 25, 2019

Hi,

Thanks for the great crate, I used this to load system fonts for my crate Plotters. Recently we've added a feature that supports generic font families like serif, serif-sans and monospace.

On Linux, query a generic font family will return expected result. But On MacOS, it seems font-loader doesn't have a way to load generic font family and querying "serif" will directly return FontNotFound.

I believe CTFontStylisticClass should be one way to query the generic font class.

Also there's a behavior difference on MacOS and Linux when font is not found. On Linux it returns the default font, on MacOS it returns an error.

Could you please give some guidance on this stuff ?

Thanks!


Update, just tried windows it seems it constantly return arial font if the requested font is not exists. Including requesting the general font families

@matprec
Copy link
Owner

matprec commented Oct 26, 2019

I can't really comment on the MacOS implementation, i don't own a mac device / don't have access. If you time to spare, feel free to do so :)

IIRC some servo engineers provided the original implementation. They since wrote their own implementation, called font-kit. You should check if it suits your needs!

@38
Copy link
Author

38 commented Oct 27, 2019

Yep, that works correctly on all platforms. But you know I still kind of like this crate because it has way less dependency. (Also for rusttype).

Thanks for the information!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants