-
Notifications
You must be signed in to change notification settings - Fork 253
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
Show warning if font is missing glyphs #661
Conversation
for unicode in uni_to_new_code_char | ||
if unicode not in cmap | ||
] | ||
if len(missing_glyphs) > 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, simple addition!
Could you please add a unit test, and a mention in CHANGELOG.md
of this change?
Co-authored-by: Lucas Cimon <925560+Lucas-C@users.noreply.github.com>
Codecov ReportBase: 94.05% // Head: 94.08% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #661 +/- ##
==========================================
+ Coverage 94.05% 94.08% +0.03%
==========================================
Files 26 26
Lines 6729 6732 +3
Branches 1192 1194 +2
==========================================
+ Hits 6329 6334 +5
+ Misses 230 229 -1
+ Partials 170 169 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@@ -112,3 +113,13 @@ def test_add_font_uppercase(): | |||
pdf = FPDF() | |||
pdf.add_font(fname=HERE / "Roboto-BoldItalic.TTF") | |||
assert pdf.fonts is not None and len(pdf.fonts) != 0 # fonts add successful | |||
|
|||
|
|||
def test_font_missing_glyphs(caplog): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Merged! Thank you very much @andersonhc 😃 |
As discussed in #637, this is a first PR only to show a warning if the font is missing glyphs
e.g. Fixes #0
Checklist:
The GitHub pipeline is OK (green),
meaning that both
pylint
(static code analyzer) andblack
(code formatter) are happy with the changes of this PR.A unit test is covering the code added / modified by this PR
This PR is ready to be merged
In case of a new feature, docstrings have been added, with also some documentation in the
docs/
folderA mention of the change is present in
CHANGELOG.md
By submitting this pull request, I confirm that my contribution is made under the terms of the GNU LGPL 3.0 license.