Make stream parser resilient to text in streams #1215
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Updates the streamParser to ignore the keyword 'stream' if it is not proceeded by a special character. Fixes #1206
Why?
Some font files when embedded include their license information, one font where this occurred included the word 'bitstream' several times which confused the streamParser. The streamParser thought there were more open streams than there were.
How?
The word 'stream' should be proceeded by a space, newline, carriage return, backslash, lessThan, or greaterThan character. I also included tabs for good measure. If the word 'stream' is not proceeded by one of those characters, it is ignored.
There is a special case just after a 'stream' is consumed, we set a flag that allows an immediately following 'stream' to be counted.
Testing?
I added a test to the testing suite that exercised the fail condition with the current parser, then updated the parser to pass the new test.
New Dependencies?
NA
Screenshots
NA
Suggested Reading?
NA
Anything Else?
NA
Checklist