Skip to content

Reencode() silently mis-encodes type1 fonts with Unused/detached glyphs #3080

@HinTak

Description

@HinTak
  • Provide a general summary of the issue in the Title above.
  • Before you open an issue, please check if a similar issue already exists or has been closed before.

Important

Mark with [x] to select. Leave as [ ] to unselect.

When reporting a bug/issue:

  • Screenshot
  • The FontForge version and the operating system you're using

Based on source from git with hash: b8e5ff8, fedora linux, x86_64

  • The behavior you expect to see, and the actual behavior

For example, for subfont 44, this is what ttf2tfm gives:

/a1sh44Encoding [
/index0x1AD1 /index0x1AD2 /index0x1AD3 /index0x1AD4
/index0x1AD5 /index0x1AD6 /index0x1AD7 /index0x1AD8
/index0x1ADA /index0x1ADB /index0x1ADC /index0x1ADD
/index0x1ADE /index0x1ADF /index0x1AE0 /index0x1AE1
/index0x1AE2 /index0x1AE3 /index0x1AE4 /index0x1AE5
/index0x1AE6 /index0x1AE7 /index0x1AE8 /index0x1AE9
/index0x1AEB /index0x1AEC /index0x1AED /index0x1AEE
/index0x1AF0 /index0x1AF1 /index0x1AF2 /index0x1AF3
...

This is what fontforge does (it is really glyph id rather than uniXXXX) - whenever fontforge seems to be randomly uses /uni44*, it encodes the wrong glyph. The glyph ids should be uni1AD1, etc. So half of subfont 44 is wrong, in my case.

/a1sh44-Enc [
/uni4400 /uni1AD2 /uni4402 /uni1AD4
/uni4404 /uni4405 /uni1AD7 /uni4407
/uni4408 /uni1ADB /uni1ADC /uni440B
/uni1ADE /uni1ADF /uni440E /uni1AE1
/uni1AE2 /uni4411 /uni4412 /uni1AE5
/uni4414 /uni1AE7 /uni1AE8 /uni4417
/uni4418 /uni1AEC /uni441A /uni441B
/uni1AF0 /uni441D /uni441E /uni1AF3
...
  • [x ] Steps to reproduce the behavior
fontforge -script cjk/utils/subfonts/subfonts.pe SourceHanSerifTC_EL-M/SourceHanSerifTC
-Regular.otf a1sh /usr/share/texlive/texmf-dist/fonts/sfd/ttf2pk/Unicode.sfd
  • (optional) Possible solution/fix/workaround

When you open an issue for a change/improvement/feature request:

  • A description of the problem you're trying to solve, including why you think this is a problem
  • If the feature changes current behavior, reasons why your solution is better
  • (optional) Possible solution/fix/workaround

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions