mirror of
https://github.com/libretro/RetroArch
synced 2025-03-01 07:13:35 +00:00
Fix C89_BUILD
This commit is contained in:
parent
55410cf407
commit
c40943374b
@ -249,24 +249,34 @@ static void *font_renderer_ft_init(const char *font_path, float font_size)
|
|||||||
/* if fallback font is requested, instead of loading it, we find the full font in the system */
|
/* if fallback font is requested, instead of loading it, we find the full font in the system */
|
||||||
if (!*font_path || strstr(font_path, "fallback"))
|
if (!*font_path || strstr(font_path, "fallback"))
|
||||||
{
|
{
|
||||||
FcConfig* config = FcInitLoadConfigAndFonts();
|
FcValue locale_boxed;
|
||||||
FcResult result = FcResultNoMatch;
|
FcPattern *found = NULL;
|
||||||
FcChar8* font_path = NULL;
|
FcConfig* config = FcInitLoadConfigAndFonts();
|
||||||
int face_index = 0;
|
FcResult result = FcResultNoMatch;
|
||||||
|
FcChar8* font_path = NULL;
|
||||||
|
int face_index = 0;
|
||||||
/* select Sans fonts */
|
/* select Sans fonts */
|
||||||
FcPattern* pattern = FcNameParse((const FcChar8*)"Sans");
|
FcPattern* pattern = FcNameParse((const FcChar8*)"Sans");
|
||||||
/* since fontconfig uses LL-TT style, we need to normalize locale names */
|
/* since fontconfig uses LL-TT style, we need to normalize
|
||||||
FcChar8* locale = FcLangNormalize((const FcChar8*)get_user_language_iso639_1(false));
|
* locale names */
|
||||||
/* box the locale data in a FcValue container */
|
FcChar8* locale = FcLangNormalize((const FcChar8*)get_user_language_iso639_1(false));
|
||||||
FcValue locale_boxed = {.type = FcTypeString, {locale}};
|
/* configure fontconfig substitute policies, this
|
||||||
/* configure fontconfig substitute policies, this will increase the search scope */
|
* will increase the search scope */
|
||||||
FcConfigSubstitute(config, pattern, FcMatchPattern);
|
FcConfigSubstitute(config, pattern, FcMatchPattern);
|
||||||
/* pull in system-wide defaults, so the font selection respects system (or user) configurations */
|
/* pull in system-wide defaults, so the
|
||||||
|
* font selection respects system (or user) configurations */
|
||||||
FcDefaultSubstitute(pattern);
|
FcDefaultSubstitute(pattern);
|
||||||
/* override locale settins, since we are not using the system locale */
|
|
||||||
|
/* Box the locale data in a FcValue container */
|
||||||
|
locale_boxed.type = FcTypeString;
|
||||||
|
locale_boxed.u.s = locale;
|
||||||
|
|
||||||
|
/* Override locale settins, since we are not using the system locale */
|
||||||
FcPatternAdd(pattern, FC_LANG, locale_boxed, false);
|
FcPatternAdd(pattern, FC_LANG, locale_boxed, false);
|
||||||
/* let's find the best matching font given our search criteria */
|
|
||||||
FcPattern* found = FcFontMatch(config, pattern, &result);
|
/* Let's find the best matching font given our search criteria */
|
||||||
|
found = FcFontMatch(config, pattern, &result);
|
||||||
|
|
||||||
/* uh-oh, for some reason, we can't find any font */
|
/* uh-oh, for some reason, we can't find any font */
|
||||||
if (result != FcResultMatch)
|
if (result != FcResultMatch)
|
||||||
goto error;
|
goto error;
|
||||||
@ -274,14 +284,18 @@ static void *font_renderer_ft_init(const char *font_path, float font_size)
|
|||||||
goto error;
|
goto error;
|
||||||
if (FcPatternGetInteger(found, FC_INDEX, 0, &face_index) != FcResultMatch)
|
if (FcPatternGetInteger(found, FC_INDEX, 0, &face_index) != FcResultMatch)
|
||||||
goto error;
|
goto error;
|
||||||
/* initialize font renderer */
|
|
||||||
err = FT_New_Face(handle->lib, (const char*)font_path, face_index, &handle->face);
|
/* Initialize font renderer */
|
||||||
|
err = FT_New_Face(handle->lib, (const char*)font_path,
|
||||||
|
face_index, &handle->face);
|
||||||
|
|
||||||
/* free up fontconfig internal structures */
|
/* free up fontconfig internal structures */
|
||||||
FcPatternDestroy(pattern);
|
FcPatternDestroy(pattern);
|
||||||
FcPatternDestroy(found);
|
FcPatternDestroy(found);
|
||||||
FcStrFree(locale);
|
FcStrFree(locale);
|
||||||
FcConfigDestroy(config);
|
FcConfigDestroy(config);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (!path_is_valid(font_path))
|
if (!path_is_valid(font_path))
|
||||||
|
@ -292,12 +292,14 @@ static int action_get_title_dropdown_item(
|
|||||||
(enum_idx < MENU_ENUM_LABEL_INPUT_PLAYER_ANALOG_DPAD_MODE_LAST))
|
(enum_idx < MENU_ENUM_LABEL_INPUT_PLAYER_ANALOG_DPAD_MODE_LAST))
|
||||||
enum_idx = MENU_ENUM_LABEL_VALUE_INPUT_ADC_TYPE;
|
enum_idx = MENU_ENUM_LABEL_VALUE_INPUT_ADC_TYPE;
|
||||||
|
|
||||||
const char *title = msg_hash_to_str(enum_idx);
|
|
||||||
|
|
||||||
if (s && !string_is_empty(title))
|
|
||||||
{
|
{
|
||||||
SANITIZE_TO_STRING(s, title, len);
|
const char *title = msg_hash_to_str(enum_idx);
|
||||||
return 1;
|
|
||||||
|
if (s && !string_is_empty(title))
|
||||||
|
{
|
||||||
|
SANITIZE_TO_STRING(s, title, len);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user