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 :-).
I looked a bit more to how to use
allsortsshaping in the current code and it seems difficult. More precisely, I do not know plans withprintpdf, so I cannot speak about how things should or should not be done.Technically:
allsortsshaping requires to createallsorts::Font, usingFontProvider. This means, that ifprintpdfused it the whole bunch of code (PreparedFont) would be effectively duplicate (because it is needed forazul).allsortsshaping naively, meaning just to createFontand to callshape, would require repeated parsing of whole font binary, if theFontwas not cached. I already mentioned this, because font parsing is really slow, so I have created and I am using cache ofFont(FontProvider).printpdfcurrently is lacking this (because it parses fonts on it own).printpdfParsedFontcould be used for shaping likeallsortsdoes, but it would require copy out big amount of shaping code fromallsorts. Likely 'all the cleverness'. It does not look for me as viable way.So, I am stuck :-).