Skip to content

About shaping using allsorts #229

Description

@martin-kolarik

I looked a bit more to how to use allsorts shaping in the current code and it seems difficult. More precisely, I do not know plans with printpdf, so I cannot speak about how things should or should not be done.

Technically:

  • allsorts shaping requires to create allsorts::Font, using FontProvider. This means, that if printpdf used it the whole bunch of code (PreparedFont) would be effectively duplicate (because it is needed for azul).
  • Using allsorts shaping naively, meaning just to create Font and to call shape, would require repeated parsing of whole font binary, if the Font was not cached. I already mentioned this, because font parsing is really slow, so I have created and I am using cache of Font (FontProvider). printpdf currently is lacking this (because it parses fonts on it own).
  • Existing printpdf ParsedFont could be used for shaping like allsorts does, but it would require copy out big amount of shaping code from allsorts. Likely 'all the cleverness'. It does not look for me as viable way.

So, I am stuck :-).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions