Giter Club home page Giter Club logo

Comments (5)

galkahana avatar galkahana commented on July 20, 2024

Bummer. otf supposed to be rather straightforward passthrough.
Try convertig the font to propper true type (ttf), and see if it solves the problem.

If you want to have an attempt at debugging, I can provide pointers.

Gal.

from pdf-writer.

stribor avatar stribor commented on July 20, 2024

This is problem at end user side.

So I would like any help I could get to try to debug this issue.

from pdf-writer.

galkahana avatar galkahana commented on July 20, 2024

Cool.
The relevant element that writes the glyph data for open types is CharStringType2Flattener::WriteFlattenedGlyphProgram
This method iterates the original glyph drawing commands, for the case of Open Type CFFs and writes them to the source. It pretty much passes through the elements, as PDF uses the same CFF data internally. The only thing it does is to flatten the font program, which is the same thing that everybody does.
What we expect is that there is a bug in one of the passthroughs. probably som mixup with the operators order.

The easiest way to figure out what's wrong is to create a PDF from an application that does it correctly with only one letter. Then do it with hummus.
Then compare the glyph data, and see where the instructions differ. then debug CharStringType2Flattener::WriteFlattenedGlyphProgram and see at what point it started to deviate and try to figure out why.

You'll have to get the font definition from both PDFs. after that you can use ttx or hummus CharStringType2Tracer to get a human readable form of the glyph instructions.

To extract the fotn definition you can use hummus parsing tools. just locate the embedded font program. it will be pointed to by the font descriptor FontFile3 key.

Another option is to just go through CharStringType2Flattener::WriteFlattenedGlyphProgram and try to figure out if it does something out of the ordinary, but without reference that works it may be difficult. but this path also require less preparation. so you can start with this...see if you can figure this out already from there, and possibly get lucky.

Gal.

from pdf-writer.

galkahana avatar galkahana commented on July 20, 2024

@stribor good news.
Got some time, and found and corrected the issue. you can see the commit here (the latest):
f178001

Gal.

from pdf-writer.

stribor avatar stribor commented on July 20, 2024

Perfect, thank you. I started finding some time to look into it :)

from pdf-writer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.