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_autohinting = {CVAR_SAVE, "r_font_autohinting", "1", "enable autohinting if possible"};
/*
================================================================================
Cvar_RegisterVariable(&r_font_disable_freetype);
Cvar_RegisterVariable(&r_font_use_alpha_textures);
Cvar_RegisterVariable(&r_font_size_snapping);
+ Cvar_RegisterVariable(&r_font_autohinting);
}
/*
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 = 0;
+ if (r_font_autohinting.integer == 0)
+ load_flags = FT_LOAD_NO_AUTOHINT;
+ if (r_font_autohinting.integer <= -1)
+ load_flags |= FT_LOAD_NO_HINTING;
+ if (r_font_autohinting.integer <= -2)
+ load_flags |= FT_LOAD_NO_AUTOHINT;
+
//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);