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

Test compoundMap[glyphIndex] before declaring as non-null #1735

Open
REU8ER opened this issue Sep 5, 2024 · 0 comments
Open

Test compoundMap[glyphIndex] before declaring as non-null #1735

REU8ER opened this issue Sep 5, 2024 · 0 comments
Labels
enhancement New feature or request needs triage

Comments

@REU8ER
Copy link

REU8ER commented Sep 5, 2024

Testing whether "compoundMap[glyphIndex]" is null before declaring it as non-null, this is causing an error when saving the document, preventing it from being generated.

from:
bytes.setUint16(offset + 2, compoundMap[glyphIndex]!);
offset += (flags & arg1And2AreWords != 0) ? 8 : 6;

to:
final value = compoundMap[glyphIndex];
if (value != null) {
bytes.setUint16(offset + 2, value);
offset += (flags & arg1And2AreWords != 0) ? 8 : 6;
}

Detalhe do problema:
#1686

With this we can check whether it will be null or not, causing the document to be generated, even ignoring the character that could not be processed. By doing this, the character that generates the error is replaced by a blank space, from "≥" to " ", I know that would not be the best alternative, but with this the document is generated normally and does not return as null.

This is in the "ttf_writer.dart" file in the "font" folder.

I don't have much knowledge about GitHub or how to open a Push Request, but I would like to help and I hope I was able to do so.

@REU8ER REU8ER added enhancement New feature or request needs triage labels Sep 5, 2024
Repository owner deleted a comment Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage
Projects
None yet
Development

No branches or pull requests

1 participant