[Change] Added more control over fonts.
This commit is contained in:
parent
69d3fb1825
commit
bca14a3ab9
12
src/font.c
12
src/font.c
@ -540,14 +540,16 @@ void gl_fontInit(glFont* font, const char* fname, const unsigned int h) {
|
|||||||
if(FT_New_Memory_Face(library, buf, bufsize, 0, &face))
|
if(FT_New_Memory_Face(library, buf, bufsize, 0, &face))
|
||||||
WARN("FT_New_Memory_Face failed loading library from %s", fname);
|
WARN("FT_New_Memory_Face failed loading library from %s", fname);
|
||||||
|
|
||||||
/* FreeType is pretty nice and measures using 1/64 of a pixel, therfore expand. */
|
/* Try to resize. */
|
||||||
if(FT_IS_SCALABLE(face))
|
if(FT_IS_SCALABLE(face)) {
|
||||||
if(FT_Set_Char_Size(face,
|
if(FT_Set_Char_Size(face,
|
||||||
0, /* Same as width. */
|
0, /* Same as width. */
|
||||||
h << 6, /* In 1/64th of a pixel. */
|
h << 6, /* In 1/64th of a pixel. */
|
||||||
96,
|
96, /* Create at 96 DPI. */
|
||||||
96))
|
96)) /* Create at 96 DPI. */
|
||||||
WARN("FT_Set_Char_Size failed.");
|
WARN("FT_Set_Char_Size failed.");
|
||||||
|
} else
|
||||||
|
WARN("Font isn't resizable!");
|
||||||
|
|
||||||
/* Selected the character map. */
|
/* Selected the character map. */
|
||||||
if(FT_Select_Charmap(face, FT_ENCODING_UNICODE))
|
if(FT_Select_Charmap(face, FT_ENCODING_UNICODE))
|
||||||
|
Loading…
Reference in New Issue
Block a user