cvar_t r_font_disable_freetype = {CVAR_SAVE, "r_font_disable_freetype", "1", "disable freetype support for fonts entirely"};
cvar_t r_font_use_alpha_textures = {CVAR_SAVE, "r_font_use_alpha_textures", "0", "use alpha-textures for font rendering, this should safe memory"};
cvar_t r_font_size_snapping = {CVAR_SAVE, "r_font_size_snapping", "1", "stick to good looking font sizes whenever possible - bad when the mod doesn't support it!"};
+cvar_t r_font_hinting = {CVAR_SAVE, "r_font_hinting", "2", "0 = no hinting, 1 = force autohinting, 2 = full hinting"};
/*
================================================================================
Cvar_RegisterVariable(&r_font_disable_freetype);
Cvar_RegisterVariable(&r_font_use_alpha_textures);
Cvar_RegisterVariable(&r_font_size_snapping);
+ Cvar_RegisterVariable(&r_font_hinting);
}
/*
FT_ULong ch, mapch;
int status;
int tp;
+ FT_Int32 load_flags;
int pitch;
int gR, gC; // glyph position: row and column
else
fontface = (FT_Face)font->face;
+ load_flags = FT_LOAD_NO_HINTING | FT_LOAD_NO_AUTOHINT;
+ if (r_font_hinting.integer == 1)
+ load_flags = FT_LOAD_FORCE_AUTOHINT;
+ else if (r_font_hinting.integer == 2)
+ load_flags = 0;
+
//status = qFT_Set_Pixel_Sizes((FT_Face)font->face, /*size*/0, mapstart->size);
//if (status)
if (font->image_font && mapstart->intSize < 0)
glyphIndex = qFT_Get_Char_Index(face, ch);
if (glyphIndex == 0)
continue;
- status = qFT_Load_Glyph(face, glyphIndex, FT_LOAD_RENDER);
+ status = qFT_Load_Glyph(face, glyphIndex, FT_LOAD_RENDER | load_flags);
if (status)
continue;
break;
{
usefont = font;
face = font->face;
- status = qFT_Load_Glyph(face, glyphIndex, FT_LOAD_RENDER);
+ status = qFT_Load_Glyph(face, glyphIndex, FT_LOAD_RENDER | load_flags);
if (status)
{
//Con_Printf("failed to load glyph %lu for %s\n", glyphIndex, font->name);