Use font family name for caching in #find_font - #924
Closed
maerch wants to merge 1 commit into
Closed
Conversation
Contributor
|
I can confirm that this happens in master and that your branch fixes it. Specifically, it happens when the normal variant of the two font families have the same filename. While I can't think of a use case for having two different font families which share a normal font, that doesn't mean that one doesn't exist, and the current behavior is confusing. FWIW I think this is a good change. |
pointlessone
force-pushed
the
master
branch
2 times, most recently
from
January 22, 2017 21:18
3c5df3e to
8309626
Compare
Member
|
@maerch Could you please provide specs for the change? |
Member
|
@maerch Thank you for your contribution. This has been merged outside of GitHub. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I am not sure about this PR, so please feel free to discuss this.
Recently I ran into an issue I debugged which was caused to the font caching mechanism. So, let us say we have the following prawn code.
After you have defined a default font family with, e.g.
font("foo"), you will run into caching problems once you try to usebar. In particular you will never actually use theOpenSans-Semibold.ttffont, but always theOpenSans-Bold.ttf. Putting the family name in the key fixes this issue.