mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
IDEA-151619 CLion EAP fails to start with missing symbol: FT_Library_setLcdFilter
Skip FT_Library_setLcdFilter call if the symbol is not there
Cache negative FT_Library_setLcdFilter symbol lookup result
Used RTLD_DEFAULT handler for process symbols lookup
(cherry picked from commit e6f0055704)
This commit is contained in:
@@ -159,6 +159,7 @@ typedef FcPattern* (*FcFontMatchPtrType) (FcConfig *config, FcPattern *p, FcResu
|
||||
typedef void (*FcPatternDestroyPtrType) (FcPattern *p);
|
||||
typedef FcResult (*FcPatternGetBoolPtrType) (const FcPattern *p, const char *object, int n, FcBool *b);
|
||||
typedef FcResult (*FcPatternGetIntegerPtrType) (const FcPattern *p, const char *object, int n, int *i);
|
||||
typedef FT_Error (*FtLibrarySetLcdFilterPtrType) (FT_Library library, FT_LcdFilter filter);
|
||||
#endif
|
||||
|
||||
static void *libFontConfig = NULL;
|
||||
@@ -245,6 +246,28 @@ Java_sun_font_FreetypeFontScaler_initIDs(
|
||||
#endif
|
||||
}
|
||||
|
||||
static FT_Error FT_Library_SetLcdFilter_Proxy(FT_Library library, FT_LcdFilter filter) {
|
||||
#ifndef DISABLE_FONTCONFIG
|
||||
static FtLibrarySetLcdFilterPtrType FtLibrarySetLcdFilterPtr = NULL;
|
||||
static int ftLibrarySetLcdFilterNotChecked = 1;
|
||||
if (ftLibrarySetLcdFilterNotChecked) {
|
||||
if (logFC) fprintf(stderr, "FC_LOG: Lookup FT_Library_SetLcdFilter: ");
|
||||
FtLibrarySetLcdFilterPtr = (FtLibrarySetLcdFilterPtrType) dlsym(RTLD_DEFAULT, "FT_Library_SetLcdFilter");
|
||||
if (logFC) fprintf(stderr, (FtLibrarySetLcdFilterPtr)? "found\n" : "not found\n");
|
||||
ftLibrarySetLcdFilterNotChecked = 0;
|
||||
}
|
||||
if (FtLibrarySetLcdFilterPtr) {
|
||||
return (*FtLibrarySetLcdFilterPtr)(library, filter);
|
||||
} else {
|
||||
if (logFC) fprintf(stderr, "FC_LOG: Skipping FT_Library_SetLcdFilter\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
#else
|
||||
return FT_Library_SetLcdFilter(library, filter);
|
||||
#endif
|
||||
}
|
||||
|
||||
static char* getPhysFontName(JNIEnv *env, jobject font2d) {
|
||||
jstring jstr;
|
||||
jstr = (*env)->GetObjectField(env, font2d, platNameFID);
|
||||
@@ -1389,7 +1412,7 @@ static jlong
|
||||
|
||||
ftglyph = scalerInfo->face->glyph;
|
||||
library = ftglyph->library;
|
||||
FT_Library_SetLcdFilter (library, context->lcdFilter);
|
||||
FT_Library_SetLcdFilter_Proxy(library, context->lcdFilter);
|
||||
|
||||
/* apply styles */
|
||||
if (context->doBold) { /* if bold style */
|
||||
|
||||
Reference in New Issue
Block a user