Skip to content

Drop Apple bitmap tables when subsetting a font - #2192

Open
RavSinghChandan wants to merge 2 commits into
py-pdf:masterfrom
RavSinghChandan:drop-apple-bitmap-tables
Open

RavSinghChandan wants to merge 2 commits into
py-pdf:masterfrom
RavSinghChandan:drop-apple-bitmap-tables

Conversation

@RavSinghChandan

Copy link
Copy Markdown

With the Geneva.ttf or Cochin.ttc of macOS, add_font() works but output() fails while subsetting the font:

struct.error: unpack requires a buffer of 2 bytes

fontTools cannot read their bloc table, Apple's bitmap location table, when the subsetter loads it. The subsetter already drops EBDT, EBLC and EBSC, since bitmap glyphs are not used in a PDF, but not bdat and bloc, the Apple tables they correspond to. They are now in the same drop_tables list.

test_add_font_with_apple_bitmap_tables adds unreadable bloc and bdat tables to DejaVuSans at run time and outputs text with it; it fails on master with the same struct.error. Changelog entry under 2.9.1 / Fixed.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant