-
Notifications
You must be signed in to change notification settings - Fork 22
Gsub buffer limit #120
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
base: master
Are you sure you want to change the base?
Gsub buffer limit #120
Conversation
Made RawGlpyh use GlyphId for glyph indexing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. I expected this to require more changes, but it seems good.
I'll add a test once I know I applied the correct fix.
Note that there is a font in the unicode text-rendering-tests that can be used for testing.
|
As per the bug report, I strongly suggest making this a multiple of the input buffer size. There are scripts without spaces and there are fonts with contextual spaces both which can result in buffers of a paragraph of text being processed. Harfbuzz uses a factor of 64 for its max (up to a hard limit of 1 billion glyphs). This is reasonable since it is only about spotting runaway growth. |
Just mentioning we could do some more flexible fix for this like harfbuzz where they more count how many times a substitution has added more glyphs than removed and sets a cap on that instead making a glyph limit less understandable since this fix the glyph limit will only apply when substitution is used leading users to not understand why their font without substitutions works with very long text but not the ones with. |
Sure, I'll add a proportional limit tomorrow when I am back |
|
Any update on this? Should we implement something like HarfBuzz's solution for more QOL of the solution or just finish this first dab? |
|
Oh sorry if I was unclear. I think we should do the multiple of input buffer approach as per my comment here #48 (comment) |
Adds buffer limit from #48
This PR adds the buffer limit to 10000 during multiplesubst in the GSUB table as asked for in #48.
I'll add a test once I know I applied the correct fix.
If this wasn't the expected fix, please tell me and I will gladly update it.