Skip to content

Kernel: text in Symbol and ZapfDingbats is encoded through WinAnsiEncoding, but read through their built-in encodings #762

Backlog

Description

@Tim81

Why

PdfFontResource writes /Encoding /WinAnsiEncoding for every Standard 14 font except Symbol and ZapfDingbats,
whose built-in encodings then apply (ISO 32000-2 Annex D, Tables D.5 and D.6). The text itself is still encoded
through WinAnsiEncoding (Standard14Metrics and the show-string path look bytes up in WinAnsiEncoding), so the
bytes written for these two fonts are WinAnsi codes read against a different table. For example, a bullet U+2022 is
written as 0x95 and an en dash U+2013 as 0x96, and neither code is defined in Table D.5 or D.6. Found while fixing
#545 in PR #758, which keeps main's output for these two fonts and does not fix the encoder.

Related: #470 (the same two fonts have no width tables, so every string measures zero).

Proposal

Encode a string for Symbol and ZapfDingbats through the font's own built-in encoding (Unicode to code via the Adobe
Glyph List names in Tables D.5 and D.6), report a character the font cannot encode as the other Standard 14 fonts
do, and measure with the matching widths (#470).

Acceptance

  • A bullet in Symbol is written as the code Table D.5 gives for bullet (0xB7), and a black circle in ZapfDingbats
    as a71 (0x6C), each pinned at byte level.
  • A character neither table has is reported, not written as an undefined code.
  • Documents in the other twelve fonts keep their bytes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions