Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 of 7 tasks
HinTak opened this issue Jun 7, 2017 · 5 comments
Open
2 of 7 tasks

Comments

@HinTak
Copy link

HinTak commented Jun 7, 2017

  • 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
@HinTak
Copy link
Author

HinTak commented Jun 7, 2017

I tried RemoveDetachedGlyphs(); No improvement.

@HinTak
Copy link
Author

HinTak commented Jun 8, 2017

The problem was first noted on the CJK mailing list.

@HinTak
Copy link
Author

HinTak commented Jun 9, 2017

The two contributing problems are #3084 and #3085 . That's all. I am able to workaround them with an external script, but it would be nice for both of them to be fixed properly.

@HinTak
Copy link
Author

HinTak commented Jun 9, 2017

It would be nice if MultipleEncodingsToReferences() does the right thing - it currently does not.

@HinTak
Copy link
Author

HinTak commented Jun 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant