-
Notifications
You must be signed in to change notification settings - Fork 21
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
findfont picks wrong font #83
Comments
Seems like the function I wrote there has some bad edge cases. The problem here is that the family name of What I wanted at the time was that you wouldn't have to exactly spell out "AlegreyaSans-BoldItalic" because that's usually annoying to look up for every font, these exact names are not obvious. But this matching on name parts has its own issues as seen here. |
That's exactly the same thought as I had (combining the score, and using the family as the first tiebreak). The non-cache speed-up I had in mind is that:
Might you have any thoughts on this? |
That's why there's a name length penalty. This is so that |
I think the idea of pre-sorting + bailing out should be fine as long as we can assume that font files (even just within the same family's set of files) have a semi-consistent naming scheme. What I'd like to test is then sorting by matching components then length, also not bailing out until the total match score decreases. I think that should behave pretty well in practice, and supply a dramatic speed-up (Makie's caching is helpful, but even the first time you hit a custom font, a multi-second delay seems a bit much). |
Hmmm, looking at the current scheme I think I see one or two other aspects where the matching process falls short. I'll see how my efforts go, I might have a PR for discussion up shortly. |
I was recently thinking of trying something other than a cache to speed up
findfont
(it takes ~1.5s on my machine), but in the process noticed that it seems to be picking the wrong font??The text was updated successfully, but these errors were encountered: