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

Optimisation: face selection for fallbacks #60

Open
dhardy opened this issue Nov 2, 2021 · 0 comments
Open

Optimisation: face selection for fallbacks #60

dhardy opened this issue Nov 2, 2021 · 0 comments

Comments

@dhardy
Copy link
Contributor

dhardy commented Nov 2, 2021

Related: #53
Importance: probably low since harfbuzz/ttf-parser#68

Run-splitting must discover the font face to be used for each character. For this we use FontLibrary::face_for_char which iterates through all applicable faces, using Face::glyph_index on each, returning the FaceId of the first matching face (but discarding the GlyphId which is rediscovered during shaping).

There are a few possible optimisations here (but 2 and 3 conflict):

  1. Batch look-ups. prepare_runs calls face_for_char_or_first for each char; it may be faster to iterate through chars for each subtable (see 0.12 to 0.13 performance regressions harfbuzz/ttf-parser#76). The same could be done in shape_simple.
  2. Add a Face::contains_glyph method to ttf-parser (using the glyph_index method as a starting point, this should not be hard, but requires additional testing).
  3. Cache both FaceId and GlyphId for use when shaping. This should be usable for shape_simple though probably not for Rustybuzz or Harfbuzz backends, so not particularly useful.
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

No branches or pull requests

1 participant