Skip to content

Type42 font embedding broken for fonts without glyph names #18307

Closed
@anntzer

Description

@anntzer

Bug report

Bug summary

Setting pdf.fonttype or ps.fonttype to 42 and using a font with no glyph names (i.e. for which FT_HAS_GLYPH_NAMES returns 0) results in non-displayed text.

Code for reproduction

Arial is a prominent font with no glyph names (so it's not a completely obscure edge case...).

from pathlib import Path
rcParams.update({"pdf.fonttype": 42, "ps.fonttype": 42}
figtext(.5, .5, "ab", font="arial")
savefig("/tmp/test.pdf")
savefig("/tmp/test.ps")

Actual outcome

Files are displayed as empty.

Expected outcome

Text is shown.


Again #18143 may be relevant here: perhaps fontTools can generate the glyph names table if needed?

Matplotlib version

  • Operating system: fedora
  • Matplotlib version: master
  • Python version: 38

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