Closed the-shank closed 1 year ago
Thank you for providing the patch. Would you mind to change the conditional blocks so that the return 0
statement at the end of the functions is used in all cases in order to avoid the additional returns? For example:
int FontEngine::getHAdvance (const Character &c) const {
if (_currentFace) {
if (FT_Load_Glyph(_currentFace, charIndex(c), FT_LOAD_NO_SCALE) == 0)
return _currentFace->glyph->metrics.horiAdvance;
}
return 0;
}
Please also use tabs instead of spaces to indent the code. I could also adapt the patch accordingly if you prefer that.
Both good points. My apologies that I missed the tab convention. I will update the PR as per your comments.
I have updated as per the comments. Please let me know if this looks right now. Thanks.
Thank you for the update. Your changes will be part of the next release.
FT_Load_Glyph
returns a non-zero value if there was any error. This PR adds checks to handle the non-zero return values fromFT_Load_Glyph
.