Skip to content

insert_textbox rendering issue #2992

@Andreasox

Description

@Andreasox

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions