pdf-raku / PDF-Font-Loader-raku

Font loader for the PDF tool-chain
Artistic License 2.0
1 stars 3 forks source link

Reusing a font within a PDF copies it #6

Closed dwarring closed 3 years ago

dwarring commented 3 years ago

PDF::Font::Loader::Dict builds a Font::Loader::FreeType object with a brand new dictionary and stream.

Using this font to write back to the PDF works, but at the expense of replicated font object, including the underlying Font Descriptor. CMap and stream.

Simple.but inefficient.

dwarring commented 3 years ago

A restructure is underway on the 'reuse' branch to get font reuse working better. Allowing the font to be reused and updating just the specifics that may be affected by using an amended character set.

dwarring commented 3 years ago

Working reasonably well now for unmbedded fonts. Still working on reuse branch.

Also, desirable to make widths (/Widths or FontDescriptor/W entries) authoritative over internal font metrics for stringwidth and kern methds.

dwarring commented 3 years ago

Fixed in 0.5.1 release