Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a mechanism to configure the tables included when subsetting #61

Open
Tracked by #27
wezm opened this issue Apr 1, 2022 · 0 comments
Open
Tracked by #27

Comments

@wezm
Copy link
Contributor

wezm commented Apr 1, 2022

The subsetting functionality was originally driven by the needs of embedding fonts in PDFs in Prince. In this context a number of tables are not required due to being handled by the PDF document or by processing that done as part of generating the PDF.

Ideally we'd like the subsetting functionality to be useful outside the PDF context as well. This will necessitate including all tables required by OpenType. At the same time we don't want to unnecessary increase the size of our customers PDFs by including unnecessary tables. So, there needs be a way to control the tables that are included when subsetting fonts in order to support both use cases. I'm imagining this would be implemented along these lines:

  1. The subsetting function accepts a list of tables to include in the output font.
  2. There is a pre-defined list of tables that can be supplied to produce a valid OpenType font. We could define our own predefined list of tables for use with Prince.

E.g.

const MIN_OPENTYPE: &[u32] = [tag::HEAD, tag::MAXP,];

fn subset(
    provider: &impl FontTableProvider,
    glyph_ids: &[u16],
    tables: &[u32]
) {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant