equal
deleted
inserted
replaced
918 { |
918 { |
919 quint32 glyphPos = ~0; |
919 quint32 glyphPos = ~0; |
920 |
920 |
921 if (!renderingFontEngine) |
921 if (!renderingFontEngine) |
922 return; |
922 return; |
923 |
923 QImage img = renderingFontEngine->alphaMapForGlyph(glyph); |
924 QImage img = renderingFontEngine->alphaMapForGlyph(glyph).convertToFormat(QImage::Format_Indexed8); |
924 if (img.format() != QImage::Format_Indexed8) { |
|
925 bool mono = img.depth() == 1; |
|
926 img = img.convertToFormat(QImage::Format_Indexed8); |
|
927 if (mono) { |
|
928 //### we know that 1 is opaque and 0 is transparent |
|
929 uchar *byte = img.bits(); |
|
930 int count = img.byteCount(); |
|
931 while (count--) |
|
932 *byte++ *= 0xff; |
|
933 } |
|
934 } |
925 glyph_metrics_t metrics = renderingFontEngine->boundingBox(glyph); |
935 glyph_metrics_t metrics = renderingFontEngine->boundingBox(glyph); |
926 renderingFontEngine->removeGlyphFromCache(glyph); |
936 renderingFontEngine->removeGlyphFromCache(glyph); |
927 |
937 |
928 off_t oldSize = ::lseek(fd, 0, SEEK_END); |
938 off_t oldSize = ::lseek(fd, 0, SEEK_END); |
929 if (oldSize == (off_t)-1) |
939 if (oldSize == (off_t)-1) |