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

Support for separating TTC font when serializing #1

Closed
harry75369 opened this issue Nov 16, 2021 · 0 comments
Closed

Support for separating TTC font when serializing #1

harry75369 opened this issue Nov 16, 2021 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@harry75369
Copy link
Member

Current implementation of embedding currently used typefaces into VGG file depends on SkTypeface::serialize which will save entire TTC data, rather than the subset.

(Some prerequisites: A TTC file is a collection of TTF fonts. Each TTF font maps to only one skia typeface.)

In order to minimize the saved VGG file, we need to subset the TTC data for target typeface. This could be achieved in two different ways:

  1. when loading TTC file, separate it into TTF files and load each typeface accordingly. Or
  2. when serializing certain typeface, extract the correct part of original TTC data which is stored in SkTypeface and then make the serialization.

The first way is preferred for implementation, but it will increase memory usage since TTC data is usually shared between all typefaces.

Some implementation references:

@harry75369 harry75369 added enhancement New feature or request help wanted Extra attention is needed labels Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant