comparison src/objects-x.c @ 3360:316fddbf58e2

[xemacs-hg @ 2006-04-25 14:01:52 by stephent] Repair broken commit to Xft code. <87aca9n4in.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Tue, 25 Apr 2006 14:02:09 +0000
parents 15fb91e3a115
children 77b0b03fbc47
comparison
equal deleted inserted replaced
3359:af8dab703edc 3360:316fddbf58e2
253 #define PRINT_XFT_PATTERN(level,format,pattern) \ 253 #define PRINT_XFT_PATTERN(level,format,pattern) \
254 do { \ 254 do { \
255 DECLARE_EISTRING (eistrpxft_name); \ 255 DECLARE_EISTRING (eistrpxft_name); \
256 FcChar8 *name = FcNameUnparse (pattern); \ 256 FcChar8 *name = FcNameUnparse (pattern); \
257 \ 257 \
258 eicpy_ext(eistrpxft_name, name, Qxft_font_name_encoding); \ 258 eicpy_ext(eistrpxft_name, name, Qfc_font_name_encoding); \
259 DEBUG_XFT1 (level, format, eidata(eistrpxft_name)); \ 259 DEBUG_XFT1 (level, format, eidata(eistrpxft_name)); \
260 free (name); \ 260 free (name); \
261 } while (0) 261 } while (0)
262 262
263 /* print a progress message 263 /* print a progress message
265 FONT is the Xft font name in UTF-8 (the native encoding of Xft) 265 FONT is the Xft font name in UTF-8 (the native encoding of Xft)
266 LANG is the language being checked for support (must be ASCII). */ 266 LANG is the language being checked for support (must be ASCII). */
267 #define CHECKING_LANG(level,font,lang) \ 267 #define CHECKING_LANG(level,font,lang) \
268 do { \ 268 do { \
269 DECLARE_EISTRING (eistrcl_name); \ 269 DECLARE_EISTRING (eistrcl_name); \
270 eicpy_ext(eistrcl_name, font, Qxft_font_name_encoding); \ 270 eicpy_ext(eistrcl_name, font, Qfc_font_name_encoding); \
271 DEBUG_XFT2 (level, "checking if %s handles %s\n", \ 271 DEBUG_XFT2 (level, "checking if %s handles %s\n", \
272 eidata(eistrcl_name), lang); \ 272 eidata(eistrcl_name), lang); \
273 } while (0) 273 } while (0)
274 274
275 #endif /* USE_XFT */ 275 #endif /* USE_XFT */
293 /* #### serialize (optimize) these later... */ 293 /* #### serialize (optimize) these later... */
294 /* #### This function really needs to go away. 294 /* #### This function really needs to go away.
295 The problem is that the fontconfig/Xft functions work much too hard 295 The problem is that the fontconfig/Xft functions work much too hard
296 to ensure that something is returned; but that something need not be 296 to ensure that something is returned; but that something need not be
297 at all close to what we asked for. */ 297 at all close to what we asked for. */
298 LISP_STRING_TO_EXTERNAL (f->name, extname, Qxft_font_name_encoding); 298 LISP_STRING_TO_EXTERNAL (f->name, extname, Qfc_font_name_encoding);
299 rf = xft_open_font_by_name (dpy, extname); 299 rf = xft_open_font_by_name (dpy, extname);
300 #endif 300 #endif
301 LISP_STRING_TO_EXTERNAL (f->name, extname, Qx_font_name_encoding); 301 LISP_STRING_TO_EXTERNAL (f->name, extname, Qx_font_name_encoding);
302 fs = XLoadQueryFont (dpy, extname); 302 fs = XLoadQueryFont (dpy, extname);
303 303
806 /* The font is already open, we just unparse. */ 806 /* The font is already open, we just unparse. */
807 FcChar8 *res = FcNameUnparse (FONT_INSTANCE_X_XFTFONT (f)->pattern); 807 FcChar8 *res = FcNameUnparse (FONT_INSTANCE_X_XFTFONT (f)->pattern);
808 if (res) 808 if (res)
809 { 809 {
810 FONT_INSTANCE_TRUENAME (f) = 810 FONT_INSTANCE_TRUENAME (f) =
811 build_ext_string (res, Qxft_font_name_encoding); 811 build_ext_string (res, Qfc_font_name_encoding);
812 free (res); 812 free (res);
813 return FONT_INSTANCE_TRUENAME (f); 813 return FONT_INSTANCE_TRUENAME (f);
814 } 814 }
815 else 815 else
816 { 816 {
1216 FcCharSet *fccs = NULL; 1216 FcCharSet *fccs = NULL;
1217 DECLARE_EISTRING (eistr_shortname); /* user-friendly nickname */ 1217 DECLARE_EISTRING (eistr_shortname); /* user-friendly nickname */
1218 DECLARE_EISTRING (eistr_longname); /* omit FC_LANG and FC_CHARSET */ 1218 DECLARE_EISTRING (eistr_longname); /* omit FC_LANG and FC_CHARSET */
1219 DECLARE_EISTRING (eistr_fullname); /* everything */ 1219 DECLARE_EISTRING (eistr_fullname); /* everything */
1220 1220
1221 LISP_STRING_TO_EXTERNAL (font, patternext, Qxft_font_name_encoding); 1221 LISP_STRING_TO_EXTERNAL (font, patternext, Qfc_font_name_encoding);
1222 fcc = FcConfigGetCurrent (); 1222 fcc = FcConfigGetCurrent ();
1223 1223
1224 /* parse the name, do the substitutions, and match the font */ 1224 /* parse the name, do the substitutions, and match the font */
1225 1225
1226 { 1226 {
1249 FcPattern *p = FcFontRenderPrepare (fcc, fontxft, fontxft); 1249 FcPattern *p = FcFontRenderPrepare (fcc, fontxft, fontxft);
1250 FcChar8 *name; 1250 FcChar8 *name;
1251 1251
1252 /* full name, including language coverage and repertoire */ 1252 /* full name, including language coverage and repertoire */
1253 name = FcNameUnparse (p); 1253 name = FcNameUnparse (p);
1254 eicpy_ext (eistr_fullname, name, Qxft_font_name_encoding); 1254 eicpy_ext (eistr_fullname, name, Qfc_font_name_encoding);
1255 free (name); 1255 free (name);
1256 1256
1257 /* long name, omitting coverage and repertoire, plus a number 1257 /* long name, omitting coverage and repertoire, plus a number
1258 of rarely useful properties */ 1258 of rarely useful properties */
1259 FcPatternDel (p, FC_CHARSET); 1259 FcPatternDel (p, FC_CHARSET);
1266 FcPatternDel (p, FC_GLOBAL_ADVANCE); 1266 FcPatternDel (p, FC_GLOBAL_ADVANCE);
1267 FcPatternDel (p, FC_INDEX); 1267 FcPatternDel (p, FC_INDEX);
1268 FcPatternDel (p, FC_SCALE); 1268 FcPatternDel (p, FC_SCALE);
1269 FcPatternDel (p, FC_FONTVERSION); 1269 FcPatternDel (p, FC_FONTVERSION);
1270 name = FcNameUnparse (p); 1270 name = FcNameUnparse (p);
1271 eicpy_ext (eistr_longname, name, Qxft_font_name_encoding); 1271 eicpy_ext (eistr_longname, name, Qfc_font_name_encoding);
1272 free (name); 1272 free (name);
1273 1273
1274 /* nickname, just family and size, but 1274 /* nickname, just family and size, but
1275 "family" names usually have style, slant, and weight */ 1275 "family" names usually have style, slant, and weight */
1276 FcPatternDel (p, FC_FOUNDRY); 1276 FcPatternDel (p, FC_FOUNDRY);
1280 FcPatternDel (p, FC_PIXEL_SIZE); 1280 FcPatternDel (p, FC_PIXEL_SIZE);
1281 FcPatternDel (p, FC_OUTLINE); 1281 FcPatternDel (p, FC_OUTLINE);
1282 FcPatternDel (p, FC_SCALABLE); 1282 FcPatternDel (p, FC_SCALABLE);
1283 FcPatternDel (p, FC_DPI); 1283 FcPatternDel (p, FC_DPI);
1284 name = FcNameUnparse (p); 1284 name = FcNameUnparse (p);
1285 eicpy_ext (eistr_shortname, name, Qxft_font_name_encoding); 1285 eicpy_ext (eistr_shortname, name, Qfc_font_name_encoding);
1286 free (name); 1286 free (name);
1287 1287
1288 FcPatternDestroy (p); 1288 FcPatternDestroy (p);
1289 } 1289 }
1290 1290