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

FontCache should cache font table blobs for harfbuzz #92

Closed
burg opened this issue Oct 5, 2012 · 2 comments
Closed

FontCache should cache font table blobs for harfbuzz #92

burg opened this issue Oct 5, 2012 · 2 comments

Comments

@burg
Copy link

@burg burg commented Oct 5, 2012

Right now, every time text is drawn we create a new hb_blob_t for the font face's font table. This is expensive and unnecessary. We should instead store this data with each Font object. Rather than creating new font tables for each Font object (which can represent the same font at many sizes--with the same font table data), the tables can be reused when the Font is instantiated several times.

See http://dxr.mozilla.org/mozilla-central/gfx/thebes/gfxFont.h.html#l408 for Gecko's solution to this issue.

@burg
Copy link
Author

@burg burg commented Nov 7, 2012

For now, the Font instance reuses a Shaper, which reuses the harfbuzz resources. It may be possible to reuse these font tables across font instances, but that's a future optimization not worth thinking about right now.

@burg burg closed this Nov 7, 2012
@burg
Copy link
Author

@burg burg commented Nov 12, 2012

Followup issue for caching is #197.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.