Skip to content

{nb} breaks if text shaping is turned on with certain fonts #1090

@catsclaw

Description

@catsclaw

The special {nb} code fails with some fonts when text shaping is turned on.

Minimal code
Please include some minimal Python code reproducing your issue:

pdf = FPDF(format='letter')
pdf.add_font('gentium', style='', fname='GenBkBasR.ttf')
pdf.add_page()
pdf.set_font('gentium', '', 24)
pdf.set_text_shaping(True)
pdf.write(text='Pages {nb}')
pdf.ln()
pdf.set_text_shaping(False)
pdf.write(text='Pages {nb}')
pdf.output('test.pdf')

Result
image
Environment
Please provide the following information:

  • Operating System: Ubuntu
  • Python version: 11
  • fpdf2 version used: 2.7.7

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions