Werner Lemberg pushed to branch master at FreeType / FreeType Demo Programs
Commits:
-
b33c0ecf
by Charlie Jiang at 2023-03-03T09:52:15+01:00
2 changed files:
Changes:
... | ... | @@ -136,8 +136,7 @@ RenderingEngine::convertGlyphToBitmapGlyph(FT_Glyph src, |
136 | 136 | FT_Bitmap
|
137 | 137 | RenderingEngine::convertBitmapTo8Bpp(FT_Bitmap* bitmap)
|
138 | 138 | {
|
139 | - FT_Bitmap out;
|
|
140 | - out.buffer = NULL;
|
|
139 | + FT_Bitmap out = {};
|
|
141 | 140 | // This will create a new bitmap object.
|
142 | 141 | auto error = FT_Bitmap_Convert(engine_->ftLibrary(), bitmap, &out, 1);
|
143 | 142 | if (error)
|
... | ... | @@ -167,7 +166,7 @@ RenderingEngine::convertBitmapToQImage(FT_Bitmap* src) |
167 | 166 | {
|
168 | 167 | QImage* result = NULL;
|
169 | 168 | |
170 | - auto& bmap = *src;
|
|
169 | + auto bmap = *src;
|
|
171 | 170 | bool ownBitmap = false; // If true, we need to clean up `bmap`.
|
172 | 171 | |
173 | 172 | int width = INT_MAX;
|
... | ... | @@ -552,6 +552,8 @@ GlyphContinuous::drawCacheGlyph(QPainter* painter, |
552 | 552 | const GlyphCacheEntry& entry,
|
553 | 553 | bool colorInverted)
|
554 | 554 | {
|
555 | + if (!entry.image)
|
|
556 | + return;
|
|
555 | 557 | // From `ftview.c:557`.
|
556 | 558 | // Well, metrics are also part of the cache...
|
557 | 559 | int width = entry.advance.x ? entry.advance.x >> 16
|