Detect when a FreeType glyph doesn't have a path.
It appears that the way to check a glyph doesn't have a path is to load the glyph with the FT_LOAD_NO_BITMAP load flag and then check if the glyph format is FT_GLYPH_FORMAT_BITMAP, meaning that no outline was available. Change-Id: Ie19fc7005115f4c4f6072a7be0e93576f8db5877 Bug: skia:7878 Reviewed-on: https://skia-review.googlesource.com/150467 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
This commit is contained in:
parent
92e4c7fded
commit
acb4b0f474
@ -1342,7 +1342,7 @@ bool SkScalerContext_FreeType::generatePath(SkGlyphID glyphID, SkPath* path) {
|
||||
flags &= ~FT_LOAD_RENDER; // don't scan convert (we just want the outline)
|
||||
|
||||
FT_Error err = FT_Load_Glyph(fFace, glyphID, flags);
|
||||
if (err != 0) {
|
||||
if (err != 0 || fFace->glyph->format == FT_GLYPH_FORMAT_BITMAP) {
|
||||
path->reset();
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user