fix glyphs that have no pixels but an advance (e.g. spaces)
This commit is contained in:
@@ -30,7 +30,7 @@ struct Glyph {
|
||||
: rect(rect), metrics(metrics) {}
|
||||
|
||||
operator bool() const {
|
||||
return !metrics;
|
||||
return !metrics && !rect;
|
||||
}
|
||||
|
||||
const Rect<uint16_t> rect;
|
||||
|
||||
@@ -9,7 +9,7 @@ struct Rect {
|
||||
T x = 0, y = 0;
|
||||
T w = 0, h = 0;
|
||||
|
||||
operator bool() const { return w == 0 && h == 0; }
|
||||
operator bool() const { return w == 0 || h == 0; }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ Rect<uint16_t> GlyphAtlas::addGlyph(uint64_t tile_id, const std::string& face_na
|
||||
}
|
||||
|
||||
// The glyph bitmap has zero width.
|
||||
if (!glyph.metrics.width) {
|
||||
if (!glyph.bitmap.size()) {
|
||||
return Rect<uint16_t>{ 0, 0, 0, 0 };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user