Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Fix Emoji bitmap loading by fixing FreeType loadflag order.

Wolthera van Hövell tot Westerflierf63e9d49b899
diff --git a/libs/flake/text/KoFontRegistry.cpp b/libs/flake/text/KoFontRegistry.cpp
index b5a15c8a20..44c099c323 100644
--- a/libs/flake/text/KoFontRegistry.cpp
+++ b/libs/flake/text/KoFontRegistry.cpp
@@ -1081,16 +1081,6 @@ KoSvgText::FontMetrics KoFontRegistry::generateFontMetrics(FT_FaceSP face, bool
int32_t KoFontRegistry::loadFlagsForFace(FT_Face face, bool isHorizontal, int32_t loadFlags, const KoSvgText::TextRendering rendering)
{
FT_Int32 faceLoadFlags = loadFlags;
- if (FT_HAS_COLOR(face)) {
- faceLoadFlags |= FT_LOAD_COLOR;
- }
- if (!isHorizontal && FT_HAS_VERTICAL(face)) {
- faceLoadFlags |= FT_LOAD_VERTICAL_LAYOUT;
- }
- if (!FT_IS_SCALABLE(face)) {
- // This is needed for the CBDT version of Noto Color Emoji
- faceLoadFlags &= ~FT_LOAD_NO_BITMAP;
- }
if (rendering == KoSvgText::RenderingGeometricPrecision || rendering == KoSvgText::RenderingAuto) {
// without load_no_hinting, the advance and offset will be rounded
@@ -1113,6 +1103,16 @@ int32_t KoFontRegistry::loadFlagsForFace(FT_Face face, bool isHorizontal, int32_
faceLoadFlags |= FT_LOAD_TARGET_LIGHT;
}
}
+ if (FT_HAS_COLOR(face)) {
+ faceLoadFlags |= FT_LOAD_COLOR;
+ }
+ if (!isHorizontal && FT_HAS_VERTICAL(face)) {
+ faceLoadFlags |= FT_LOAD_VERTICAL_LAYOUT;
+ }
+ if (!FT_IS_SCALABLE(face)) {
+ // This is needed for the CBDT version of Noto Color Emoji
+ faceLoadFlags &= ~FT_LOAD_NO_BITMAP;
+ }
return faceLoadFlags;
}