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

find_font_for_this_glyph doesn't always look in the correct font #1147

Closed
mojavelinux opened this issue Feb 14, 2020 · 2 comments · Fixed by #1148
Closed

find_font_for_this_glyph doesn't always look in the correct font #1147

mojavelinux opened this issue Feb 14, 2020 · 2 comments · Fixed by #1148
Assignees

Comments

@mojavelinux
Copy link
Contributor

The find_font_for_this_glyph method does not consider the style when resolving the font. As a result, it may be looking in the wrong font and thus return an incorrect result.

The problem is here:

fragment_font = hash[:font] || original_font

The code only retrieves the font family (:font) without taking into account the style. So if the fragment is bold, the code will look for the char in the normal font instead of the bold font.

@mojavelinux
Copy link
Contributor Author

I'll see if I can submit a patch.

@mojavelinux mojavelinux changed the title find_font_for_this_glyph doesn't always look in the right font find_font_for_this_glyph doesn't always look in the correct font Feb 23, 2020
@mojavelinux mojavelinux self-assigned this Feb 23, 2020
mojavelinux added a commit to mojavelinux/prawn that referenced this issue Feb 23, 2020
note that this patch adds an optional fourth argument to find_font_for_this_glyph

resolves prawnpdf#1147
@mojavelinux
Copy link
Contributor Author

Patch submitted.

mojavelinux added a commit to mojavelinux/prawn that referenced this issue Jul 31, 2020
note that this patch adds an optional fourth argument to find_font_for_this_glyph

resolves prawnpdf#1147
mojavelinux added a commit to mojavelinux/prawn that referenced this issue Aug 25, 2020
note that this patch adds an optional fourth argument to find_font_for_this_glyph

resolves prawnpdf#1147
mojavelinux added a commit to mojavelinux/prawn that referenced this issue Jan 27, 2021
note that this patch adds an optional fourth argument to find_font_for_this_glyph

resolves prawnpdf#1147
pointlessone pushed a commit that referenced this issue Jan 27, 2021
note that this patch adds an optional fourth argument to find_font_for_this_glyph

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

Successfully merging a pull request may close this issue.

1 participant