JBR-4363 Changes in fonts rendering between JBR11 and JBR17

Resolved merge artifact after applying IDEA-57233 fix
This commit is contained in:
Alexey Ushakov
2022-04-08 16:09:09 +02:00
committed by alexey.ushakov@jetbrains.com
parent 834c750ed2
commit d1f642fe7a

View File

@@ -1643,7 +1643,6 @@ static jlong
int error, imageSize;
UInt16 width, height, rowBytes;
GlyphInfo *glyphInfo;
int target;
FT_GlyphSlot ftglyph;
FT_Library library;
@@ -1720,21 +1719,7 @@ static jlong
and apply it explicitly after hinting is performed.
Or we can disable hinting. */
/* select appropriate hinting mode */
if (context->aaType == TEXT_AA_ON || context->colorFont) {
target = FT_LOAD_TARGET_NORMAL;
} else if (context->aaType == TEXT_AA_OFF) {
target = FT_LOAD_TARGET_MONO;
} else if (context->aaType == TEXT_AA_LCD_HRGB ||
context->aaType == TEXT_AA_LCD_HBGR) {
target = FT_LOAD_TARGET_LCD;
} else {
target = FT_LOAD_TARGET_LCD_V;
}
context->loadFlags |= target;
error = FT_Load_Glyph(scalerInfo->face, glyphCode, context->loadFlags);
if (error) {
if (FT_Load_Glyph(scalerInfo->face, glyphCode, context->loadFlags)) {
//do not destroy scaler yet.
//this can be problem of particular context (e.g. with bad transform)
return ptr_to_jlong(getNullGlyphImage());
@@ -2078,6 +2063,7 @@ Java_sun_font_FreetypeFontScaler_getGlyphCodeNative(
static FT_Outline* getFTOutline(JNIEnv* env, jobject font2D,
FTScalerContext *context, FTScalerInfo* scalerInfo,
jint glyphCode, jfloat xpos, jfloat ypos) {
FT_Error error;
FT_GlyphSlot ftglyph;
FT_Int32 loadFlags;
@@ -2093,7 +2079,7 @@ static FT_Outline* getFTOutline(JNIEnv* env, jobject font2D,
}
// We cannot get an outline from bitmap version of glyph
loadFlags = FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP;
loadFlags = context->loadFlags | FT_LOAD_NO_BITMAP;
error = FT_Load_Glyph(scalerInfo->face, glyphCode, loadFlags);
if (error) {