15 #include <mix/trans.h>
27 #define ZLF_XFONTS_MAP_FILENAME "xfonts.list"
30 #define ZLF_XFENC_MAP_FILENAME "xfenc.list"
33 #define ZLF_XFONTS_MAX_LINE_WIDTH 1024
36 #define ZLF_XFENC_MAX_LINE_WIDTH 1024
44 #define ZLF_LANG (1<<0)
45 #define ZLF_METRIC (1<<1)
46 #define ZLF_SIZE (1<<2)
47 #define ZLF_STYLE (1<<3)
51 #define ZLF_SEPARATOR ':'
54 #define ZLF_NAME_MAX_LEN (2+1+7+1+3+1+6+1)
62 typedef unsigned long ZFontId;
107 #define ZFontIdGetSize(ID) ((ZFontStyleKind)(((ID)>>0)&0x7f))
108 #define ZFontIdGetLang(ID) ((ZFontLangKind)(((ID)>>7)&0x1f))
109 #define ZFontIdGetMetric(ID) ((ZFontMetricKind)(((ID)>>12)&0x01))
110 #define ZFontIdGetStyle(ID) (((ID)>>13)&0x03)
113 #define ZFontIdSetSize(ID,SI) ((ID)|((((unsigned)(SI))&0x7f)<<0))
114 #define ZFontIdSetLang(ID,LA) ((ID)|((((unsigned)(LA))&0x1f)<<7))
115 #define ZFontIdSetMetric(ID,ME) ((ID)|((((unsigned)(ME))&0x01)<<12))
116 #define ZFontIdSetStyle(ID,ST) ((ID)|((((unsigned)(ST))&0x03)<<13))
119 #define ZFontBuildId(LA,ME,ST,SI) (((((unsigned)(SI))&0x7f)<<0)|\
120 ((((unsigned)(LA))&0x1f)<<7)|\
121 ((((unsigned)(ME))&0x01)<<12)|\
122 ((((unsigned)(ST))&0x03)<<13))
125 #define ZFontDefaultId (ZFontBuildId(ZFontLangDefault,\
130 #define ZAllFontsMask ((ZFontId)(-1))
136 ZFontLangDefault = 0,
137 ZFontLangEnglish = 1,
138 ZFontLangRussian = 2,
139 ZFontLangChinese = 3,
146 #define ZLF_LANG_ENGLISH WE_LANG_ENGLISH
147 #define ZLF_LANG_RUSSIAN WE_LANG_RUSSIAN
148 #define ZLF_LANG_CHINESE WE_LANG_CHINESE
153 ZFontMetricNonProp = 0,
161 #define ZLF_METRIC_NONPROP "nonprop"
162 #define ZLF_METRIC_PROP "prop"
165 typedef int ZFontSizeType;
171 ZFontStyleNormal = 1,
173 ZFontStyleItalic = 3,
180 #define ZLF_STYLE_NORMAL "normal"
181 #define ZLF_STYLE_BOLD "bold"
182 #define ZLF_STYLE_ITALIC "italic"
194 char* ZBuildFontName (ZFontId zfid);
195 char* ZBuildFontNameHere (ZFontId zfid,
196 char szBuf[ZLF_NAME_MAX_LEN]);
200 ZFontId ZParseFontName (
const char* zfname);
208 void ZFontEncMapInit ();
215 int ZLoadFontEncMap (
const char* szPath);
220 char** ZFontXEncMatched (
const char* szXFont);
223 const char* ZGetXFontNameByLang (ZFontId zfid,
const char* szLang,
224 TextEncoding* eTextEnc);
232 void ZFontMapInit ();
239 int ZLoadFontMap (
const char* szPath);
243 void ZGetFontList (ZFontId zfmask, ZFontId** zflist,
int* zfnum);
253 const char* ZGetXFontName (ZFontId zfid,
int* err_mask);
256 XFontStruct* ZXLoadQueryFont (Display* dpy, ZFontId zfid);