Skip to content

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

Closed
Andreasox opened this issue Jan 8, 2024 · 6 comments
Closed

insert_textbox rendering issue #2992

Andreasox opened this issue Jan 8, 2024 · 6 comments

Comments

@Andreasox
Copy link

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)
image

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)
image

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
image

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

@JorjMcKie
Copy link
Collaborator

Can you provide the final font please - including your modifications?
Don't want to waste time experimenting around ...

@JorjMcKie
Copy link
Collaborator

Several reasons may be possible, like an error in the glyph bbox, etc.

@Andreasox
Copy link
Author

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

@Andreasox
Copy link
Author

Realized that this may be a whitespace issue as the codepoints I selected are different kind of spaces (2000-200A).
I will test with other codepoints when time permits.

@JorjMcKie
Copy link
Collaborator

Ok I'll wait and mark this issue accordingly.

@JorjMcKie
Copy link
Collaborator

Thinking about it, for the time being this post is more a "Discussions" item than anything else.
Should we uncover a problem later, a more focused issue can be created.

@pymupdf pymupdf locked and limited conversation to collaborators Jan 8, 2024
@JorjMcKie JorjMcKie converted this issue into discussion #3000 Jan 8, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

2 participants