-
Notifications
You must be signed in to change notification settings - Fork 586
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
insert_textbox rendering issue #2992
Comments
Can you provide the final font please - including your modifications? |
Several reasons may be possible, like an error in the glyph bbox, etc. |
Dropbox link to the font (not allowed to be attached as is): https://www.dropbox.com/scl/fi/omdtevtwi9r6ps2ym2e44/GothamNarrow-Medium.otf?rlkey=bo7w24upjt9iopb8am51ks4ar&dl=0 |
Realized that this may be a whitespace issue as the codepoints I selected are different kind of spaces (2000-200A). |
Ok I'll wait and mark this issue accordingly. |
Thinking about it, for the time being this post is more a "Discussions" item than anything else. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Description of the bug
Glyphs with unicode 2000-200A are not rendered if used in the end of the string
How to reproduce the bug
According to #2970 I updated problematic glyphs (0-9 alternates) with Unicode codepoints in the range 2000-200F, see font https://www.dropbox.com/scl/fi/omdtevtwi9r6ps2ym2e44/GothamNarrow-Medium.otf?rlkey=bo7w24upjt9iopb8am51ks4ar&dl=0

insert_text seems to always render these digits correctly e.g. with:
shape.insert_text((286,157), '\u2001\u2001\u2001', fontname='GothamNarrow-Medium', fontsize=14.8)
insert_textbox will not render certain glyphs if ending the string with them, e.g.:

rect = Rect(197.5, 144.0, 397.5, 251.0)
shape.insert_textbox(rect, '\u2001\u200B\u2001', align=1, fontname='GothamNarrow-Medium', fontsize=14.8)
shape.insert_textbox(rect, '\u2001\u2001\u2001', align=1, fontname='GothamNarrow-Medium', fontsize=14.8)

and
shape.insert_textbox(rect, '\u2001\u2001\u2008', align=1, fontname='GothamNarrow-Medium', fontsize=14.8)
does not render any glyph at all
Is it possible to debug this confusing issue?
Is the range 2000-200A not possible to use with insert_textbox?
200B and above seems to work but have not tested all combos yet
PyMuPDF version
1.23.8
Operating system
MacOS
Python version
3.9
The text was updated successfully, but these errors were encountered: