X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=ft2.h;h=2104a8c4fd9f6620afeb7fb231d77fad5a075663;hp=78728c2dfd18778a164728f400578c32d1275693;hb=6ff5802848663ece807c1a425da91d7630a8a036;hpb=179be6fd1f715bac570e73aa9cadb0e08d0f7979 diff --git a/ft2.h b/ft2.h index 78728c2d..2104a8c4 100644 --- a/ft2.h +++ b/ft2.h @@ -22,7 +22,11 @@ typedef struct ft2_font_map_s ft2_font_map_t; typedef struct ft2_attachment_s ft2_attachment_t; +#ifdef WIN64 +#define ft2_oldstyle_map ((ft2_font_map_t*)-1LL) +#else #define ft2_oldstyle_map ((ft2_font_map_t*)-1) +#endif typedef float ft2_kernvec[2]; typedef struct ft2_kerning_s @@ -33,17 +37,17 @@ typedef struct ft2_kerning_s typedef struct ft2_font_s { char name[64]; - qboolean has_kerning; + qbool has_kerning; // last requested size loaded using Font_SetSize float currentw; float currenth; float ascend; float descend; - qboolean image_font; // only fallbacks are freetype fonts + qbool image_font; // only fallbacks are freetype fonts // TODO: clean this up and do not expose everything. - unsigned char *data; // TODO: See if FT2 actually needs it to stay... probably does + const unsigned char *data; // FT2 needs it to stay //fs_offset_t datasize; void *face; @@ -63,7 +67,7 @@ typedef struct ft2_font_s void Font_CloseLibrary(void); void Font_Init(void); -qboolean Font_OpenLibrary(void); +qbool Font_OpenLibrary(void); ft2_font_t* Font_Alloc(void); void Font_UnloadFont(ft2_font_t *font); // IndexForSize suggests to change the width and height if a font size is in a reasonable range @@ -71,9 +75,9 @@ void Font_UnloadFont(ft2_font_t *font); // in such a case, *outw and *outh are set to 12, which is often a good alternative size int Font_IndexForSize(ft2_font_t *font, float size, float *outw, float *outh); ft2_font_map_t *Font_MapForIndex(ft2_font_t *font, int index); -qboolean Font_LoadFont(const char *name, dp_font_t *dpfnt); -qboolean Font_GetKerningForSize(ft2_font_t *font, float w, float h, Uchar left, Uchar right, float *outx, float *outy); -qboolean Font_GetKerningForMap(ft2_font_t *font, int map_index, float w, float h, Uchar left, Uchar right, float *outx, float *outy); +qbool Font_LoadFont(const char *name, dp_font_t *dpfnt); +qbool Font_GetKerningForSize(ft2_font_t *font, float w, float h, Uchar left, Uchar right, float *outx, float *outy); +qbool Font_GetKerningForMap(ft2_font_t *font, int map_index, float w, float h, Uchar left, Uchar right, float *outx, float *outy); float Font_VirtualToRealSize(float sz); float Font_SnapTo(float val, float snapwidth); // since this is used on a font_map_t, let's name it FontMap_*