comparison src/font-mgr.c @ 5922:4b055de36bb9 cygwin

merging heads 2
author Henry Thompson <ht@markup.co.uk>
date Fri, 27 Feb 2015 17:47:15 +0000
parents 5f02d29a2a65
children
comparison
equal deleted inserted replaced
5921:68639fb08af8 5922:4b055de36bb9
253 253
254 /* #### Ga-a-ack! Xft's similar function is actually a different API. 254 /* #### Ga-a-ack! Xft's similar function is actually a different API.
255 We provide both. */ 255 We provide both. */
256 DEFUN ("fc-name-unparse", Ffc_name_unparse, 1, 1, 0, /* 256 DEFUN ("fc-name-unparse", Ffc_name_unparse, 1, 1, 0, /*
257 Unparse an fc pattern object to a string. 257 Unparse an fc pattern object to a string.
258 To work around a bug in fontconfig (at least 2.11.1), the 'charset' property
259 is removed before passing to FcNameUnparse. To extract the 'charset' property,
260 use `\(fc-pattern-get PATTERN "charset")'.
258 */ 261 */
259 (pattern)) 262 (pattern))
260 { 263 {
261 FcChar8 *name; 264 FcChar8 *name;
262 Lisp_Object result; 265 Lisp_Object result;
266
263 CHECK_FC_PATTERN (pattern); 267 CHECK_FC_PATTERN (pattern);
264 name = FcNameUnparse (XFC_PATTERN_PTR (pattern)); 268 /* #### Could use multiple values here to extract and return charset? */
269 {
270 FcPattern* temp = FcPatternDuplicate (XFC_PATTERN_PTR (pattern));
271 FcPatternDel (temp, FC_CHARSET);
272 name = FcNameUnparse (temp);
273 FcPatternDestroy (temp);
274 }
265 result = build_fcapi_string (name); 275 result = build_fcapi_string (name);
266 xfree (name); 276 xfree (name);
267 return result; 277 return result;
268 } 278 }
269 279
335 return res ? Qt : Qnil; 345 return res ? Qt : Qnil;
336 } 346 }
337 347
338 /* Generic interface to FcPatternGet() 348 /* Generic interface to FcPatternGet()
339 * Don't support the losing symbol-for-property interface. 349 * Don't support the losing symbol-for-property interface.
350 * To support that interface properly, we should have `fc-register-property'
351 * so that only registered symbols could be used. Then it would serve to
352 * provide the same kind of check that the C-level FC_* macros do.
340 */ 353 */
341 DEFUN ("fc-pattern-get", Ffc_pattern_get, 2, 4, 0, /* 354 DEFUN ("fc-pattern-get", Ffc_pattern_get, 2, 4, 0, /*
342 From PATTERN, extract PROPERTY for the ID'th member, of type TYPE. 355 From PATTERN, extract PROPERTY for the ID'th member, of type TYPE.
343 356
344 PATTERN is an Xft (fontconfig) pattern object. 357 PATTERN is an Xft (fontconfig) pattern object.