comparison src/font-mgr.h @ 3666:3214dca89755

[xemacs-hg @ 2006-11-07 15:58:21 by stephent] Revert inadvertant commits to unicode.el, font-mgr.h, and lread.c.
author stephent
date Tue, 07 Nov 2006 15:58:24 +0000
parents 5724b7632db3
children fd1f0c73d4df
comparison
equal deleted inserted replaced
3665:5724b7632db3 3666:3214dca89755
66 #define FCPATTERNP(x) RECORDP (x, fc_pattern) 66 #define FCPATTERNP(x) RECORDP (x, fc_pattern)
67 #define CHECK_FCPATTERN(x) CHECK_RECORD (x, fc_pattern) 67 #define CHECK_FCPATTERN(x) CHECK_RECORD (x, fc_pattern)
68 #define CONCHECK_FCPATTERN(x) CONCHECK_RECORD (x, fc_pattern) 68 #define CONCHECK_FCPATTERN(x) CONCHECK_RECORD (x, fc_pattern)
69 #define XFCPATTERN_PTR(x) (XFCPATTERN(x)->fcpatPtr) 69 #define XFCPATTERN_PTR(x) (XFCPATTERN(x)->fcpatPtr)
70 70
71 #ifdef USE_XFT
72 /*
73 The format of a fontname (as returned by fontconfig) is not well-documented,
74 But the character repertoire is represented in an ASCII-compatible way. See
75 fccharset.c (FcCharSetUnparse). So we can use UTF-8 for long names.
76
77 Currently we have a hack where different versions of the unparsed name are
78 used in different contexts fairly arbitrarily. I don't think this is close
79 to coherency; even without the charset and lang properties fontconfig names
80 are too unwieldy to use. We need to rethink the approach here. I think
81 probably Lisp_Font_Instance.name should contain the font name as specified
82 to Lisp (almost surely much shorter than shortname, even, and most likely
83 wildcarded), while Lisp_Font_Instance.truename should contain the longname.
84 For now, I'm going to #ifdef the return values defaulting to short. -- sjt
85 */
86
87 /* DEBUGGING STUFF */
88
89 /* print message to stderr: one internal-format string argument */
90 #define DEBUG_XFT0(level,s) \
91 if (debug_xft > level) stderr_out (s)
92
93 /* print message to stderr: one formatted argument */
94 #define DEBUG_XFT1(level,format,x1) \
95 if (debug_xft > level) stderr_out (format, x1)
96
97 /* print message to stderr: two formatted arguments */
98 #define DEBUG_XFT2(level,format,x1,x2) \
99 if (debug_xft > level) stderr_out (format, x1, x2)
100
101 /* print message to stderr: three formatted arguments */
102 #define DEBUG_XFT3(level,format,x1,x2,x3) \
103 if (debug_xft > level) stderr_out (format, x1, x2, x3)
104
105 /* print message to stderr: four formatted arguments */
106 #define DEBUG_XFT4(level,format,x1,x2,x3,x4) \
107 if (debug_xft > level) stderr_out (format, x1, x2, x3, x4)
108
109 /* print an Xft pattern to stderr
110 LEVEL is the debug level (to compare to debug_xft)
111 FORMAT is a newline-terminated printf format with one %s for the pattern
112 and must be internal format (eg, pure ASCII)
113 PATTERN is an FcPattern *. */
114 #define PRINT_XFT_PATTERN(level,format,pattern) \
115 do { \
116 DECLARE_EISTRING (eistrpxft_name); \
117 FcChar8 *name = FcNameUnparse (pattern); \
118 \
119 eicpy_ext(eistrpxft_name, name, Qfc_font_name_encoding); \
120 DEBUG_XFT1 (level, format, eidata(eistrpxft_name)); \
121 free (name); \
122 } while (0)
123
124 /* print a progress message
125 LEVEL is the debug level (to compare to debug_xft)
126 FONT is the Xft font name in UTF-8 (the native encoding of Xft)
127 LANG is the language being checked for support (must be ASCII). */
128 #define CHECKING_LANG(level,font,lang) \
129 do { \
130 DECLARE_EISTRING (eistrcl_name); \
131 eicpy_ext(eistrcl_name, font, Qfc_font_name_encoding); \
132 DEBUG_XFT2 (level, "checking if %s handles %s\n", \
133 eidata(eistrcl_name), lang); \
134 } while (0)
135
136 #else /* USE_XFT */
137
138 #endif /* USE_XFT */
139
71 #endif /* INCLUDED_font_mgr_h_ */ 140 #endif /* INCLUDED_font_mgr_h_ */