[core] Replace GlyphRangeSet in onGlyphsAvailable with optionals in the map

GlyphRangeSet isn't keyed by FontStack, so using it to indicate that a particular range was loaded could have produced false positives.
This commit is contained in:
John Firebaugh
2017-04-06 09:20:07 -07:00
parent 09a2271576
commit a50d7a331b
10 changed files with 56 additions and 93 deletions

View File

@@ -303,17 +303,11 @@ SymbolQuads getGlyphQuads(Anchor& anchor,
for (const PositionedGlyph &positionedGlyph: shapedText.positionedGlyphs) {
auto face_it = face.find(positionedGlyph.glyph);
if (face_it == face.end())
continue;
const Glyph &glyph = face_it->second;
const Rect<uint16_t> &rect = glyph.rect;
if (!glyph)
continue;
if (!rect.hasArea())
if (face_it == face.end() || !face_it->second || !(*face_it->second).rect.hasArea())
continue;
const Glyph& glyph = *face_it->second;
const Rect<uint16_t>& rect = glyph.rect;
const float centerX = (positionedGlyph.x + glyph.metrics.advance / 2.0f) * boxScale;
GlyphInstances glyphInstances;