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

Support for SkFontMgr_New_Custom_Directory #291

Open
theacodes opened this issue Dec 20, 2024 · 6 comments · May be fixed by #292
Open

Support for SkFontMgr_New_Custom_Directory #291

theacodes opened this issue Dec 20, 2024 · 6 comments · May be fixed by #292

Comments

@theacodes
Copy link

Is your feature request related to a problem? Please describe.

Yes, I'd like to load fonts specifically bundled with my application instead of system fonts or only a single font.

Describe the solution you'd like

Skia has SkFontMgr_New_Custom_Directory which is basically exactly what I'd need. If I could create a FontMgr using that, I'd be all set!

Describe alternatives you've considered

Alternatively it'd be nice to add a font loaded from a file to any SkFontMgr but that probably isn't the best approach.

@HinTak
Copy link
Collaborator

HinTak commented Dec 20, 2024

This is already in my pile of updates to be included when m133 comes out. I guess you filed this because I mentioned it in a few times elsewhere in some comments

@theacodes
Copy link
Author

😅 not at all, I just stumbled across this when dealing with some tests on our repo that failed when a specific font wasn't installed. Glad to hear it's coming, thank you!

@HinTak
Copy link
Collaborator

HinTak commented Dec 20, 2024

Oh, I mentioned it two weeks ago in another issue #288 (comment) - I think I also wrote about it in some other place like rust-skia too.

@HinTak
Copy link
Collaborator

HinTak commented Dec 20, 2024

The other place I wrote about it . rust-skia/rust-skia#1055 (comment)

HinTak added a commit to HinTak/skia-python that referenced this issue Dec 24, 2024
@HinTak HinTak linked a pull request Dec 25, 2024 that will close this issue
@HinTak
Copy link
Collaborator

HinTak commented Dec 25, 2024

@theacodes get the CI build from #292 if you want to give it a spin. The new API is recursive - it scans subdirectories. You can use the countFamiles() method to see how many fonts it find.

@theacodes
Copy link
Author

Awesome, I'll give it a shot and let you know if I run into any issues. :)

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

Successfully merging a pull request may close this issue.

2 participants