author | Stefan Vogel <sv@exept.de> |
Tue, 13 Sep 2016 15:06:59 +0200 | |
changeset 7563 | 3555a447b0aa |
parent 7559 | 90328370ce0e |
child 7567 | 7e14edffaf21 |
permissions | -rw-r--r-- |
7488 | 1 |
"{ Encoding: utf8 }" |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
2 |
|
6176 | 3 |
"{ Package: 'stx:libview' }" |
4 |
||
6833 | 5 |
"{ NameSpace: Smalltalk }" |
6 |
||
6176 | 7 |
FontDescription subclass:#XftFontDescription |
7342 | 8 |
instanceVariableNames:'device fontId sharedDrawId minCode maxCode ascent descent height |
9 |
fixedWidth' |
|
6184
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
10 |
classVariableNames:'FC_FAMILY FC_STYLE FC_SLANT FC_WEIGHT FC_SIZE FC_ASPECT |
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
11 |
FC_PIXEL_SIZE FC_SPACING FC_FOUNDRY FC_ANTIALIAS FC_HINTING |
6187
cfe33a9940ee
Memory/performance optimization - use stack-allocated XftColor.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6186
diff
changeset
|
12 |
FC_HINT_STYLE FC_VERTICAL_LAYOUT FC_AUTOHINT FC_WIDTH FC_FILE |
cfe33a9940ee
Memory/performance optimization - use stack-allocated XftColor.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6186
diff
changeset
|
13 |
FC_INDEX FC_FT_FACE FC_RASTERIZER FC_OUTLINE FC_SCALABLE FC_SCALE |
cfe33a9940ee
Memory/performance optimization - use stack-allocated XftColor.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6186
diff
changeset
|
14 |
FC_DPI FC_RGBA FC_MINSPACE FC_SOURCE FC_CHARSET FC_LANG |
cfe33a9940ee
Memory/performance optimization - use stack-allocated XftColor.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6186
diff
changeset
|
15 |
FC_FONTVERSION FC_FULLNAME FC_FAMILYLANG FC_STYLELANG |
cfe33a9940ee
Memory/performance optimization - use stack-allocated XftColor.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6186
diff
changeset
|
16 |
FC_FULLNAMELANG FC_CAPABILITY FC_FONTFORMAT FC_EMBOLDEN |
cfe33a9940ee
Memory/performance optimization - use stack-allocated XftColor.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6186
diff
changeset
|
17 |
FC_EMBEDDED_BITMAP FC_DECORATIVE FC_LCD_FILTER FC_NAMELANG |
6184
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
18 |
FC_CHAR_WIDTH FC_CHAR_HEIGHT FC_MATRIX FC_WEIGHT_THIN |
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
19 |
FC_WEIGHT_EXTRALIGHT FC_WEIGHT_ULTRALIGHT FC_WEIGHT_LIGHT |
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
20 |
FC_WEIGHT_BOOK FC_WEIGHT_REGULAR FC_WEIGHT_NORMAL |
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
21 |
FC_WEIGHT_MEDIUM FC_WEIGHT_DEMIBOLD FC_WEIGHT_SEMIBOLD |
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
22 |
FC_WEIGHT_BOLD FC_WEIGHT_EXTRABOLD FC_WEIGHT_ULTRABOLD |
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
23 |
FC_WEIGHT_BLACK FC_WEIGHT_HEAVY FC_WEIGHT_EXTRABLACK |
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
24 |
FC_WEIGHT_ULTRABLACK FC_SLANT_ROMAN FC_SLANT_ITALIC |
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
25 |
FC_SLANT_OBLIQUE FC_WIDTH_ULTRACONDENSED FC_WIDTH_EXTRACONDENSED |
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
26 |
FC_WIDTH_CONDENSED FC_WIDTH_SEMICONDENSED FC_WIDTH_NORMAL |
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
27 |
FC_WIDTH_SEMIEXPANDED FC_WIDTH_EXPANDED FC_WIDTH_EXTRAEXPANDED |
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
28 |
FC_WIDTH_ULTRAEXPANDED FC_PROPORTIONAL FC_DUAL FC_MONO |
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
29 |
FC_CHARCELL FC_RGBA_UNKNOWN FC_RGBA_RGB FC_RGBA_BGR FC_RGBA_VRGB |
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
30 |
FC_RGBA_VBGR FC_RGBA_NONE FC_HINT_NONE FC_HINT_SLIGHT |
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
31 |
FC_HINT_MEDIUM FC_HINT_FULL FC_LCD_NONE FC_LCD_DEFAULT |
6185
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
32 |
FC_LCD_LIGHT FC_LCD_LEGACY StXFace2FCWeightMap |
7526 | 33 |
StXStyle2FCSlantMap CachedFontList RecentlyUsedFonts Lobby |
34 |
FirstTimeCalled' |
|
6176 | 35 |
poolDictionaries:'' |
6185
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
36 |
category:'Graphics-Support' |
6176 | 37 |
! |
38 |
||
6263 | 39 |
Object subclass:#FCFontListParser |
40 |
instanceVariableNames:'pipeStream lineStream currentDescription' |
|
41 |
classVariableNames:'' |
|
42 |
poolDictionaries:'' |
|
43 |
privateIn:XftFontDescription |
|
44 |
! |
|
45 |
||
6188
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
46 |
ExternalAddress subclass:#FCPatternHandle |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
47 |
instanceVariableNames:'' |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
48 |
classVariableNames:'' |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
49 |
poolDictionaries:'' |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
50 |
privateIn:XftFontDescription |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
51 |
! |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
52 |
|
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
53 |
ExternalAddress subclass:#XftDrawHandle |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
54 |
instanceVariableNames:'' |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
55 |
classVariableNames:'' |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
56 |
poolDictionaries:'' |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
57 |
privateIn:XftFontDescription |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
58 |
! |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
59 |
|
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
60 |
ExternalAddress subclass:#XftFontHandle |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
61 |
instanceVariableNames:'' |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
62 |
classVariableNames:'' |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
63 |
poolDictionaries:'' |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
64 |
privateIn:XftFontDescription |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
65 |
! |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
66 |
|
6176 | 67 |
!XftFontDescription primitiveDefinitions! |
68 |
%{ |
|
69 |
/* |
|
70 |
* includes, defines, structure definitions |
|
71 |
* and typedefs come here. |
|
72 |
*/ |
|
73 |
||
74 |
#undef True |
|
75 |
#undef False |
|
6179 | 76 |
#undef Time |
6176 | 77 |
#define Time XTime |
78 |
||
6188
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
79 |
#ifdef XFT |
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
80 |
|
6936 | 81 |
extern OBJ __GLOBAL_GET_BY_NAME(char *); |
6188
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
82 |
|
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
83 |
# define __HANDLE_VAL(type, externalAddress) \ |
7221 | 84 |
((type)__externalAddressVal(externalAddress)) |
6489 | 85 |
|
6936 | 86 |
# define __HANDLE_NEW(ptr, __cls) \ |
7221 | 87 |
({ \ |
88 |
OBJ handle = __MKEXTERNALADDRESS(ptr); \ |
|
89 |
OBJ clsObj = __GLOBAL_GET_BY_NAME(__cls);\ |
|
90 |
__InstPtr(handle)->o_class = clsObj; \ |
|
91 |
__STORE(handle, clsObj); \ |
|
92 |
handle; \ |
|
93 |
}) |
|
6188
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
94 |
|
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
95 |
# define DISPLAY(x) __HANDLE_VAL(Display*, x) |
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
96 |
# define SCREEN(x) ((int)(__intVal(x))) |
6188
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
97 |
# define DRAWABLE(x) __HANDLE_VAL(Drawable, x) |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
98 |
# define GC(x) __HANDLE_VAL(GC, x) |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
99 |
# define VISUAL(x) __HANDLE_VAL(Visual*, x) |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
100 |
# define COLORMAP(x) __HANDLE_VAL(Colormap, x) |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
101 |
|
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
102 |
/* FontConfig objects */ |
6193 | 103 |
# define FC_PATTERN(x) __HANDLE_VAL(XftPattern*, x) |
104 |
# define FC_PATTERN_HANDLE_NEW(x) __HANDLE_NEW(x, "XftFontDescription::FCPatternHandle") |
|
6188
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
105 |
|
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
106 |
/* Xft Objects */ |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
107 |
|
6193 | 108 |
# define XFT_FONT(x) __HANDLE_VAL(XftFont*, x) |
6188
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
109 |
# define XFT_FONT_HANDLE_NEW(x) __HANDLE_NEW(x, "XftFontDescription::XftFontHandle") |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
110 |
|
6193 | 111 |
# define XFT_DRAW(x) __HANDLE_VAL(XftDraw*, x) |
6188
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
112 |
# define XFT_DRAW_HANDLE_NEW(x) __HANDLE_NEW(x, "XftFontDescription::XftDrawHandle") |
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
113 |
|
6176 | 114 |
# include <X11/Xft/Xft.h> |
115 |
#endif |
|
116 |
%} |
|
117 |
! ! |
|
118 |
||
119 |
!XftFontDescription class methodsFor:'documentation'! |
|
120 |
||
121 |
documentation |
|
122 |
" |
|
123 |
WARNING: Unfinished. |
|
124 |
||
125 |
Experimental implementation of custom font rendered using |
|
126 |
Xft library (UNIX / X Window only), To actually use it, |
|
127 |
add following definitions to the end of stx/configurations/myConf |
|
128 |
(works on Ubuntu 12.10) |
|
129 |
||
130 |
--- snip --- |
|
131 |
XDEFS+=-DXFT |
|
132 |
XINCLUDE+=$(shell pkg-config --cflags xft) |
|
133 |
LIB_XFT=-l:libXft.so.2 -l:libfontconfig.so.1 |
|
134 |
--- snip -- |
|
135 |
||
136 |
NOTE: This class should be named XftFont, however then |
|
137 |
there would be a name clash with XftFont structure |
|
138 |
defined in Xft.h - therefore the class is named |
|
139 |
XftFontDescription to avoid that name clash. |
|
140 |
||
141 |
||
142 |
[author:] |
|
6179 | 143 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
6176 | 144 |
|
145 |
[instance variables:] |
|
146 |
||
147 |
[class variables:] |
|
148 |
||
149 |
[see also:] |
|
150 |
||
151 |
" |
|
152 |
! ! |
|
153 |
||
6184
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
154 |
!XftFontDescription class methodsFor:'initialization'! |
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
155 |
|
6327 | 156 |
flushListOfAvailableFonts |
157 |
CachedFontList := nil. |
|
158 |
||
159 |
" |
|
160 |
XftFontDescription flushListOfAvailableFonts |
|
161 |
" |
|
162 |
! |
|
163 |
||
6184
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
164 |
initialize |
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
165 |
"Invoked at system start or when the class is dynamically loaded." |
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
166 |
|
6947 | 167 |
Lobby isNil ifTrue:[ |
7221 | 168 |
Lobby := Registry new. |
6946 | 169 |
]. |
170 |
||
6185
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
171 |
" Taken from fontconfig,h " |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
172 |
|
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
173 |
FC_FAMILY := 'family'. "/* String */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
174 |
FC_STYLE := 'style'. "/* String */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
175 |
FC_SLANT := 'slant'. "/* Int */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
176 |
FC_WEIGHT := 'weight'. "/* Int */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
177 |
FC_SIZE := 'size'. "/* Double */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
178 |
FC_ASPECT := 'aspect'. "/* Double */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
179 |
FC_PIXEL_SIZE := 'pixelsize'. "/* Double */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
180 |
FC_SPACING := 'spacing'. "/* Int */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
181 |
FC_FOUNDRY := 'foundry'. "/* String */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
182 |
FC_ANTIALIAS := 'antialias'. "/* Bool (depends) */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
183 |
FC_HINTING := 'hinting'. "/* Bool (true) */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
184 |
FC_HINT_STYLE := 'hintstyle'. "/* Int */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
185 |
FC_VERTICAL_LAYOUT := 'verticallayout'. "/* Bool (false) */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
186 |
FC_AUTOHINT := 'autohint'. "/* Bool (false) */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
187 |
FC_WIDTH := 'width'. "/* Int */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
188 |
FC_FILE := 'file'. "/* String */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
189 |
FC_INDEX := 'index'. "/* Int */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
190 |
FC_FT_FACE := 'ftface'. "/* FT_Face */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
191 |
FC_RASTERIZER := 'rasterizer'. "/* String */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
192 |
FC_OUTLINE := 'outline'. "/* Bool */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
193 |
FC_SCALABLE := 'scalable'. "/* Bool */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
194 |
FC_SCALE := 'scale'. "/* double */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
195 |
FC_DPI := 'dpi'. "/* double */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
196 |
FC_RGBA := 'rgba'. "/* Int */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
197 |
FC_MINSPACE := 'minspace'. "/* Bool use minimum line spacing */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
198 |
FC_SOURCE := 'source'. "/* String (deprecated) */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
199 |
FC_CHARSET := 'charset'. "/* CharSet */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
200 |
FC_LANG := 'lang'. "/* String RFC 3066 langs */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
201 |
FC_FONTVERSION := 'fontversion'. "/* Int from 'head'.table */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
202 |
FC_FULLNAME := 'fullname'. "/* String */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
203 |
FC_FAMILYLANG := 'familylang'. "/* String RFC 3066 langs */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
204 |
FC_STYLELANG := 'stylelang'. "/* String RFC 3066 langs */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
205 |
FC_FULLNAMELANG := 'fullnamelang'. "/* String RFC 3066 langs */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
206 |
FC_CAPABILITY := 'capability'. "/* String */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
207 |
FC_FONTFORMAT := 'fontformat'. "/* String */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
208 |
FC_EMBOLDEN := 'embolden'. "/* Bool - true if emboldening needed*/ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
209 |
FC_EMBEDDED_BITMAP := 'embeddedbitmap'."/* Bool - true to enable embedded bitmaps */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
210 |
FC_DECORATIVE := 'decorative'. "/* Bool - true if style is a decorative variant */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
211 |
FC_LCD_FILTER := 'lcdfilter'. "/* Int */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
212 |
FC_NAMELANG := 'namelang'. "/* String RFC 3866 langs */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
213 |
|
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
214 |
|
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
215 |
"Adjust outline rasterizer" |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
216 |
FC_CHAR_WIDTH := 'charwidth'."/* Int */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
217 |
FC_CHAR_HEIGHT := 'charheight'."/* Int */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
218 |
FC_MATRIX := 'matrix'. "/* FcMatrix */ |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
219 |
|
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
220 |
FC_WEIGHT_THIN := 0. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
221 |
FC_WEIGHT_EXTRALIGHT := 40. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
222 |
FC_WEIGHT_ULTRALIGHT := FC_WEIGHT_EXTRALIGHT. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
223 |
FC_WEIGHT_LIGHT := 50. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
224 |
FC_WEIGHT_BOOK := 75. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
225 |
FC_WEIGHT_REGULAR := 80. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
226 |
FC_WEIGHT_NORMAL := FC_WEIGHT_REGULAR. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
227 |
FC_WEIGHT_MEDIUM := 100. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
228 |
FC_WEIGHT_DEMIBOLD := 180. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
229 |
FC_WEIGHT_SEMIBOLD := FC_WEIGHT_DEMIBOLD. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
230 |
FC_WEIGHT_BOLD := 200. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
231 |
FC_WEIGHT_EXTRABOLD := 205. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
232 |
FC_WEIGHT_ULTRABOLD := FC_WEIGHT_EXTRABOLD. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
233 |
FC_WEIGHT_BLACK := 210. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
234 |
FC_WEIGHT_HEAVY := FC_WEIGHT_BLACK. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
235 |
FC_WEIGHT_EXTRABLACK := 215. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
236 |
FC_WEIGHT_ULTRABLACK := FC_WEIGHT_EXTRABLACK. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
237 |
|
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
238 |
FC_SLANT_ROMAN := 0. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
239 |
FC_SLANT_ITALIC := 100. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
240 |
FC_SLANT_OBLIQUE := 110. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
241 |
|
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
242 |
FC_WIDTH_ULTRACONDENSED := 50. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
243 |
FC_WIDTH_EXTRACONDENSED := 63. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
244 |
FC_WIDTH_CONDENSED := 75. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
245 |
FC_WIDTH_SEMICONDENSED := 87. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
246 |
FC_WIDTH_NORMAL := 100. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
247 |
FC_WIDTH_SEMIEXPANDED := 113. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
248 |
FC_WIDTH_EXPANDED := 125. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
249 |
FC_WIDTH_EXTRAEXPANDED := 150. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
250 |
FC_WIDTH_ULTRAEXPANDED := 200. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
251 |
|
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
252 |
FC_PROPORTIONAL := 0. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
253 |
FC_DUAL := 90. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
254 |
FC_MONO := 100. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
255 |
FC_CHARCELL := 110. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
256 |
|
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
257 |
"sub-pixel order" |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
258 |
FC_RGBA_UNKNOWN := 0. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
259 |
FC_RGBA_RGB := 1. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
260 |
FC_RGBA_BGR := 2. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
261 |
FC_RGBA_VRGB := 3. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
262 |
FC_RGBA_VBGR := 4. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
263 |
FC_RGBA_NONE := 5. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
264 |
|
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
265 |
"hinting style" |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
266 |
FC_HINT_NONE := 0. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
267 |
FC_HINT_SLIGHT := 1. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
268 |
FC_HINT_MEDIUM := 2. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
269 |
FC_HINT_FULL := 3. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
270 |
|
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
271 |
"LCD filter" |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
272 |
FC_LCD_NONE := 0. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
273 |
FC_LCD_DEFAULT := 1. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
274 |
FC_LCD_LIGHT := 2. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
275 |
FC_LCD_LEGACY := 3. |
6184
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
276 |
|
6187
cfe33a9940ee
Memory/performance optimization - use stack-allocated XftColor.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6186
diff
changeset
|
277 |
StXFace2FCWeightMap := Dictionary withKeysAndValues:{ |
7221 | 278 |
#thin. FC_WEIGHT_THIN. |
279 |
#extralight. FC_WEIGHT_EXTRALIGHT. |
|
280 |
#ultralight. FC_WEIGHT_ULTRALIGHT. |
|
281 |
#light. FC_WEIGHT_LIGHT. |
|
282 |
#book. FC_WEIGHT_BOOK. |
|
283 |
#regular. FC_WEIGHT_REGULAR. |
|
284 |
#normal. FC_WEIGHT_NORMAL. |
|
285 |
#medium. FC_WEIGHT_MEDIUM. |
|
286 |
#demibold. FC_WEIGHT_DEMIBOLD. |
|
287 |
#semibold. FC_WEIGHT_SEMIBOLD. |
|
288 |
#bold. FC_WEIGHT_BOLD. |
|
289 |
#extrabold. FC_WEIGHT_EXTRABOLD. |
|
290 |
#ultrabold. FC_WEIGHT_ULTRABOLD. |
|
291 |
#black. FC_WEIGHT_BLACK. |
|
292 |
#heavy. FC_WEIGHT_HEAVY. |
|
293 |
#extrablack. FC_WEIGHT_EXTRABLACK. |
|
294 |
#ultrablack. FC_WEIGHT_ULTRABLACK. |
|
6184
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
295 |
}. |
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
296 |
StXStyle2FCSlantMap := Dictionary withKeysAndValues:{ |
7221 | 297 |
#roman. FC_SLANT_ROMAN. |
298 |
#italic. FC_SLANT_ITALIC. |
|
299 |
#oblique. FC_SLANT_OBLIQUE. |
|
6185
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
300 |
}. |
6184
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
301 |
|
6185
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
302 |
"Modified: / 30-12-2013 / 19:48:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6184
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
303 |
! ! |
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
304 |
|
6325 | 305 |
!XftFontDescription class methodsFor:'instance creation'! |
306 |
||
307 |
family:familyString face:faceString style:styleString size:size sizeUnit:sizeUnit encoding:encoding |
|
6365
cf89c4bedea4
Instvar drawId renamed to sharedDrawId.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6356
diff
changeset
|
308 |
"returns a font for given family, face, style, size and the specified encoding. |
6325 | 309 |
The returned font is not associated to a specific device" |
310 |
||
311 |
|proto| |
|
312 |
||
6707 | 313 |
RecentlyUsedFonts notNil ifTrue:[ |
7114 | 314 |
proto := RecentlyUsedFonts |
315 |
detect:[:fn | |
|
316 |
fn family = familyString |
|
317 |
and:[ fn size = size and:[fn sizeUnit = sizeUnit |
|
318 |
and:[ fn face = faceString |
|
319 |
and:[ (fn style = styleString |
|
320 |
or:[ (fn style = 'oblique' and:[styleString = 'italic']) |
|
321 |
or:[ (fn style = 'italic' and:[styleString = 'oblique']) ]]) ]]]]] |
|
322 |
ifNone:nil. |
|
323 |
proto notNil ifTrue:[ |
|
324 |
^ proto |
|
325 |
]. |
|
6659 | 326 |
]. |
327 |
||
6325 | 328 |
CachedFontList notNil ifTrue:[ |
7114 | 329 |
proto := CachedFontList |
330 |
detect:[:fn | |
|
331 |
fn family = familyString |
|
332 |
and:[ fn face = faceString |
|
333 |
and:[ (fn style = styleString |
|
334 |
or:[ (fn style = 'oblique' and:[styleString = 'italic']) |
|
335 |
or:[ (fn style = 'italic' and:[styleString = 'oblique']) ]]) ]]] |
|
336 |
ifNone:nil. |
|
337 |
proto notNil ifTrue:[ |
|
338 |
^ (proto shallowCopy) |
|
339 |
setDevice: nil patternId: nil fontId: nil; |
|
340 |
family:familyString face:faceString style:styleString size:size sizeUnit:sizeUnit encoding:encoding |
|
341 |
]. |
|
6325 | 342 |
]. |
343 |
^ super |
|
7114 | 344 |
family:familyString face:faceString style:styleString size:size sizeUnit:sizeUnit encoding:encoding |
6325 | 345 |
! |
346 |
||
6993 | 347 |
for:aFontOrFontDescription |
348 |
^ self |
|
7114 | 349 |
family:aFontOrFontDescription family |
350 |
face:aFontOrFontDescription face |
|
351 |
style:aFontOrFontDescription style |
|
352 |
size:aFontOrFontDescription size |
|
353 |
sizeUnit:#pt |
|
354 |
encoding:aFontOrFontDescription encoding |
|
6993 | 355 |
! |
356 |
||
6325 | 357 |
new |
6963 | 358 |
^ self basicNew initialize. |
6325 | 359 |
! ! |
360 |
||
6957 | 361 |
!XftFontDescription class methodsFor:'change & update'! |
362 |
||
363 |
aboutToDestroyViewWithDevice:aDevice id:aWindowId |
|
364 |
"a view is going to be destroyed. |
|
365 |
Have to disassociate the XftDrawId from the drawableId aWindowId" |
|
366 |
||
367 |
Lobby do:[:eachXftFont| |
|
7114 | 368 |
eachXftFont graphicsDevice == aDevice ifTrue:[ |
369 |
eachXftFont disassociateXftDrawableFrom:aWindowId. |
|
370 |
]. |
|
6957 | 371 |
]. |
372 |
! ! |
|
373 |
||
6176 | 374 |
!XftFontDescription class methodsFor:'examples'! |
375 |
||
376 |
example1 |
|
377 |
" |
|
378 |
XftFontDescription example1 |
|
379 |
" |
|
380 |
|top textView| |
|
381 |
||
382 |
top := StandardSystemView new. |
|
383 |
top extent:300@200. |
|
384 |
||
385 |
textView := EditTextView new. |
|
386 |
textView origin:0.0 @ 0.0 corner:1.0 @ 1.0. |
|
6184
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
387 |
textView basicFont: (XftFontDescription family: 'DejaVu Sans' size: 16). |
6176 | 388 |
|
389 |
top addSubView:textView. |
|
390 |
||
6188
9d09f76582b7
Fixed problem with clipping.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6187
diff
changeset
|
391 |
textView contents:('/etc/hosts' asFilename contentsOfEntireFile asText). |
6176 | 392 |
|
393 |
top open. |
|
394 |
||
395 |
"Created: / 20-12-2013 / 00:04:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6184
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
396 |
"Modified: / 30-12-2013 / 19:11:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6185
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
397 |
! |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
398 |
|
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
399 |
example2 |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
400 |
" |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
401 |
XftFontDescription example2 |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
402 |
" |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
403 |
|top textView| |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
404 |
|
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
405 |
top := StandardSystemView new. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
406 |
top extent:300@200. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
407 |
|
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
408 |
textView := EditTextView new. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
409 |
textView origin:0.0 @ 0.0 corner:1.0 @ 1.0. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
410 |
textView basicFont: (XftFontDescription family: 'DejaVu Sans' size: 30) asItalic. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
411 |
|
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
412 |
top addSubView:textView. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
413 |
|
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
414 |
textView contents:('/etc/hosts' asFilename contentsOfEntireFile). |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
415 |
|
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
416 |
top open. |
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
417 |
|
a09b2e2303cb
Oops. make it compilable again (bug in stc - FCConstants private
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6184
diff
changeset
|
418 |
"Created: / 30-12-2013 / 19:49:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6389 | 419 |
! |
420 |
||
421 |
example3 |
|
422 |
" |
|
423 |
XftFontDescription example2 |
|
424 |
" |
|
425 |
|top textView| |
|
426 |
||
427 |
top := StandardSystemView new. |
|
428 |
top extent:300@200. |
|
429 |
||
430 |
textView := EditTextView new. |
|
431 |
textView origin:0.0 @ 0.0 corner:1.0 @ 1.0. |
|
432 |
textView basicFont: (XftFontDescription family: 'Indie Flower' size: 30). |
|
433 |
||
434 |
top addSubView:textView. |
|
435 |
||
436 |
textView contents:('/etc/hosts' asFilename contentsOfEntireFile). |
|
437 |
||
438 |
top open. |
|
439 |
||
440 |
"Created: / 30-12-2013 / 19:49:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
441 |
! ! |
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
442 |
|
6936 | 443 |
!XftFontDescription class methodsFor:'primitives'! |
444 |
||
445 |
xftAvailable |
|
446 |
%{ |
|
447 |
#ifdef XFT |
|
448 |
RETURN ( true ) |
|
449 |
#endif |
|
450 |
%}. |
|
451 |
^ false |
|
452 |
||
453 |
"Created: / 20-12-2013 / 21:10:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
454 |
! ! |
|
455 |
||
6263 | 456 |
!XftFontDescription class methodsFor:'queries'! |
457 |
||
458 |
listOfAvailableFonts |
|
6264 | 459 |
"uses fc-list to get a list of available fontDescriptions" |
460 |
||
6263 | 461 |
CachedFontList isNil ifTrue:[ |
6393 | 462 |
CachedFontList := FCFontListParser new listOfAvailableFonts |
6263 | 463 |
]. |
464 |
^ CachedFontList |
|
465 |
||
466 |
" |
|
6337 | 467 |
XftFontDescription flushListOfAvailableFonts. |
6319 | 468 |
XftFontDescription listOfAvailableFonts |
6263 | 469 |
" |
470 |
! ! |
|
471 |
||
6317 | 472 |
!XftFontDescription methodsFor:'accessing'! |
6190
d651313d4044
Fixes to share XftFontDescription instances.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6189
diff
changeset
|
473 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
474 |
encoding |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
475 |
^ encoding ? #'iso10646-1' |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
476 |
! |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
477 |
|
6319 | 478 |
face |
479 |
^ face ? '' |
|
480 |
! |
|
481 |
||
482 |
fullName |
|
483 |
^ name ? (self userFriendlyName) |
|
484 |
! |
|
485 |
||
6317 | 486 |
graphicsDevice |
6190
d651313d4044
Fixes to share XftFontDescription instances.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6189
diff
changeset
|
487 |
^ device |
d651313d4044
Fixes to share XftFontDescription instances.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6189
diff
changeset
|
488 |
|
d651313d4044
Fixes to share XftFontDescription instances.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6189
diff
changeset
|
489 |
"Created: / 02-01-2014 / 23:22:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6319 | 490 |
! |
491 |
||
492 |
maxCode |
|
6323 | 493 |
^ maxCode ? 16rFFFF |
6319 | 494 |
! |
495 |
||
496 |
maxCode:something |
|
497 |
maxCode := something. |
|
498 |
! |
|
499 |
||
500 |
minCode |
|
6323 | 501 |
^ minCode ? 0 |
6319 | 502 |
! |
503 |
||
504 |
minCode:something |
|
505 |
minCode := something. |
|
506 |
! |
|
507 |
||
508 |
style |
|
509 |
^ style ? '' |
|
6391 | 510 |
! |
511 |
||
512 |
weight:aNumber |
|
7121 | 513 |
"set the weight. The face is the string representation of weight." |
6391 | 514 |
|
515 |
self assert:(self fontId isNil). "/ cannot change an instantiated font |
|
516 |
||
7121 | 517 |
weight := aNumber. |
518 |
||
519 |
aNumber == FC_WEIGHT_THIN ifTrue:[ face := #thin. ^ self]. |
|
520 |
aNumber == FC_WEIGHT_EXTRALIGHT ifTrue:[ face := #extralight. ^ self]. |
|
521 |
aNumber == FC_WEIGHT_LIGHT ifTrue:[ face := #light. ^ self]. |
|
522 |
aNumber == FC_WEIGHT_BOOK ifTrue:[ face := #book. ^ self]. |
|
523 |
aNumber == FC_WEIGHT_REGULAR ifTrue:[ face := #regular. ^ self]. |
|
524 |
aNumber == FC_WEIGHT_MEDIUM ifTrue:[ face := #medium. ^ self]. |
|
525 |
aNumber == FC_WEIGHT_DEMIBOLD ifTrue:[ face := #demibold. ^ self]. |
|
526 |
aNumber == FC_WEIGHT_BOLD ifTrue:[ face := #bold. ^ self]. |
|
527 |
aNumber == FC_WEIGHT_EXTRABOLD ifTrue:[ face := #extrabold. ^ self]. |
|
528 |
aNumber == FC_WEIGHT_BLACK ifTrue:[ face := #black. ^ self]. |
|
529 |
aNumber == FC_WEIGHT_EXTRABLACK ifTrue:[ face := #extrablack. ^ self]. |
|
6391 | 530 |
|
531 |
aNumber <= (FC_WEIGHT_EXTRALIGHT + FC_WEIGHT_LIGHT // 2) ifTrue:[ |
|
7221 | 532 |
face := #extralight. |
533 |
^ self. |
|
6391 | 534 |
]. |
535 |
aNumber <= (FC_WEIGHT_LIGHT + FC_WEIGHT_BOOK // 2) ifTrue:[ |
|
7221 | 536 |
face := #light. |
537 |
^ self. |
|
6391 | 538 |
]. |
539 |
aNumber <= (FC_WEIGHT_MEDIUM + FC_WEIGHT_DEMIBOLD // 2) ifTrue:[ |
|
7221 | 540 |
face := #medium. |
541 |
^ self. |
|
6391 | 542 |
]. |
543 |
aNumber <= (FC_WEIGHT_DEMIBOLD + FC_WEIGHT_BOLD // 2) ifTrue:[ |
|
7221 | 544 |
face := #demibold. |
545 |
^ self. |
|
6391 | 546 |
]. |
547 |
aNumber <= (FC_WEIGHT_BOLD + FC_WEIGHT_BLACK // 2) ifTrue:[ |
|
7221 | 548 |
face := #bold. |
549 |
^ self. |
|
6391 | 550 |
]. |
7121 | 551 |
face := #extrabold. |
6391 | 552 |
^ self |
553 |
||
554 |
"/ FC_WEIGHT_THIN := 0. |
|
555 |
"/ FC_WEIGHT_EXTRALIGHT := 40. |
|
556 |
"/ FC_WEIGHT_ULTRALIGHT := FC_WEIGHT_EXTRALIGHT. |
|
557 |
"/ FC_WEIGHT_LIGHT := 50. |
|
558 |
"/ FC_WEIGHT_BOOK := 75. |
|
559 |
"/ FC_WEIGHT_REGULAR := 80. |
|
560 |
"/ FC_WEIGHT_NORMAL := FC_WEIGHT_REGULAR. |
|
561 |
"/ FC_WEIGHT_MEDIUM := 100. |
|
562 |
"/ FC_WEIGHT_DEMIBOLD := 180. |
|
563 |
"/ FC_WEIGHT_SEMIBOLD := FC_WEIGHT_DEMIBOLD. |
|
564 |
"/ FC_WEIGHT_BOLD := 200. |
|
565 |
"/ FC_WEIGHT_EXTRABOLD := 205. |
|
566 |
"/ FC_WEIGHT_ULTRABOLD := FC_WEIGHT_EXTRABOLD. |
|
567 |
"/ FC_WEIGHT_BLACK := 210. |
|
568 |
"/ FC_WEIGHT_HEAVY := FC_WEIGHT_BLACK. |
|
569 |
"/ FC_WEIGHT_EXTRABLACK := 215. |
|
570 |
"/ FC_WEIGHT_ULTRABLACK := FC_WEIGHT_EXTRABLACK. |
|
6317 | 571 |
! ! |
572 |
||
573 |
!XftFontDescription methodsFor:'accessing-private'! |
|
6190
d651313d4044
Fixes to share XftFontDescription instances.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6189
diff
changeset
|
574 |
|
7443 | 575 |
getXftFontId |
6190
d651313d4044
Fixes to share XftFontDescription instances.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6189
diff
changeset
|
576 |
^ fontId |
d651313d4044
Fixes to share XftFontDescription instances.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6189
diff
changeset
|
577 |
|
d651313d4044
Fixes to share XftFontDescription instances.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6189
diff
changeset
|
578 |
"Created: / 02-01-2014 / 23:29:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7114 | 579 |
! |
580 |
||
581 |
setFontId:fontIdArg |
|
582 |
fontId := fontIdArg. |
|
6190
d651313d4044
Fixes to share XftFontDescription instances.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6189
diff
changeset
|
583 |
! ! |
d651313d4044
Fixes to share XftFontDescription instances.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6189
diff
changeset
|
584 |
|
6936 | 585 |
!XftFontDescription methodsFor:'change & update'! |
586 |
||
587 |
update:anAspect with:something from:changedObject |
|
588 |
"I want to be informed when a view that printed something with me is destroyed. |
|
589 |
Disassociate the view from the XFT drawable" |
|
590 |
||
591 |
|drawableId| |
|
592 |
||
593 |
anAspect == #aboutToDestroy ifTrue:[ |
|
7221 | 594 |
drawableId := changedObject drawableId. |
595 |
(sharedDrawId notNil and:[drawableId notNil]) ifTrue:[ |
|
596 |
sharedDrawId disassociateFrom:drawableId. |
|
597 |
]. |
|
598 |
changedObject removeDependent:self. |
|
6936 | 599 |
]. |
600 |
! ! |
|
601 |
||
6587
c1790bb9af59
In case of not configured but installed Xft Fonts convert XftFonts
ab
parents:
6544
diff
changeset
|
602 |
!XftFontDescription methodsFor:'converting'! |
c1790bb9af59
In case of not configured but installed Xft Fonts convert XftFonts
ab
parents:
6544
diff
changeset
|
603 |
|
c1790bb9af59
In case of not configured but installed Xft Fonts convert XftFonts
ab
parents:
6544
diff
changeset
|
604 |
asNonXftFont |
c1790bb9af59
In case of not configured but installed Xft Fonts convert XftFonts
ab
parents:
6544
diff
changeset
|
605 |
|newFont| |
c1790bb9af59
In case of not configured but installed Xft Fonts convert XftFonts
ab
parents:
6544
diff
changeset
|
606 |
|
6656 | 607 |
newFont := FontDescription |
608 |
family:family |
|
609 |
face:face |
|
610 |
style:style |
|
611 |
size:(sizeUnit == #px ifTrue:[pixelSize] ifFalse:[size]) |
|
612 |
sizeUnit:sizeUnit |
|
613 |
encoding:encoding. |
|
6587
c1790bb9af59
In case of not configured but installed Xft Fonts convert XftFonts
ab
parents:
6544
diff
changeset
|
614 |
|
6656 | 615 |
^ newFont |
6587
c1790bb9af59
In case of not configured but installed Xft Fonts convert XftFonts
ab
parents:
6544
diff
changeset
|
616 |
! ! |
c1790bb9af59
In case of not configured but installed Xft Fonts convert XftFonts
ab
parents:
6544
diff
changeset
|
617 |
|
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
618 |
!XftFontDescription methodsFor:'displaying'! |
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
619 |
|
6351 | 620 |
displayString:aString from:index1 to:index2Arg x:xArg y:yArg in:aGC opaque:opaque |
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
621 |
"display a partial string at some position in aGC." |
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
622 |
|
6707 | 623 |
|index2 bytesPerCharacter transformation |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
624 |
clipRect clipX clipY clipW clipH |
6707 | 625 |
fg fgR fgG fgB fgA fgPixel bg bgR bgG bgB bgA bgPixel |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
626 |
drawX drawY displayId screen drawableId error stringLen |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
627 |
newXftDrawId pixmapDepth| |
6193 | 628 |
|
6351 | 629 |
"limit the string len, otherwise bad output is generated" |
6477 | 630 |
stringLen := index2Arg - index1 + 1. |
7342 | 631 |
stringLen > 1000 "8000" ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
632 |
index2 := index1 + 1000 "8000" - 1. |
6351 | 633 |
] ifFalse:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
634 |
stringLen <= 0 ifTrue:[^ self]. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
635 |
index2 := index2Arg. |
6351 | 636 |
]. |
6209 | 637 |
bytesPerCharacter := aString bitsPerCharacter // 8. |
6199
2a683b1824c6
Bugfix in XftFontDescription>>#displayString:from:to:x:y:in:opaque: takes transformation into an account.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6198
diff
changeset
|
638 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
639 |
transformation := aGC transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
640 |
|
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
641 |
clipRect := aGC deviceClippingBoundsOrNil. |
7050 | 642 |
clipRect notNil ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
643 |
clipX := clipRect left. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
644 |
clipY := clipRect top. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
645 |
clipW := clipRect width. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
646 |
clipH := clipRect height. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
647 |
"/clipW > 32767 ifTrue:['clipW > 32767: ' errorPrint. clipW errorPrintCR. clipW := 32767]. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
648 |
"/(clipX > 16384 or:[clipX < -16384]) ifTrue:['clipX > 16384: ' errorPrint. clipX errorPrintCR.]. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
649 |
"/ YES YES YES: this MUST be transformed!! |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
650 |
"/ (see htmlView) fix the notebook, please. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
651 |
"/ transformation notNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
652 |
"/ clipX := (transformation applyToX:clipX) ceiling. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
653 |
"/ clipY := (transformation applyToY:clipY) ceiling. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
654 |
"/ ]. |
6489 | 655 |
]. |
6199
2a683b1824c6
Bugfix in XftFontDescription>>#displayString:from:to:x:y:in:opaque: takes transformation into an account.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6198
diff
changeset
|
656 |
|
6356 | 657 |
transformation isNil ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
658 |
drawX := xArg. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
659 |
drawY := yArg. |
6356 | 660 |
] ifFalse:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
661 |
drawX := (transformation applyToX:xArg) ceiling. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
662 |
drawY := (transformation applyToY:yArg) ceiling. |
6356 | 663 |
]. |
664 |
||
7068 | 665 |
fg := aGC paint. |
666 |
fgR := fg scaledRed. |
|
667 |
fgG := fg scaledGreen. |
|
668 |
fgB := fg scaledBlue. |
|
669 |
fgA := fg scaledAlpha. |
|
670 |
||
6263 | 671 |
fgR isNil ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
672 |
"/ when drawing into a pixmap... |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
673 |
fgPixel := fg colorId. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
674 |
fgPixel == 0 ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
675 |
fgR := fgG := fgB := 0. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
676 |
] ifFalse:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
677 |
fgR := fgG := fgB := 16rFFFF. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
678 |
] |
6263 | 679 |
]. |
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
680 |
|
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
681 |
opaque ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
682 |
bg := aGC backgroundPaint. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
683 |
bg isColor ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
684 |
bgR := bg scaledRed. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
685 |
bgG := bg scaledGreen. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
686 |
bgB := bg scaledBlue. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
687 |
bgA := bg scaledAlpha. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
688 |
] ifFalse:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
689 |
"images are not yet implemented" |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
690 |
"/ #todo: fill background rectangle |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
691 |
bgR := bgG := bgB := bgA := 16rFFFF. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
692 |
]. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
693 |
bgR isNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
694 |
"/ when drawing into a pixmap... |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
695 |
bgPixel := bg colorId. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
696 |
bgPixel == 0 ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
697 |
bgR := bgG := bgB := 0. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
698 |
] ifFalse:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
699 |
bgR := bgG := bgB := 16rFFFF. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
700 |
] |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
701 |
]. |
6193 | 702 |
]. |
6333 | 703 |
displayId := device displayIdOrErrorIfBroken. |
6365
cf89c4bedea4
Instvar drawId renamed to sharedDrawId.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6356
diff
changeset
|
704 |
displayId isNil ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
705 |
^ self. |
6333 | 706 |
]. |
6193 | 707 |
screen := device screen. |
6351 | 708 |
drawableId := aGC drawableId. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
709 |
aGC isPixmap ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
710 |
pixmapDepth := aGC depth. |
7075 | 711 |
]. |
6209 | 712 |
|
7115 | 713 |
%{ /* STACK: 64000 */ |
6193 | 714 |
#ifdef XFT |
715 |
XftColor color; |
|
716 |
XGlyphInfo extents; |
|
717 |
XRectangle clipRX; |
|
6936 | 718 |
char *string; |
6195
9a14f8e6c10c
Added support for wide strings.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6194
diff
changeset
|
719 |
int len; |
6209 | 720 |
int __bytesPerCharacter; |
6936 | 721 |
XftDraw *__sharedDrawId; |
722 |
XftFont *__xftFont = XFT_FONT(__INST(fontId)); |
|
6193 | 723 |
|
6209 | 724 |
if (!(__bothSmallInteger(drawX, drawY) |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
725 |
&& __bothSmallInteger(index1, index2) |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
726 |
&& __isSmallInteger(bytesPerCharacter) |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
727 |
&& (__isSmallInteger(fgPixel) || (__bothSmallInteger(fgR, fgG) && __bothSmallInteger(fgB, fgA))) |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
728 |
&& (opaque == false || __isSmallInteger(bgPixel) || (__bothSmallInteger(bgR, bgG) && __bothSmallInteger(bgB, bgA))) |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
729 |
&& __isNonNilObject(aString) |
6209 | 730 |
)) { |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
731 |
error = @symbol(badArgument); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
732 |
goto out; |
6209 | 733 |
} |
734 |
||
735 |
__bytesPerCharacter = __intVal(bytesPerCharacter); |
|
6195
9a14f8e6c10c
Added support for wide strings.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6194
diff
changeset
|
736 |
|
7075 | 737 |
if (pixmapDepth != nil) { |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
738 |
int __pixmapDepth = __intVal(pixmapDepth); |
7075 | 739 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
740 |
if (__pixmapDepth == 1) { |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
741 |
__sharedDrawId = XftDrawCreateBitmap(DISPLAY(displayId), DRAWABLE(drawableId)); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
742 |
} else { |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
743 |
__sharedDrawId = XftDrawCreateAlpha(DISPLAY(displayId), DRAWABLE(drawableId), __pixmapDepth); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
744 |
} |
7069 | 745 |
} else { |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
746 |
if (__INST(sharedDrawId) == nil) { |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
747 |
__sharedDrawId = XftDrawCreate(DISPLAY(displayId), |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
748 |
DRAWABLE(drawableId), |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
749 |
DefaultVisual(DISPLAY(displayId), SCREEN(screen)), |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
750 |
DefaultColormap(DISPLAY(displayId), SCREEN(screen))); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
751 |
__INST(sharedDrawId) = newXftDrawId = XFT_DRAW_HANDLE_NEW(__sharedDrawId); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
752 |
__STORE(self, newXftDrawId); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
753 |
} else if (XftDrawDrawable(__sharedDrawId = XFT_DRAW(__INST(sharedDrawId))) != DRAWABLE(drawableId)) { |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
754 |
XftDrawChange(__sharedDrawId, DRAWABLE(drawableId)); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
755 |
} |
6193 | 756 |
} |
757 |
||
6936 | 758 |
string = __stringVal(aString) + ((__intVal(index1) - 1 ) * __bytesPerCharacter); |
6195
9a14f8e6c10c
Added support for wide strings.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6194
diff
changeset
|
759 |
len = __intVal(index2) - __intVal(index1) + 1; |
6193 | 760 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
761 |
if (clipX != nil) { |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
762 |
clipRX.x = __intVal(clipX); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
763 |
clipRX.y = __intVal(clipY); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
764 |
clipRX.width = __intVal(clipW); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
765 |
clipRX.height = __intVal(clipH); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
766 |
XftDrawSetClipRectangles(__sharedDrawId, 0, 0, &clipRX, 1); |
6193 | 767 |
} else { |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
768 |
XftDrawSetClip(__sharedDrawId, 0); |
6193 | 769 |
} |
770 |
||
6223 | 771 |
if (opaque == true) { |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
772 |
if (bgPixel != nil) { |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
773 |
color.pixel = (unsigned long)__intVal(bgPixel); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
774 |
} |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
775 |
color.color.red = __intVal(bgR); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
776 |
color.color.green = __intVal(bgG); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
777 |
color.color.blue = __intVal(bgB); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
778 |
color.color.alpha = __intVal(bgA); |
7068 | 779 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
780 |
switch (__bytesPerCharacter) { |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
781 |
case 1: |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
782 |
XftTextExtents8(DISPLAY(displayId), __xftFont, (FcChar8*)string, len, &extents); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
783 |
break; |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
784 |
case 2: |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
785 |
XftTextExtents16(DISPLAY(displayId), __xftFont, (FcChar16*)string, len, &extents); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
786 |
break; |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
787 |
case 4: |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
788 |
XftTextExtents32(DISPLAY(displayId), __xftFont, (FcChar32*)string, len, &extents); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
789 |
break; |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
790 |
} |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
791 |
if (extents.width < 0) printf("width: %d < 0\n", extents.width); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
792 |
|
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
793 |
XftDrawRect(__sharedDrawId, &color, __intVal(drawX) - extents.x, __intVal(drawY) - __xftFont->ascent, extents.width, __xftFont->height); |
6193 | 794 |
} |
6223 | 795 |
if (fgPixel != nil) { |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
796 |
color.pixel = (unsigned long)__intVal(fgPixel); |
6223 | 797 |
} |
7068 | 798 |
color.color.red = __intVal(fgR); |
799 |
color.color.green = __intVal(fgG); |
|
800 |
color.color.blue = __intVal(fgB); |
|
801 |
color.color.alpha = __intVal(fgA); |
|
802 |
||
6209 | 803 |
switch (__bytesPerCharacter) { |
6195
9a14f8e6c10c
Added support for wide strings.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6194
diff
changeset
|
804 |
case 1: |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
805 |
XftDrawString8(__sharedDrawId, &color,__xftFont, |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
806 |
__intVal(drawX), |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
807 |
__intVal(drawY), |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
808 |
(FcChar8*)string, |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
809 |
len); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
810 |
break; |
6936 | 811 |
|
6195
9a14f8e6c10c
Added support for wide strings.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6194
diff
changeset
|
812 |
case 2: |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
813 |
XftDrawString16(__sharedDrawId, &color, __xftFont, |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
814 |
__intVal(drawX), |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
815 |
__intVal(drawY), |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
816 |
(FcChar16*)string, |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
817 |
len); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
818 |
break; |
6936 | 819 |
|
6195
9a14f8e6c10c
Added support for wide strings.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6194
diff
changeset
|
820 |
case 4: |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
821 |
XftDrawString32(__sharedDrawId, &color, __xftFont, |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
822 |
__intVal(drawX), |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
823 |
__intVal(drawY), |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
824 |
(FcChar32*)string, |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
825 |
len); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
826 |
break; |
6936 | 827 |
|
828 |
default: |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
829 |
error = @symbol(invalidStringSize); |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
830 |
goto out; |
6193 | 831 |
} |
6936 | 832 |
|
7075 | 833 |
if (pixmapDepth != nil) { |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
834 |
XftDrawDestroy(__sharedDrawId); |
7070 | 835 |
} |
836 |
||
6936 | 837 |
# if 0 // this has been superseeded by receiving change messages on view destroy |
838 |
// Have to disassociate the drawableId - otherwise we get an X11 error 'RenderBadPicture (invalid Picture parameter)' |
|
839 |
// when the drawable (the window) is destroyed. |
|
840 |
XftDrawChange(__sharedDrawId, None); |
|
841 |
# endif |
|
6946 | 842 |
out:; |
6193 | 843 |
#endif |
844 |
%}. |
|
6946 | 845 |
error notNil ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
846 |
self primitiveFailed: error. |
6946 | 847 |
]. |
6957 | 848 |
newXftDrawId notNil ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
849 |
Lobby register:self. |
6946 | 850 |
]. |
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
851 |
"Created: / 21-12-2013 / 21:11:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6199
2a683b1824c6
Bugfix in XftFontDescription>>#displayString:from:to:x:y:in:opaque: takes transformation into an account.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6198
diff
changeset
|
852 |
"Modified: / 10-01-2014 / 11:13:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6176 | 853 |
! ! |
854 |
||
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
855 |
!XftFontDescription methodsFor:'error reporting'! |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
856 |
|
6198 | 857 |
primitiveFailed |
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
858 |
<resource: #skipInDebuggersWalkBack> |
6876
b1aa2b47d252
avoid ifdefs around smalltalk statements
Claus Gittinger <cg@exept.de>
parents:
6833
diff
changeset
|
859 |
|
6936 | 860 |
self class xftAvailable ifFalse:[ |
7114 | 861 |
super primitiveFailed:'Xft support is not configured'. |
6876
b1aa2b47d252
avoid ifdefs around smalltalk statements
Claus Gittinger <cg@exept.de>
parents:
6833
diff
changeset
|
862 |
]. |
6198 | 863 |
super primitiveFailed |
864 |
! |
|
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
865 |
|
6198 | 866 |
primitiveFailed:errorString |
867 |
<resource: #skipInDebuggersWalkBack> |
|
6876
b1aa2b47d252
avoid ifdefs around smalltalk statements
Claus Gittinger <cg@exept.de>
parents:
6833
diff
changeset
|
868 |
|
6936 | 869 |
self class xftAvailable ifFalse:[ |
7114 | 870 |
super primitiveFailed:'Xft support is not configured'. |
6876
b1aa2b47d252
avoid ifdefs around smalltalk statements
Claus Gittinger <cg@exept.de>
parents:
6833
diff
changeset
|
871 |
]. |
6198 | 872 |
super primitiveFailed:errorString |
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
873 |
! ! |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
874 |
|
6946 | 875 |
!XftFontDescription methodsFor:'finalization'! |
876 |
||
877 |
finalizationLobby |
|
878 |
^ Lobby |
|
879 |
! |
|
880 |
||
881 |
finalize |
|
7114 | 882 |
sharedDrawId notNil ifTrue:[ |
7221 | 883 |
sharedDrawId destroy. |
884 |
sharedDrawId := nil. |
|
7114 | 885 |
]. |
6946 | 886 |
! ! |
887 |
||
6176 | 888 |
!XftFontDescription methodsFor:'getting a device font'! |
889 |
||
7443 | 890 |
installInDeviceForGCId:aGCId |
891 |
"install the font for aGCId" |
|
892 |
||
893 |
(device isNil or:[fontId isNil]) ifTrue:[ |
|
894 |
Logger error:'no device font for: %1' with:self. |
|
895 |
^ nil. |
|
896 |
]. |
|
897 |
"nothing to install" |
|
898 |
! |
|
899 |
||
6176 | 900 |
onDevice:aGraphicsDevice |
901 |
"Create a new XftFont representing the closes font as |
|
902 |
myself on aDevice; if one already exists, return the one." |
|
903 |
||
7219 | 904 |
^ self onDevice:aGraphicsDevice ifAbsent:self |
7114 | 905 |
! |
906 |
||
907 |
onDevice:aGraphicsDevice ifAbsent:aBlock |
|
7559 | 908 |
"Create a new XftFont representing the closest font as |
7114 | 909 |
myself on aDevice; if one already exists, return the one." |
6176 | 910 |
|
7559 | 911 |
|displayId myPatternHandle closestPatternHandle newFontId computedWeight deviceFont| |
6176 | 912 |
|
7114 | 913 |
(device == aGraphicsDevice) ifTrue:[ |
7525 | 914 |
"I am already assigned to that device ..." |
915 |
^ self |
|
7114 | 916 |
]. |
917 |
aGraphicsDevice isNil ifTrue:[ |
|
7525 | 918 |
^ self |
6544 | 919 |
]. |
7121 | 920 |
aGraphicsDevice supportsXftFonts ifFalse:[ |
7525 | 921 |
^ self asNonXftFont onDevice:aGraphicsDevice. |
6190
d651313d4044
Fixes to share XftFontDescription instances.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6189
diff
changeset
|
922 |
]. |
6389 | 923 |
RecentlyUsedFonts isNil ifTrue:[ |
7525 | 924 |
RecentlyUsedFonts := OrderedCollection new:20. |
6389 | 925 |
]. |
926 |
||
927 |
RecentlyUsedFonts keysAndValuesDo:[:index :aFont | |
|
7559 | 928 |
((aFont class == self class) |
929 |
and:[(self sameDeviceFontAs:aFont) |
|
930 |
and:[device == aGraphicsDevice |
|
931 |
and:[aFont getXftFontId notNil]]]) ifTrue:[ |
|
7525 | 932 |
"/ Transcript showCR:'hit'. |
933 |
RecentlyUsedFonts |
|
934 |
removeIndex:index; |
|
935 |
addFirst:aFont. |
|
936 |
^ aFont |
|
937 |
] |
|
6389 | 938 |
]. |
939 |
||
6974 | 940 |
RecentlyUsedFonts size >= 20 ifTrue:[ |
7525 | 941 |
RecentlyUsedFonts removeLast. |
6389 | 942 |
]. |
943 |
||
6176 | 944 |
aGraphicsDevice deviceFonts do:[:aFont | |
7559 | 945 |
(self sameDeviceFontAs:aFont) ifTrue:[ |
7525 | 946 |
RecentlyUsedFonts addFirst:aFont. |
947 |
^ aFont |
|
948 |
]. |
|
6176 | 949 |
]. |
950 |
||
7114 | 951 |
"/ ^ self asNonXftFont onDevice:aGraphicsDevice. |
7121 | 952 |
|
953 |
computedWeight := weight. |
|
954 |
computedWeight isNil ifTrue:[ |
|
7525 | 955 |
computedWeight := StXFace2FCWeightMap at:(face ? '') asLowercase ifAbsent:[FC_WEIGHT_REGULAR]. |
7121 | 956 |
]. |
957 |
||
7559 | 958 |
|
959 |
FirstTimeCalled ~~ false ifTrue:[ |
|
960 |
'XftFont: matching font (this may take a long time, if the system''s font cache needs to be filled first. Be patient...' infoPrintCR. |
|
961 |
FirstTimeCalled := false. |
|
962 |
]. |
|
963 |
||
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
964 |
[ |
7525 | 965 |
myPatternHandle := FCPatternHandle create. |
966 |
myPatternHandle |
|
967 |
add:FC_FOUNDRY value:manufacturer; |
|
968 |
add:FC_FAMILY value:family; |
|
969 |
add:FC_WEIGHT value:computedWeight; |
|
970 |
add:FC_SLANT value:(StXStyle2FCSlantMap at:(style ? '') asLowercase ifAbsent:[FC_SLANT_ROMAN]). |
|
971 |
sizeUnit = #px ifTrue:[ |
|
972 |
myPatternHandle add:FC_PIXEL_SIZE value:(pixelSize isNil ifTrue:[nil] ifFalse:[pixelSize rounded]). |
|
973 |
] ifFalse:[ |
|
974 |
myPatternHandle add:FC_SIZE value:(size isNil ifTrue:[nil] ifFalse:[size rounded]). |
|
975 |
]. |
|
7114 | 976 |
|
7525 | 977 |
displayId := aGraphicsDevice displayId. |
978 |
closestPatternHandle := myPatternHandle matchFontOnDisplayId:displayId screen:aGraphicsDevice screen. |
|
979 |
closestPatternHandle notNil ifTrue:[ |
|
980 |
newFontId := closestPatternHandle getFontOnDisplayId:displayId. |
|
981 |
newFontId notNil ifTrue:[ |
|
982 |
"/ Good, this font exists!! |
|
7559 | 983 |
device isNil ifTrue:[ |
984 |
deviceFont := self. |
|
985 |
] ifFalse:[ |
|
986 |
deviceFont := self copy. |
|
987 |
]. |
|
7525 | 988 |
closestPatternHandle := nil. |
7559 | 989 |
deviceFont setDevice:aGraphicsDevice patternId:nil fontId:newFontId. |
990 |
aGraphicsDevice registerFont:deviceFont. |
|
991 |
RecentlyUsedFonts addFirst:deviceFont. |
|
992 |
^ deviceFont. |
|
7525 | 993 |
]. |
994 |
]. |
|
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
995 |
] ensure:[ |
7525 | 996 |
myPatternHandle notNil ifTrue:[myPatternHandle destroy]. |
997 |
closestPatternHandle notNil ifTrue:[closestPatternHandle destroy]. |
|
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
998 |
]. |
7114 | 999 |
^ aBlock value |
6176 | 1000 |
|
1001 |
" |
|
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1002 |
(XftFontDescription family:'monospace' size:16) onDevice:Screen current |
6176 | 1003 |
" |
1004 |
||
1005 |
"Modified: / 14-04-1997 / 18:22:31 / cg" |
|
6190
d651313d4044
Fixes to share XftFontDescription instances.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6189
diff
changeset
|
1006 |
"Modified: / 02-01-2014 / 23:43:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7559 | 1007 |
! |
1008 |
||
1009 |
sameDeviceFontAs:aFont |
|
1010 |
^ (super sameDeviceFontAs:aFont) and:[device == aFont graphicsDevice] |
|
6176 | 1011 |
! ! |
1012 |
||
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1013 |
!XftFontDescription methodsFor:'initialization'! |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1014 |
|
6963 | 1015 |
initialize |
1016 |
"Invoked when a new instance is created." |
|
1017 |
||
1018 |
super initialize. |
|
1019 |
size := 0. |
|
1020 |
encoding := #'iso10646-1'. |
|
1021 |
! |
|
1022 |
||
6993 | 1023 |
isScaledFont |
1024 |
^ true |
|
1025 |
! |
|
1026 |
||
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1027 |
setDevice: deviceArg patternId: patternIdArg fontId: fontIdArg |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1028 |
device := deviceArg. |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1029 |
fontId := fontIdArg. |
6325 | 1030 |
patternIdArg notNil ifTrue:[ |
7114 | 1031 |
family := patternIdArg get: FC_FAMILY index: 0. |
1032 |
size := patternIdArg get: FC_SIZE index: 0. |
|
1033 |
face := patternIdArg get: FC_WEIGHT index: 0. |
|
1034 |
face := StXFace2FCWeightMap keyAtValue: face. |
|
1035 |
style := patternIdArg get: FC_SLANT index: 0. |
|
1036 |
style := StXStyle2FCSlantMap keyAtValue: style. |
|
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1037 |
|
7114 | 1038 |
"/ name:= patternIdArg get: 'fullname' index: 0. |
1039 |
"/ encoding:= patternIdArg get: 'encoding' index: 0. |
|
6957 | 1040 |
]. |
1041 |
size isNil ifTrue:[ |
|
7114 | 1042 |
size := 0. |
6325 | 1043 |
]. |
6963 | 1044 |
encoding isNil ifTrue:[ |
7114 | 1045 |
encoding := #'iso10646-1'. |
6963 | 1046 |
]. |
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1047 |
|
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1048 |
"Created: / 21-12-2013 / 00:46:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6184
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
1049 |
"Modified: / 30-12-2013 / 12:49:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1050 |
! ! |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1051 |
|
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1052 |
!XftFontDescription methodsFor:'primitives'! |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1053 |
|
7114 | 1054 |
xftFontClose:fontIdArg displayId:displayId |
6936 | 1055 |
| error | |
1056 |
||
7114 | 1057 |
%{ /* STACK: 64000 */ |
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1058 |
#ifdef XFT |
7114 | 1059 |
int v; |
1060 |
if ( ! __isExternalAddressLike(fontIdArg) ) { |
|
7221 | 1061 |
error = @symbol(BadArg1); |
1062 |
goto err; |
|
6936 | 1063 |
} |
7114 | 1064 |
if ( ! __isExternalAddressLike(displayId) ) { |
7221 | 1065 |
error = @symbol(BadArg2); |
1066 |
goto err; |
|
6936 | 1067 |
} |
7114 | 1068 |
XftFontClose (DISPLAY(displayId), XFT_FONT(fontIdArg)); |
6936 | 1069 |
RETURN(self); |
1070 |
err:; |
|
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1071 |
#endif |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1072 |
%}. |
6936 | 1073 |
self primitiveFailed: error |
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1074 |
! |
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1075 |
|
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1076 |
xftFontGetAscent: fontIdArg |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1077 |
| error | |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1078 |
|
7114 | 1079 |
%{ /* STACK: 64000 */ |
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1080 |
#ifdef XFT |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1081 |
int v; |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1082 |
if ( ! __isExternalAddressLike(fontIdArg) ) { |
7221 | 1083 |
error = @symbol(BadArg1); |
1084 |
goto err; |
|
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1085 |
} |
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1086 |
v = XFT_FONT(fontIdArg)->ascent; |
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1087 |
RETURN ( __MKINT( v ) ); |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1088 |
err:; |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1089 |
#endif |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1090 |
%}. |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1091 |
self primitiveFailed: error |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1092 |
|
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1093 |
"Created: / 21-12-2013 / 00:56:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1094 |
! |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1095 |
|
6198 | 1096 |
xftFontGetDescent:fontIdArg |
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1097 |
| error | |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1098 |
|
7114 | 1099 |
%{ /* STACK: 64000 */ |
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1100 |
#ifdef XFT |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1101 |
int v; |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1102 |
if ( ! __isExternalAddressLike(fontIdArg) ) { |
7221 | 1103 |
error = @symbol(BadArg1); |
1104 |
goto err; |
|
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1105 |
} |
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1106 |
v = XFT_FONT(fontIdArg)->descent; |
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1107 |
RETURN ( __MKINT( v ) ); |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1108 |
err:; |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1109 |
#endif |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1110 |
%}. |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1111 |
self primitiveFailed: error |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1112 |
|
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1113 |
"Created: / 21-12-2013 / 00:56:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1114 |
! |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1115 |
|
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1116 |
xftFontGetHeight: fontIdArg |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1117 |
| error | |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1118 |
|
7114 | 1119 |
%{ /* STACK: 64000 */ |
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1120 |
#ifdef XFT |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1121 |
int v; |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1122 |
if ( ! __isExternalAddressLike(fontIdArg) ) { |
7221 | 1123 |
error = @symbol(BadArg1); |
1124 |
goto err; |
|
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1125 |
} |
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1126 |
v = XFT_FONT(fontIdArg)->height; |
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1127 |
RETURN ( __MKINT( v ) ); |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1128 |
err:; |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1129 |
#endif |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1130 |
%}. |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1131 |
self primitiveFailed: error |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1132 |
|
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1133 |
"Created: / 21-12-2013 / 00:56:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1134 |
! |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1135 |
|
6186
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1136 |
xftFontGetMaxAdvanceWidth: fontIdArg |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1137 |
| error | |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1138 |
|
7114 | 1139 |
%{ /* STACK: 64000 */ |
6186
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1140 |
#ifdef XFT |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1141 |
int v; |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1142 |
if ( ! __isExternalAddressLike(fontIdArg) ) { |
7221 | 1143 |
error = @symbol(BadArg1); |
1144 |
goto err; |
|
6186
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1145 |
} |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1146 |
v = XFT_FONT(fontIdArg)->max_advance_width; |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1147 |
RETURN ( __MKINT( v ) ); |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1148 |
err:; |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1149 |
#endif |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1150 |
%}. |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1151 |
self primitiveFailed: error |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1152 |
|
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1153 |
"Created: / 30-12-2013 / 20:02:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1154 |
! |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1155 |
|
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1156 |
xftFontGetPattern: fontIdArg |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1157 |
| error | |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1158 |
|
7114 | 1159 |
%{ /* STACK: 64000 */ |
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1160 |
#ifdef XFT |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1161 |
XftPattern* p; |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1162 |
if ( ! __isExternalAddressLike(fontIdArg) ) { |
7221 | 1163 |
error = @symbol(BadArg1); |
1164 |
goto err; |
|
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1165 |
} |
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1166 |
p = XFT_FONT(fontIdArg)->pattern; |
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1167 |
if (p == NULL) { |
7221 | 1168 |
RETURN ( nil ); |
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1169 |
} else { |
7221 | 1170 |
RETURN ( FC_PATTERN_HANDLE_NEW ( p ) ); |
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1171 |
} |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1172 |
err:; |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1173 |
#endif |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1174 |
%}. |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1175 |
self primitiveFailed: error |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1176 |
|
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1177 |
"Created: / 21-12-2013 / 00:55:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1178 |
! |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1179 |
|
7563 | 1180 |
xftTextExtents:displayIdArg string:aString from:start to:stop into:extentsArrayOrNil |
1181 |
"get the extents of aString. |
|
1182 |
Answer thr width of aString (in reality the xOff). |
|
1183 |
If extentArrayOrNil is an Array, fill is with the extent info: |
|
1184 |
#(width height x y xOff yOff)." |
|
1185 |
||
1186 |
|error bytesPerCharacter| |
|
1187 |
||
1188 |
bytesPerCharacter := aString bytesPerCharacter. |
|
7114 | 1189 |
|
1190 |
%{ /* STACK: 64000 */ |
|
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1191 |
#ifdef XFT |
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1192 |
XGlyphInfo info; |
6195
9a14f8e6c10c
Added support for wide strings.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6194
diff
changeset
|
1193 |
char *string; |
9a14f8e6c10c
Added support for wide strings.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6194
diff
changeset
|
1194 |
int len; |
7563 | 1195 |
int __bytesPerCharacter = __intVal(bytesPerCharacter); |
6195
9a14f8e6c10c
Added support for wide strings.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6194
diff
changeset
|
1196 |
|
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1197 |
if ( ! __isExternalAddressLike(displayIdArg) ) { |
7563 | 1198 |
error = @symbol(BadArg1); |
1199 |
goto err; |
|
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1200 |
} |
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1201 |
if ( ! __isSmallInteger(start) ) { |
7563 | 1202 |
error = @symbol(BadArg3); |
1203 |
goto err; |
|
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1204 |
} |
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1205 |
if ( ! __isSmallInteger(stop) ) { |
7563 | 1206 |
error = @symbol(BadArg4); |
1207 |
goto err; |
|
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1208 |
} |
7563 | 1209 |
if ( ! __isExternalAddressLike(__INST(fontId)) ) { |
1210 |
error = @symbol(BadFontId); |
|
1211 |
goto err; |
|
1212 |
} |
|
1213 |
||
1214 |
string = __stringVal(aString) + ((__intVal(start) - 1) * __bytesPerCharacter); |
|
6195
9a14f8e6c10c
Added support for wide strings.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6194
diff
changeset
|
1215 |
len = __intVal(stop) - __intVal(start) + 1; |
9a14f8e6c10c
Added support for wide strings.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6194
diff
changeset
|
1216 |
|
7563 | 1217 |
switch (__bytesPerCharacter) { |
6195
9a14f8e6c10c
Added support for wide strings.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6194
diff
changeset
|
1218 |
case 1: |
7563 | 1219 |
XftTextExtents8(DISPLAY(displayIdArg), XFT_FONT(__INST(fontId)), (FcChar8*)string, len, &info); |
1220 |
break; |
|
6195
9a14f8e6c10c
Added support for wide strings.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6194
diff
changeset
|
1221 |
case 2: |
7563 | 1222 |
XftTextExtents16(DISPLAY(displayIdArg), XFT_FONT(__INST(fontId)), (FcChar16*)string, len, &info); |
1223 |
break; |
|
6195
9a14f8e6c10c
Added support for wide strings.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6194
diff
changeset
|
1224 |
case 4: |
7563 | 1225 |
XftTextExtents32(DISPLAY(displayIdArg), XFT_FONT(__INST(fontId)), (FcChar32*)string, len, &info); |
1226 |
break; |
|
1227 |
default: |
|
1228 |
error = @symbol(BadArg2); |
|
1229 |
goto err; |
|
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1230 |
} |
7563 | 1231 |
|
1232 |
if (extentsArrayOrNil != nil && __isArray(extentsArrayOrNil)) { |
|
1233 |
switch (__arraySize(extentsArrayOrNil)) { |
|
1234 |
case 6: |
|
1235 |
__arrayVal(extentsArrayOrNil)[5] = __MKSMALLINT(info.yOff); |
|
1236 |
case 5: |
|
1237 |
__arrayVal(extentsArrayOrNil)[4] = __MKSMALLINT(info.xOff); |
|
1238 |
case 4: |
|
1239 |
__arrayVal(extentsArrayOrNil)[3] = __MKSMALLINT(info.y); |
|
1240 |
case 3: |
|
1241 |
__arrayVal(extentsArrayOrNil)[2] = __MKSMALLINT(info.x); |
|
1242 |
case 2: |
|
1243 |
__arrayVal(extentsArrayOrNil)[1] = __MKSMALLINT(info.height); |
|
1244 |
case 1: |
|
1245 |
__arrayVal(extentsArrayOrNil)[0] = __MKSMALLINT(info.width); |
|
1246 |
} |
|
1247 |
} |
|
1248 |
||
1249 |
RETURN(__MKSMALLINT(info.xOff)); |
|
1250 |
||
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1251 |
err:; |
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1252 |
#endif |
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1253 |
%}. |
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1254 |
error notNil ifTrue:[ |
7563 | 1255 |
self primitiveFailed: error. |
1256 |
^ nil. |
|
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1257 |
]. |
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1258 |
|
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1259 |
"Created: / 21-12-2013 / 10:42:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6186
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1260 |
"Modified: / 30-12-2013 / 20:00:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1261 |
! ! |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1262 |
|
6198 | 1263 |
!XftFontDescription methodsFor:'printing & storing'! |
1264 |
||
1265 |
storeOn:aStream |
|
1266 |
"append a character sequence to the argument, aStream from which the |
|
1267 |
receiver can be reconstructed using readFrom:." |
|
1268 |
||
1269 |
aStream nextPutAll:'(XftFontDescription family:'. family storeOn:aStream. |
|
1270 |
aStream nextPutAll:' face:'. face storeOn:aStream. |
|
1271 |
aStream nextPutAll:' style:'. style storeOn:aStream. |
|
1272 |
aStream nextPutAll:' size:'. size storeOn:aStream. |
|
1273 |
aStream nextPutAll:' encoding:'. encoding storeOn:aStream. |
|
1274 |
aStream nextPut:$) |
|
1275 |
||
1276 |
" |
|
1277 |
(XftFontDescription family: 'DejaVu Sans' size: 8) storeString |
|
1278 |
" |
|
1279 |
! ! |
|
1280 |
||
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1281 |
!XftFontDescription methodsFor:'queries-dimensions'! |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1282 |
|
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1283 |
ascent |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1284 |
"return the ascent - the number of pixels above the baseLine." |
6656 | 1285 |
ascent isNil ifTrue:[ |
6707 | 1286 |
ascent := self xftFontGetAscent: fontId |
6656 | 1287 |
]. |
1288 |
^ ascent |
|
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1289 |
|
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1290 |
"Created: / 21-12-2013 / 01:19:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1291 |
! |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1292 |
|
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1293 |
descent |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1294 |
"return the descent - the number of pixels below the baseLine." |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1295 |
|
6656 | 1296 |
descent isNil ifTrue:[ |
6707 | 1297 |
descent := self xftFontGetDescent: fontId |
6656 | 1298 |
]. |
1299 |
^ descent |
|
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1300 |
|
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1301 |
"Created: / 21-12-2013 / 01:20:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1302 |
! |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1303 |
|
6314 | 1304 |
getFontMetrics |
1305 |
|info| |
|
1306 |
||
1307 |
info := DeviceWorkstation::DeviceFontMetrics new. |
|
1308 |
info |
|
1309 |
ascent:self ascent |
|
1310 |
descent:self descent |
|
1311 |
maxAscent:self maxAscent |
|
1312 |
maxDescent:self maxDescent |
|
1313 |
minWidth:self maxWidth |
|
1314 |
maxWidth:self maxWidth |
|
1315 |
avgWidth:self maxWidth |
|
1316 |
minCode:self minCode |
|
1317 |
maxCode:self maxCode |
|
1318 |
direction:#LeftToRight. |
|
1319 |
^ info |
|
1320 |
! |
|
1321 |
||
6543 | 1322 |
getFontResolution |
1323 |
device isNil ifTrue:[ ^ 72 @ 72 ]. |
|
1324 |
^ device resolution |
|
1325 |
! |
|
1326 |
||
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1327 |
height |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1328 |
"return the height - the number of pixels above plus below the baseLine." |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1329 |
|
6656 | 1330 |
height isNil ifTrue:[ |
6707 | 1331 |
height := self xftFontGetHeight: fontId |
6656 | 1332 |
]. |
1333 |
^ height |
|
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1334 |
|
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1335 |
"Created: / 21-12-2013 / 01:20:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1336 |
! |
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1337 |
|
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1338 |
isFixedWidth |
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1339 |
"return true, if this is a fixed pitch font (i.e. all characters |
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1340 |
are of the same width)" |
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1341 |
|
7342 | 1342 |
fixedWidth isNil ifTrue:[ |
1343 |
(device notNil and:[fontId notNil]) ifTrue:[ |
|
1344 |
|w| |
|
1345 |
||
1346 |
"/ take some obvously different chars |
|
1347 |
w := self widthOf:'.'. |
|
1348 |
((self widthOf:'i') == w |
|
1349 |
and:[ (self widthOf:'W') == w |
|
1350 |
and:[ (self widthOf:' ') == w ]] |
|
1351 |
) ifTrue:[ |
|
1352 |
fixedWidth := w. |
|
1353 |
] ifFalse:[ |
|
1354 |
fixedWidth := false |
|
1355 |
] |
|
1356 |
] |
|
1357 |
]. |
|
1358 |
^ fixedWidth notNil and:[fixedWidth isInteger] |
|
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1359 |
|
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1360 |
"Created: / 21-12-2013 / 10:38:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1361 |
! |
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1362 |
|
6186
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1363 |
maxAscent |
7342 | 1364 |
"return the font's maximum-ascent (i.e. the maximum of all characters); |
6186
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1365 |
That is the number of units (usually pixels) above the baseline." |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1366 |
|
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1367 |
^ self ascent |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1368 |
|
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1369 |
"Created: / 30-12-2013 / 20:01:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1370 |
! |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1371 |
|
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1372 |
maxDescent |
7342 | 1373 |
"return the font's maximum-descent (i.e. the maximum of all characters); |
6186
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1374 |
That is the number of units (usually pixels) below the baseline." |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1375 |
|
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1376 |
^ self descent |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1377 |
|
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1378 |
"Created: / 30-12-2013 / 20:01:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1379 |
! |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1380 |
|
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1381 |
maxWidth |
7342 | 1382 |
"return the font's maximum-width character (i.e. the maximum of all characters); |
6186
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1383 |
That is a number of units (usually pixels)." |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1384 |
|
7342 | 1385 |
(fixedWidth class == SmallInteger) ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
1386 |
^ fixedWidth |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
1387 |
]. |
6186
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1388 |
^ self xftFontGetMaxAdvanceWidth: fontId |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1389 |
|
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1390 |
"Created: / 30-12-2013 / 20:02:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1391 |
! |
c8f36970419f
Added missing & required methods. Since now, while St/X IDE could be switched to use XFT fonts.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6185
diff
changeset
|
1392 |
|
7114 | 1393 |
patternStringForId:patternIdArg |
1394 |
|name family size pixelSize face style encoding foundry width| |
|
1395 |
||
1396 |
patternIdArg notNil ifTrue:[ |
|
1397 |
foundry := patternIdArg get: FC_FOUNDRY index: 0. |
|
1398 |
family := patternIdArg get: FC_FAMILY index: 0. |
|
1399 |
size := patternIdArg get: FC_SIZE index: 0. |
|
1400 |
pixelSize := patternIdArg get: FC_PIXEL_SIZE index: 0. |
|
1401 |
face := patternIdArg get: FC_WEIGHT index: 0. |
|
1402 |
face := StXFace2FCWeightMap keyAtValue: face. |
|
1403 |
style := patternIdArg get: FC_SLANT index: 0. |
|
1404 |
style := StXStyle2FCSlantMap keyAtValue: style. |
|
1405 |
width := patternIdArg get: FC_WIDTH index: 0. |
|
1406 |
||
1407 |
name:= patternIdArg get: 'fullname' index: 0. |
|
1408 |
||
1409 |
encoding:= patternIdArg get: 'encoding' index: 0. |
|
1410 |
]. |
|
1411 |
||
1412 |
^ '%8-%1-%2-%3-%4pt/%5px-%6-%9 (%7)' bindWith:family with:face with:style with:size with:pixelSize with:encoding with:name |
|
1413 |
with:foundry with:width. |
|
1414 |
! |
|
1415 |
||
7342 | 1416 |
width |
1417 |
"return the font's characters width; |
|
1418 |
That is a number of units (usually pixels). |
|
1419 |
For variable pitch fonts, the width of the space character is returned. |
|
1420 |
For fixed fonts, this is the same as minWidth or maxWidth (or any character). |
|
1421 |
The receiver must be associated to a device, for this query to be legal." |
|
1422 |
||
1423 |
fixedWidth class == SmallInteger ifTrue:[ |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
1424 |
^ fixedWidth |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
1425 |
]. |
7342 | 1426 |
^ self widthOf:' ' |
1427 |
||
1428 |
"Modified: 30.4.1996 / 16:43:45 / cg" |
|
1429 |
! |
|
1430 |
||
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1431 |
widthOf:aString from:start to:stop |
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1432 |
"return the width of a sub string" |
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1433 |
|
6187
cfe33a9940ee
Memory/performance optimization - use stack-allocated XftColor.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6186
diff
changeset
|
1434 |
(stop < start) ifTrue:[^ 0]. |
7342 | 1435 |
(fixedWidth class == SmallInteger) ifTrue:[ |
7563 | 1436 |
^ fixedWidth * (stop - start + 1) |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
1437 |
]. |
7563 | 1438 |
^ self xftTextExtents:device displayId string:aString from:start to:stop into:nil. |
6182
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1439 |
|
8bf2372670d9
Fixes to make XftFontDescription>>example1 to render something. Sometimes it segfaults
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6180
diff
changeset
|
1440 |
"Created: / 21-12-2013 / 10:42:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6183
a21827076de1
Fix for bad layout and segfault when selecting whole line.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6182
diff
changeset
|
1441 |
"Modified: / 29-12-2013 / 21:16:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1442 |
! ! |
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
1443 |
|
6200
8f0d25eec888
class: XftFontDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6199
diff
changeset
|
1444 |
!XftFontDescription methodsFor:'release'! |
8f0d25eec888
class: XftFontDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6199
diff
changeset
|
1445 |
|
7114 | 1446 |
disassociateXftDrawableFrom:drawableId |
1447 |
"Disassociate the XftDrawable from drawableId. |
|
1448 |
This mist be done before the drawable is destroyed, |
|
1449 |
otherwise the XftDrawable is destroyed together with the drawable, |
|
1450 |
and X11 errors will be signaled." |
|
1451 |
||
1452 |
sharedDrawId notNil ifTrue:[ |
|
7221 | 1453 |
sharedDrawId disassociateFrom:drawableId. |
7114 | 1454 |
]. |
1455 |
! |
|
1456 |
||
6200
8f0d25eec888
class: XftFontDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6199
diff
changeset
|
1457 |
releaseDrawIfAssociatedWith: view |
8f0d25eec888
class: XftFontDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6199
diff
changeset
|
1458 |
| drawableId | |
8f0d25eec888
class: XftFontDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6199
diff
changeset
|
1459 |
|
8f0d25eec888
class: XftFontDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6199
diff
changeset
|
1460 |
view isNil ifTrue:[ ^ self ]. |
8f0d25eec888
class: XftFontDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6199
diff
changeset
|
1461 |
drawableId := view id. |
8f0d25eec888
class: XftFontDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6199
diff
changeset
|
1462 |
drawableId isNil ifTrue: [ ^ self ]. |
7221 | 1463 |
%{ /* STACK: 64000 */ |
6200
8f0d25eec888
class: XftFontDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6199
diff
changeset
|
1464 |
#ifdef XFT |
6365
cf89c4bedea4
Instvar drawId renamed to sharedDrawId.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6356
diff
changeset
|
1465 |
if ( __INST(sharedDrawId) != nil ) { |
6963 | 1466 |
XftDraw *xftDrawable = XFT_DRAW(__INST(sharedDrawId)); |
1467 |
||
1468 |
if (XftDrawDrawable(xftDrawable) == DRAWABLE(drawableId)) { |
|
6393 | 1469 |
__INST(sharedDrawId) = nil; |
6963 | 1470 |
XftDrawDestroy(xftDrawable); |
6393 | 1471 |
} |
6200
8f0d25eec888
class: XftFontDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6199
diff
changeset
|
1472 |
} |
6339 | 1473 |
RETURN (self); |
6200
8f0d25eec888
class: XftFontDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6199
diff
changeset
|
1474 |
#endif |
8f0d25eec888
class: XftFontDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6199
diff
changeset
|
1475 |
%}. |
8f0d25eec888
class: XftFontDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6199
diff
changeset
|
1476 |
self primitiveFailed |
8f0d25eec888
class: XftFontDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6199
diff
changeset
|
1477 |
|
8f0d25eec888
class: XftFontDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6199
diff
changeset
|
1478 |
"Created: / 12-01-2014 / 19:48:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8f0d25eec888
class: XftFontDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6199
diff
changeset
|
1479 |
"Modified: / 12-01-2014 / 22:09:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6344 | 1480 |
! |
1481 |
||
1482 |
releaseFromDevice |
|
1483 |
"I am no longer available on the device" |
|
1484 |
||
6946 | 1485 |
Lobby unregister:self. |
7055 | 1486 |
"/ cg: no, xftDrawDestroy should not be done. |
1487 |
"/ (releaseFromDevice is called when either the display connection |
|
1488 |
"/ is lost, or a snapshot image is restarted) |
|
1489 |
"/ self xftDrawDestroy. |
|
6946 | 1490 |
|
6344 | 1491 |
device := nil. |
1492 |
fontId := nil. |
|
6365
cf89c4bedea4
Instvar drawId renamed to sharedDrawId.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6356
diff
changeset
|
1493 |
sharedDrawId := nil. |
6200
8f0d25eec888
class: XftFontDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6199
diff
changeset
|
1494 |
! ! |
8f0d25eec888
class: XftFontDescription
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6199
diff
changeset
|
1495 |
|
6319 | 1496 |
!XftFontDescription methodsFor:'testing'! |
1497 |
||
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
1498 |
isAlienFont |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
1499 |
"my GraphicsContext knows how to disply strings in my font" |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
1500 |
|
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
1501 |
^ false |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
1502 |
! |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7342
diff
changeset
|
1503 |
|
6339 | 1504 |
isUsed |
6365
cf89c4bedea4
Instvar drawId renamed to sharedDrawId.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6356
diff
changeset
|
1505 |
^ sharedDrawId notNil |
6339 | 1506 |
! |
1507 |
||
6319 | 1508 |
isXftFont |
1509 |
^ true |
|
1510 |
! ! |
|
1511 |
||
7116 | 1512 |
!XftFontDescription::FCFontListParser class methodsFor:'api'! |
1513 |
||
1514 |
listOfAvailableFonts |
|
1515 |
^ self new listOfAvailableFonts |
|
1516 |
||
1517 |
" |
|
1518 |
self listOfAvailableFonts |
|
1519 |
" |
|
1520 |
! ! |
|
1521 |
||
6264 | 1522 |
!XftFontDescription::FCFontListParser class methodsFor:'documentation'! |
1523 |
||
1524 |
documentation |
|
1525 |
" |
|
1526 |
parses fc-list output to get a list of XftFontDescriptions |
|
1527 |
||
1528 |
[author:] |
|
6319 | 1529 |
cg |
6264 | 1530 |
|
1531 |
[instance variables:] |
|
1532 |
||
1533 |
[class variables:] |
|
1534 |
||
1535 |
[see also:] |
|
1536 |
||
1537 |
" |
|
1538 |
! ! |
|
1539 |
||
6263 | 1540 |
!XftFontDescription::FCFontListParser methodsFor:'api'! |
1541 |
||
1542 |
listOfAvailableFonts |
|
7116 | 1543 |
|readEntry list fcListProg| |
6263 | 1544 |
|
1545 |
list := OrderedCollection new. |
|
1546 |
||
7116 | 1547 |
readEntry := [ |
7488 | 1548 |
|key line| |
6263 | 1549 |
|
7488 | 1550 |
[ |
1551 |
line := pipeStream nextLine. |
|
1552 |
] doUntil:[(line startsWith:'Pattern has') or:[Transcript showCR:line. false]]. |
|
6263 | 1553 |
|
7488 | 1554 |
currentDescription := XftFontDescription new. |
1555 |
[line := pipeStream nextLine. line notEmptyOrNil] whileTrue:[ |
|
1556 |
"/ Transcript showCR:l. |
|
1557 |
lineStream := line readStream. lineStream skipSeparators. |
|
1558 |
key := ('fc_', (lineStream upTo:$:)) asSymbolIfInterned. |
|
1559 |
( |
|
1560 |
#(fc_family fc_style fc_slant fc_weight fc_width |
|
1561 |
fc_pixelsize fc_spacing fc_foundry fc_antialias |
|
1562 |
fc_file fc_outline fc_scalable fc_charset fc_lang |
|
1563 |
fc_fontversion fc_fontformat fc_decorative fc_index |
|
1564 |
fc_outline fc_familylang fc_stylelang fc_fullname |
|
1565 |
fc_fullnamelang fc_capability fc_hash fc_postscriptname |
|
1566 |
fc_symbol fc_color |
|
1567 |
) includesIdentical:key |
|
1568 |
) ifTrue:[ |
|
1569 |
self perform:key. |
|
1570 |
] ifFalse:[ |
|
1571 |
Transcript show:'Xft ignored line: '; showCR:line. |
|
1572 |
]. |
|
1573 |
]. |
|
1574 |
list add:currentDescription |
|
1575 |
]. |
|
6319 | 1576 |
|
6337 | 1577 |
fcListProg := #('/usr/bin/fc-list' '/usr/X11/bin/fc-list') detect:[:eachProg| |
7488 | 1578 |
eachProg asFilename isExecutableProgram |
1579 |
] ifNone:[ |
|
1580 |
'XftFontDescription [warning]: fc-list program not found - no XFT fonts' errorPrintCR. |
|
1581 |
^ list. |
|
1582 |
]. |
|
6337 | 1583 |
|
1584 |
pipeStream := PipeStream readingFrom:fcListProg, ' -v'. |
|
6263 | 1585 |
[ |
7488 | 1586 |
[pipeStream atEnd] whileFalse:[ |
1587 |
readEntry value. |
|
1588 |
] |
|
6263 | 1589 |
] ensure:[ |
7488 | 1590 |
pipeStream close |
6263 | 1591 |
]. |
1592 |
^ list |
|
1593 |
||
1594 |
" |
|
6337 | 1595 |
FCFontListParser new listOfAvailableFonts |
6263 | 1596 |
" |
1597 |
! ! |
|
1598 |
||
1599 |
!XftFontDescription::FCFontListParser methodsFor:'font list keywords'! |
|
1600 |
||
1601 |
fc_antialias |
|
1602 |
"helper for font listing" |
|
1603 |
||
6319 | 1604 |
currentDescription isAntialiasedFont:(self getBoolean). |
6263 | 1605 |
! |
1606 |
||
1607 |
fc_charset |
|
1608 |
"helper for font listing" |
|
1609 |
||
6319 | 1610 |
|page bits l min max minCode maxCode| |
6263 | 1611 |
|
1612 |
[ l := pipeStream nextLine. l notEmpty ] whileTrue:[ |
|
7221 | 1613 |
"/ Transcript show:'->'; showCR:l. |
1614 |
(l startsWith:Character tab) ifFalse:[ |
|
1615 |
(l startsWith:'(') ifFalse:[self halt]. |
|
1616 |
currentDescription minCode:minCode; maxCode:maxCode. |
|
1617 |
^ self. |
|
1618 |
]. |
|
6264 | 1619 |
|
7221 | 1620 |
lineStream := l readStream. |
1621 |
lineStream skipSeparators. |
|
1622 |
page := Integer readFrom:(lineStream upTo:$:) radix:16. |
|
1623 |
lineStream next. |
|
1624 |
bits := 0 to:7 collect:[:i| |
|
1625 |
lineStream skipSeparators. |
|
1626 |
Integer readFrom:(lineStream upToSeparator) radix:16. |
|
1627 |
]. |
|
1628 |
min := (page * 256 + 0). |
|
1629 |
max := (page * 256 + 255). |
|
1630 |
minCode isNil ifTrue:[ |
|
1631 |
minCode := min. |
|
1632 |
maxCode := max. |
|
1633 |
] ifFalse:[ |
|
1634 |
minCode := minCode min:min. |
|
1635 |
maxCode := maxCode max:max. |
|
1636 |
]. |
|
6263 | 1637 |
]. |
6365
cf89c4bedea4
Instvar drawId renamed to sharedDrawId.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6356
diff
changeset
|
1638 |
"/ currentDescription characterSet:(self getString). |
7116 | 1639 |
currentDescription minCode:minCode; maxCode:maxCode. |
6263 | 1640 |
! |
1641 |
||
6319 | 1642 |
fc_decorative |
6263 | 1643 |
"helper for font listing" |
1644 |
||
6319 | 1645 |
currentDescription isDecorativeFont:(self getBoolean). |
6263 | 1646 |
! |
1647 |
||
1648 |
fc_family |
|
1649 |
"helper for font listing" |
|
1650 |
||
6319 | 1651 |
currentDescription family:(self getString). |
6263 | 1652 |
! |
1653 |
||
6319 | 1654 |
fc_file |
6263 | 1655 |
"helper for font listing" |
1656 |
||
6319 | 1657 |
currentDescription file:(self getString). |
6263 | 1658 |
! |
1659 |
||
1660 |
fc_fontformat |
|
1661 |
"helper for font listing" |
|
1662 |
||
6319 | 1663 |
currentDescription fontFormat:(self getString). |
6263 | 1664 |
! |
1665 |
||
1666 |
fc_fontversion |
|
1667 |
"helper for font listing" |
|
1668 |
||
6319 | 1669 |
currentDescription fontVersion:(self getInteger). |
6263 | 1670 |
! |
1671 |
||
1672 |
fc_foundry |
|
1673 |
"helper for font listing" |
|
1674 |
||
7121 | 1675 |
|foundry| |
1676 |
||
1677 |
foundry := self getString. |
|
7221 | 1678 |
foundry ~= 'unknown' ifTrue:[ |
1679 |
currentDescription foundry:foundry. |
|
7121 | 1680 |
]. |
6263 | 1681 |
! |
1682 |
||
6264 | 1683 |
fc_fullname |
1684 |
"helper for font listing" |
|
1685 |
||
7121 | 1686 |
currentDescription name:self getString. |
6264 | 1687 |
! |
1688 |
||
6263 | 1689 |
fc_outline |
1690 |
"helper for font listing" |
|
1691 |
||
6319 | 1692 |
currentDescription isOutlineFont:(self getBoolean). |
6263 | 1693 |
! |
1694 |
||
1695 |
fc_pixelsize |
|
1696 |
"helper for font listing" |
|
1697 |
||
6325 | 1698 |
currentDescription setPixelSize:(self getInteger). |
1699 |
currentDescription setSizeUnit:#px. |
|
1700 |
"/ currentDescription setSize:(self getInteger). |
|
1701 |
"/ currentDescription setSizeUnit:#pt. |
|
6263 | 1702 |
! |
1703 |
||
1704 |
fc_scalable |
|
1705 |
"helper for font listing" |
|
1706 |
||
6957 | 1707 |
currentDescription isScalableFont:self getBoolean. |
6263 | 1708 |
! |
1709 |
||
1710 |
fc_slant |
|
1711 |
"helper for font listing" |
|
1712 |
||
6319 | 1713 |
currentDescription slant:(self getInteger). |
6263 | 1714 |
! |
1715 |
||
1716 |
fc_spacing |
|
1717 |
"helper for font listing" |
|
1718 |
||
6319 | 1719 |
currentDescription spacing:(self getInteger). |
6263 | 1720 |
! |
1721 |
||
1722 |
fc_style |
|
1723 |
"helper for font listing" |
|
1724 |
||
6319 | 1725 |
|xftStyle| |
1726 |
||
7121 | 1727 |
xftStyle := self getString asLowercase. |
1728 |
(xftStyle includesString:'italic') ifTrue:[ |
|
7221 | 1729 |
currentDescription style:#italic. |
1730 |
^ self. |
|
6319 | 1731 |
]. |
7121 | 1732 |
(xftStyle includesString:'oblique') ifTrue:[ |
7221 | 1733 |
currentDescription style:#oblique. |
1734 |
^ self. |
|
7121 | 1735 |
]. |
1736 |
currentDescription style:#roman. |
|
6263 | 1737 |
! |
1738 |
||
1739 |
fc_weight |
|
1740 |
"helper for font listing" |
|
1741 |
||
6319 | 1742 |
currentDescription weight:(self getInteger). |
6263 | 1743 |
! |
1744 |
||
1745 |
fc_width |
|
1746 |
"helper for font listing" |
|
1747 |
||
6319 | 1748 |
currentDescription width:(self getInteger). |
6263 | 1749 |
! ! |
1750 |
||
7488 | 1751 |
!XftFontDescription::FCFontListParser methodsFor:'font list keywords - ignored'! |
1752 |
||
1753 |
fc_capability |
|
1754 |
"helper for font listing" |
|
1755 |
||
1756 |
"currentDescription capability:" (self getString). |
|
1757 |
! |
|
1758 |
||
1759 |
fc_color |
|
1760 |
"helper for font listing - ignored for now" |
|
1761 |
||
1762 |
"currentDescription isColorFont:"(self getBoolean). |
|
1763 |
! |
|
1764 |
||
1765 |
fc_familylang |
|
1766 |
"helper for font listing" |
|
1767 |
||
1768 |
"currentDescription familylang:" (self getString). |
|
1769 |
! |
|
1770 |
||
1771 |
fc_fullnamelang |
|
1772 |
"helper for font listing" |
|
1773 |
||
1774 |
"currentDescription fullnamelang:" (self getString). |
|
1775 |
! |
|
1776 |
||
1777 |
fc_hash |
|
1778 |
"helper for font listing" |
|
1779 |
||
1780 |
"currentDescription hash:" self getString. |
|
1781 |
! |
|
1782 |
||
1783 |
fc_index |
|
1784 |
"helper for font listing" |
|
1785 |
||
1786 |
"currentDescription index:" (self getInteger). |
|
1787 |
! |
|
1788 |
||
1789 |
fc_lang |
|
1790 |
"helper for font listing" |
|
1791 |
||
1792 |
"/ currentDescription characterSet:(self getString). |
|
1793 |
! |
|
1794 |
||
1795 |
fc_postscriptname |
|
1796 |
"helper for font listing" |
|
1797 |
||
1798 |
"currentDescription postscriptname:" self getString. |
|
1799 |
! |
|
1800 |
||
1801 |
fc_stylelang |
|
1802 |
"helper for font listing" |
|
1803 |
||
1804 |
"currentDescription stylelang:" (self getString). |
|
1805 |
! |
|
1806 |
||
1807 |
fc_symbol |
|
1808 |
"helper for font listing - ignored for now" |
|
1809 |
||
1810 |
"currentDescription isSymbolFont:"(self getBoolean). |
|
1811 |
! ! |
|
1812 |
||
6263 | 1813 |
!XftFontDescription::FCFontListParser methodsFor:'helpers'! |
1814 |
||
6319 | 1815 |
getBoolean |
6263 | 1816 |
"helper for font listing" |
1817 |
||
1818 |
|s| |
|
1819 |
||
1820 |
lineStream skipSeparators. |
|
6319 | 1821 |
s := lineStream nextAlphaNumericWord. |
6957 | 1822 |
^ (s indexOfSubCollection:'True') ~~ 0. "/ match at least 'True' and 'FCTrue' |
6963 | 1823 |
|
1824 |
" |
|
7114 | 1825 |
'xxFalse' indexOfSubCollection:'True' |
1826 |
'FcTrue' indexOfSubCollection:'True' |
|
6963 | 1827 |
" |
6263 | 1828 |
! |
1829 |
||
6264 | 1830 |
getInteger |
1831 |
"helper for font listing" |
|
1832 |
||
1833 |
lineStream skipSeparators. |
|
6319 | 1834 |
^ Integer readFrom:lineStream. |
6264 | 1835 |
! |
1836 |
||
6319 | 1837 |
getString |
6263 | 1838 |
"helper for font listing" |
1839 |
||
7116 | 1840 |
lineStream skipThrough:$". |
1841 |
^ lineStream upTo:$". |
|
6263 | 1842 |
! ! |
1843 |
||
7114 | 1844 |
!XftFontDescription::FCPatternHandle class methodsFor:'instance creation'! |
1845 |
||
1846 |
create |
|
1847 |
^ self new create |
|
1848 |
||
1849 |
" |
|
1850 |
self new create destroy |
|
1851 |
" |
|
1852 |
! ! |
|
1853 |
||
1854 |
!XftFontDescription::FCPatternHandle methodsFor:'primitives'! |
|
1855 |
||
1856 |
add:attribute value: value |
|
1857 |
"Add a value to the specified pattern element after existing values" |
|
1858 |
||
1859 |
^ self add: attribute value: value append: true. |
|
1860 |
! |
|
1861 |
||
1862 |
add:attribute value: value append: append |
|
1863 |
"Add a value to the specified pattern element. If 'append' is true, the value |
|
1864 |
is added after existing values, otherwise it is added before them." |
|
1865 |
||
1866 |
| error | |
|
1867 |
||
7221 | 1868 |
%{ /* STACK: 64000 */ |
7114 | 1869 |
#ifdef XFT |
1870 |
XftValue v; |
|
1871 |
Bool b; |
|
1872 |
||
1873 |
if (__INST(address_) == 0) { |
|
1874 |
error = @symbol(NullReceiver); |
|
1875 |
goto err; |
|
1876 |
} |
|
1877 |
if ( ! __isStringLike ( attribute ) ) { |
|
1878 |
error = @symbol(BadArg1); |
|
1879 |
goto err; |
|
1880 |
} |
|
1881 |
if ( append != true && append != false ) { |
|
1882 |
error = @symbol(BadArg3); |
|
1883 |
goto err; |
|
1884 |
} |
|
1885 |
if ( __isStringLike ( value ) ) { |
|
1886 |
v.type = FcTypeString; |
|
1887 |
/* Passing pointer inside Smalltalk should be safe, |
|
1888 |
* Xft/FontConfig libraries seem to allocate and store |
|
1889 |
* a __copy__ of the string (if I understood the code correctly) |
|
1890 |
*/ |
|
1891 |
v.u.s = __stringVal( value); |
|
1892 |
} else if ( __isSmallInteger( value ) ) { |
|
1893 |
v.type = XftTypeInteger; |
|
1894 |
v.u.i = (int)__intVal( value ); |
|
1895 |
} else if ( value == true || value == false ) { |
|
1896 |
v.type = XftTypeBool; |
|
1897 |
v.u.b = value == true ? True : False; |
|
1898 |
} else if ( __isFloat ( value ) ) { |
|
1899 |
v.type = XftTypeDouble; |
|
1900 |
v.u.d = __floatVal( value ); |
|
1901 |
} else if ( value == nil ) { |
|
1902 |
v.type = XftTypeVoid; |
|
1903 |
v.u.f = NULL; |
|
1904 |
} else { |
|
1905 |
error = @symbol(BadArg2); |
|
1906 |
goto err; |
|
1907 |
} |
|
1908 |
b = XftPatternAdd((XftPattern*)__INST(address_), __stringVal(attribute), v, append == true ? True : False ); |
|
1909 |
RETURN ( b == True ? true : false ); |
|
1910 |
||
1911 |
err:; |
|
1912 |
#endif |
|
1913 |
%}. |
|
1914 |
self primitiveFailed: error |
|
1915 |
||
1916 |
"Created: / 20-12-2013 / 21:50:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1917 |
! |
|
1918 |
||
1919 |
create |
|
1920 |
%{ |
|
1921 |
#ifdef XFT |
|
1922 |
__INST(address_) = (void *)XftPatternCreate(); |
|
1923 |
#endif |
|
1924 |
%}. |
|
1925 |
! |
|
1926 |
||
1927 |
delete: pattern attribute: attribute |
|
1928 |
| error | |
|
7221 | 1929 |
%{ /* STACK: 64000 */ |
7114 | 1930 |
#ifdef XFT |
1931 |
if (__INST(address_) == 0) { |
|
7221 | 1932 |
error = @symbol(BadHandle); |
1933 |
goto err; |
|
7114 | 1934 |
} |
1935 |
if ( ! __isStringLike ( attribute ) ) { |
|
7221 | 1936 |
error = @symbol(BadArg1); |
1937 |
goto err; |
|
7114 | 1938 |
} |
1939 |
XftPatternDel( (XftPattern*)__INST(address_), __stringVal ( attribute ) ); |
|
1940 |
RETURN ( self ); |
|
1941 |
||
1942 |
err:; |
|
1943 |
#endif |
|
1944 |
%}. |
|
1945 |
self primitiveFailed: error |
|
1946 |
! |
|
1947 |
||
1948 |
destroy |
|
7221 | 1949 |
%{ /* STACK: 64000 */ |
7114 | 1950 |
#ifdef XFT |
1951 |
if (__INST(address_) != 0) { |
|
1952 |
XftPatternDestroy((XftPattern*)__INST(address_)); |
|
1953 |
__INST(address_) = 0; |
|
1954 |
RETURN ( self ); |
|
1955 |
} |
|
1956 |
#endif |
|
1957 |
%}. |
|
1958 |
self primitiveFailed. |
|
1959 |
! |
|
1960 |
||
1961 |
duplicate |
|
1962 |
| error | |
|
1963 |
%{ |
|
1964 |
#ifdef XFT |
|
1965 |
if (__INST(address_) != 0) { |
|
1966 |
RETURN (FC_PATTERN_HANDLE_NEW((XftPattern*)__INST(address_))); |
|
1967 |
RETURN ( self ); |
|
1968 |
} |
|
1969 |
#endif |
|
1970 |
%}. |
|
1971 |
self primitiveFailed |
|
1972 |
! |
|
1973 |
||
1974 |
get:attribute index: index |
|
1975 |
"Return a value from the specified element -- multiple values can be indexed |
|
1976 |
with 'index' starting at zero." |
|
1977 |
||
1978 |
| error | |
|
1979 |
||
7221 | 1980 |
%{ /* STACK: 64000 */ |
7114 | 1981 |
#ifdef XFT |
1982 |
XftValue v; |
|
1983 |
XftResult r; |
|
1984 |
||
1985 |
if (__INST(address_) == 0) { |
|
1986 |
error = @symbol(NullReceiver); |
|
1987 |
goto err; |
|
1988 |
} |
|
1989 |
if ( ! __isStringLike ( attribute ) ) { |
|
1990 |
error = @symbol(BadArg1); |
|
1991 |
goto err; |
|
1992 |
} |
|
1993 |
if ( ! __isSmallInteger( index ) ) { |
|
1994 |
error = @symbol(BadArg2); |
|
1995 |
goto err; |
|
1996 |
} |
|
1997 |
r = XftPatternGet((XftPattern*)__INST(address_), __stringVal( attribute ), __intVal( index ), &v); |
|
1998 |
if ( r != XftResultMatch) { |
|
1999 |
RETURN ( nil ); |
|
2000 |
} |
|
2001 |
if ( v.type == XftTypeString) { |
|
2002 |
RETURN ( __MKSTRING(v.u.s) ); |
|
2003 |
} else if ( v.type == XftTypeInteger ) { |
|
2004 |
RETURN ( __MKINT (v.u.i) ); |
|
2005 |
} else if ( v.type == XftTypeBool ) { |
|
2006 |
RETURN ( v.u.b == True ? true : false ); |
|
2007 |
} else if ( v.type == XftTypeDouble ) { |
|
2008 |
RETURN ( __MKFLOAT (v.u.d) ); |
|
2009 |
} else if ( v.type == XftTypeVoid ) { |
|
2010 |
RETURN ( nil ); |
|
2011 |
} else { |
|
2012 |
error = @symbol(UnssuportedTypeValue); |
|
2013 |
goto err; |
|
2014 |
} |
|
2015 |
err:; |
|
2016 |
#endif |
|
2017 |
%}. |
|
2018 |
self primitiveFailed: error |
|
2019 |
! |
|
2020 |
||
2021 |
getFontOnDisplayId:displayId |
|
2022 |
"Note: the pattern is destroyed when the font is closed" |
|
2023 |
||
2024 |
| error | |
|
2025 |
||
2026 |
%{ /* STACK: 64000 */ |
|
2027 |
#ifdef XFT |
|
2028 |
XftFont* f; |
|
2029 |
if (!__isExternalAddressLike(displayId) ) { |
|
7221 | 2030 |
error = @symbol(BadArg1); |
2031 |
goto err; |
|
7114 | 2032 |
} |
2033 |
if (__INST(address_) == 0) { |
|
7221 | 2034 |
error = @symbol(BadHandle); |
2035 |
goto err; |
|
7114 | 2036 |
} |
2037 |
||
2038 |
f = XftFontOpenPattern(DISPLAY(displayId), (XftPattern*)__INST(address_)); |
|
2039 |
if (f == NULL) { |
|
7221 | 2040 |
RETURN (nil); |
7114 | 2041 |
} else { |
7221 | 2042 |
RETURN (XFT_FONT_HANDLE_NEW(f)); |
7114 | 2043 |
} |
2044 |
err:; |
|
2045 |
#endif |
|
2046 |
%}. |
|
2047 |
self primitiveFailed: error |
|
2048 |
||
2049 |
"Created: / 20-12-2013 / 23:53:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2050 |
! |
|
2051 |
||
2052 |
matchFontOnDisplayId:displayId screen:screen |
|
2053 |
| error | |
|
2054 |
||
2055 |
%{ /* STACK: 64000 */ |
|
2056 |
#ifdef XFT |
|
2057 |
XftPattern *p; |
|
2058 |
XftResult r; |
|
2059 |
||
2060 |
if (!__isExternalAddressLike(displayId)) { |
|
7221 | 2061 |
error = @symbol(BadArg1); |
2062 |
goto err; |
|
7114 | 2063 |
} |
2064 |
if (!__isSmallInteger( screen) ) { |
|
7221 | 2065 |
error = @symbol(BadArg2); |
2066 |
goto err; |
|
7114 | 2067 |
} |
2068 |
if (__INST(address_) == 0) { |
|
7221 | 2069 |
error = @symbol(BadHandle); |
2070 |
goto err; |
|
7114 | 2071 |
} |
2072 |
||
2073 |
// Already done in match: |
|
2074 |
// XftConfigSubstitute(FC_PATTERN( patternId )); |
|
2075 |
// XftDefaultSubstitute(DISPLAY(displayId), SCREEN( screen ), FC_PATTERN( patternId )); |
|
2076 |
p = XftFontMatch(DISPLAY(displayId), SCREEN(screen), (XftPattern*)__INST(address_), &r); |
|
2077 |
if (p) { |
|
7221 | 2078 |
RETURN (FC_PATTERN_HANDLE_NEW(p) ); |
7114 | 2079 |
} else { |
7221 | 2080 |
error = @symbol(XftFontMatchReturnedNull); |
7114 | 2081 |
} |
2082 |
err:; |
|
2083 |
#endif |
|
2084 |
%}. |
|
2085 |
self primitiveFailed: error |
|
2086 |
||
2087 |
"Created: / 21-12-2013 / 00:08:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2088 |
! ! |
|
2089 |
||
2090 |
!XftFontDescription::XftDrawHandle class methodsFor:'instance creation'! |
|
2091 |
||
2092 |
createForDisplayId:displayId screen:screen drawable:drawableId |
|
2093 |
^ self new createForDisplayId:displayId screen:screen drawable:drawableId |
|
2094 |
! ! |
|
2095 |
||
2096 |
!XftFontDescription::XftDrawHandle methodsFor:'primitives'! |
|
2097 |
||
2098 |
createForDisplayId:displayId screen:screen drawable:drawableId |
|
2099 |
| error | |
|
2100 |
||
2101 |
%{ /* STACK: 64000 */ |
|
2102 |
#ifdef XFT |
|
2103 |
if ( ! __isExternalAddressLike(displayId) ) { |
|
7221 | 2104 |
error = @symbol(BadArg1); |
2105 |
goto err; |
|
7114 | 2106 |
} |
2107 |
if ( ! __isSmallInteger(screen) ) { |
|
7221 | 2108 |
error = @symbol(BadArg2); |
2109 |
goto err; |
|
7114 | 2110 |
} |
2111 |
if ( ! __isExternalAddressLike(drawableId) ) { |
|
7221 | 2112 |
error = @symbol(BadArg3); |
2113 |
goto err; |
|
7114 | 2114 |
} |
2115 |
__INST(address_) = (void *) XftDrawCreate ( DISPLAY(displayId) , |
|
7221 | 2116 |
DRAWABLE(drawableId) , |
2117 |
DefaultVisual(DISPLAY(displayId), SCREEN (screen)) , |
|
2118 |
DefaultColormap(DISPLAY(displayId), SCREEN (screen))); |
|
7114 | 2119 |
err:; |
2120 |
#endif |
|
2121 |
%}. |
|
2122 |
self primitiveFailed: error |
|
2123 |
||
2124 |
"Created: / 21-12-2013 / 21:12:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2125 |
! |
|
2126 |
||
2127 |
destroy |
|
2128 |
%{ /* STACK: 64000 */ |
|
2129 |
#ifdef XFT |
|
2130 |
if (__INST(address_) != 0) { |
|
7221 | 2131 |
XftDrawDestroy((XftDraw*)__INST(address_)); |
2132 |
__INST(address_) = 0; |
|
2133 |
RETURN ( self ); |
|
7114 | 2134 |
} |
2135 |
#endif |
|
2136 |
%}. |
|
2137 |
self primitiveFailed. |
|
2138 |
! |
|
2139 |
||
2140 |
disassociateFrom:drawableId |
|
2141 |
"Disassociate the XftDrawable from drawableId. |
|
2142 |
This mist be done before the drawable is destroyed, |
|
2143 |
otherwise the XftDrawable is destroyed together with the drawable, |
|
2144 |
and X11 errors will be signaled." |
|
2145 |
||
2146 |
| error | |
|
2147 |
||
2148 |
%{ /* STACK: 64000 */ |
|
2149 |
#ifdef XFT |
|
2150 |
if (__INST(address_) == 0) { |
|
7221 | 2151 |
// nothing to disasassociate from... |
2152 |
RETURN(self); |
|
7114 | 2153 |
} |
2154 |
if (!__isExternalAddressLike(drawableId)) { |
|
7221 | 2155 |
error = @symbol(BadArg); |
2156 |
goto err; |
|
7114 | 2157 |
} |
2158 |
if (XftDrawDrawable((XftDraw*)__INST(address_)) == DRAWABLE(drawableId)) { |
|
7221 | 2159 |
XftDrawChange((XftDraw*)__INST(address_), None); |
7114 | 2160 |
} |
2161 |
RETURN(self); |
|
2162 |
err:; |
|
2163 |
#endif |
|
2164 |
%}. |
|
2165 |
self primitiveFailed: error |
|
2166 |
||
2167 |
"Created: / 26-12-2013 / 12:17:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2168 |
! |
|
2169 |
||
2170 |
drawChange:drawableId |
|
2171 |
| error | |
|
2172 |
||
2173 |
%{ /* STACK: 64000 */ |
|
2174 |
#ifdef XFT |
|
2175 |
if (drawableId == nil) { |
|
7221 | 2176 |
XftDrawChange((XftDraw*)__INST(address_), None); |
2177 |
RETURN (self); |
|
7114 | 2178 |
} |
2179 |
if (!__isExternalAddressLike(drawableId)) { |
|
7221 | 2180 |
error = @symbol(BadArg1); |
2181 |
goto err; |
|
7114 | 2182 |
} |
2183 |
if (XftDrawDrawable((XftDraw*)__INST(address_)) != DRAWABLE( drawableId)) { |
|
7221 | 2184 |
XftDrawChange((XftDraw*)__INST(address_), DRAWABLE( drawableId)); |
7114 | 2185 |
} |
2186 |
RETURN (self); |
|
2187 |
err:; |
|
2188 |
#endif |
|
2189 |
%}. |
|
2190 |
self primitiveFailed: error |
|
2191 |
||
2192 |
"Created: / 26-12-2013 / 12:17:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2193 |
! |
|
2194 |
||
2195 |
drawRectWithColor:aColor x:x y:y width:w height:h |
|
2196 |
| error r g b a pix | |
|
2197 |
||
2198 |
aColor isColor ifFalse:[^self primitiveFailed: #BadArg1]. |
|
2199 |
||
2200 |
r := aColor scaledRed. |
|
2201 |
g := aColor scaledGreen. |
|
2202 |
b := aColor scaledBlue. |
|
2203 |
a := aColor alpha * 65535. |
|
2204 |
r isNil ifTrue:[ |
|
7221 | 2205 |
"/ when drawing into a pixmap... |
2206 |
aColor colorId == 0 ifTrue:[ |
|
2207 |
r := g := b := 0. |
|
2208 |
] ifFalse:[ |
|
2209 |
r := g := b := 16rFFFF. |
|
2210 |
] |
|
7114 | 2211 |
]. |
2212 |
pix := aColor colorId. |
|
2213 |
%{ /* STACK: 64000 */ |
|
2214 |
#ifdef XFT |
|
2215 |
XftColor clr; |
|
2216 |
||
2217 |
if (__INST(address_) == 0) { |
|
7221 | 2218 |
error = @symbol(BadHandle); |
2219 |
goto err; |
|
7114 | 2220 |
} |
2221 |
if (!__isSmallInteger(pix)) { |
|
7221 | 2222 |
error = @symbol(BadColorId); |
2223 |
goto err; |
|
7114 | 2224 |
} |
2225 |
if (!__isSmallInteger(x)) { |
|
7221 | 2226 |
error = @symbol(BadArg2); |
2227 |
goto err; |
|
7114 | 2228 |
} |
2229 |
if (! __isSmallInteger(y)) { |
|
7221 | 2230 |
error = @symbol(BadArg3); |
2231 |
goto err; |
|
7114 | 2232 |
} |
2233 |
if (!__isSmallInteger(w)) { |
|
7221 | 2234 |
error = @symbol(BadArg4); |
2235 |
goto err; |
|
7114 | 2236 |
} |
2237 |
if (!__isSmallInteger(h)) { |
|
7221 | 2238 |
error = @symbol(BadArg5); |
2239 |
goto err; |
|
7114 | 2240 |
} |
2241 |
clr.pixel = (unsigned long)__intVal(pix); |
|
2242 |
clr.color.red = __intVal(r); |
|
2243 |
clr.color.green = __intVal(g); |
|
2244 |
clr.color.blue = __intVal(b); |
|
2245 |
clr.color.alpha = __intVal(a); |
|
2246 |
||
2247 |
XftDrawRect((XftDraw*)__INST(address_), &clr, |
|
7221 | 2248 |
__intVal(x), __intVal(y), __intVal(w) ,__intVal(h)); |
7114 | 2249 |
|
2250 |
RETURN (self); |
|
2251 |
err:; |
|
2252 |
#endif |
|
2253 |
%}. |
|
2254 |
self primitiveFailed: error. |
|
2255 |
||
2256 |
"Created: / 28-12-2013 / 23:35:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2257 |
"Modified: / 31-12-2013 / 00:37:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2258 |
! |
|
2259 |
||
2260 |
drawString:aString color:aColor font:fontIdArg x:x y:y from:start to:stop |
|
2261 |
| error r g b a pix | |
|
2262 |
||
2263 |
aColor isColor ifFalse:[^self primitiveFailed: #BadArg2]. |
|
2264 |
||
2265 |
pix := aColor colorId. |
|
2266 |
r := aColor scaledRed. |
|
2267 |
r isNil ifTrue:[ |
|
7221 | 2268 |
"/ when drawing into a pixmap... |
2269 |
pix == 0 ifTrue:[ |
|
2270 |
r := g := b := a := 0. |
|
2271 |
] ifFalse:[ |
|
2272 |
r := g := b := a := 16rFFFF. |
|
2273 |
] |
|
7114 | 2274 |
] ifFalse:[ |
7221 | 2275 |
g := aColor scaledGreen. |
2276 |
b := aColor scaledBlue. |
|
2277 |
a := aColor alpha * 65535. |
|
7114 | 2278 |
]. |
2279 |
%{ /* STACK: 64000 */ |
|
2280 |
#ifdef XFT |
|
2281 |
int _start, _stop; |
|
2282 |
int __x, __y; |
|
2283 |
XftColor clr; |
|
2284 |
||
2285 |
if (__INST(address_) == 0) { |
|
7221 | 2286 |
error = @symbol(BadHandle); |
2287 |
goto err; |
|
7114 | 2288 |
} |
2289 |
if ( ! __isSmallInteger(pix) ) { |
|
7221 | 2290 |
error = @symbol(BadColorId); |
2291 |
goto err; |
|
7114 | 2292 |
} |
2293 |
if ( ! __isSmallInteger(x) ) { |
|
7221 | 2294 |
error = @symbol(BadArg4); |
2295 |
goto err; |
|
7114 | 2296 |
} |
2297 |
__x = __intVal(x); |
|
2298 |
if ( ! __isSmallInteger(y) ) { |
|
7221 | 2299 |
error = @symbol(BadArg5); |
2300 |
goto err; |
|
7114 | 2301 |
} |
2302 |
__y = __intVal(y); |
|
2303 |
||
2304 |
||
2305 |
if ( ! __isSmallInteger(start) ) { |
|
7221 | 2306 |
error = @symbol(BadArg6); |
2307 |
goto err; |
|
7114 | 2308 |
} |
2309 |
_start = __intVal(start); |
|
2310 |
if ( ! __isSmallInteger(stop) ) { |
|
7221 | 2311 |
error = @symbol(BadArg7); |
2312 |
goto err; |
|
7114 | 2313 |
} |
2314 |
_stop = __intVal(stop); |
|
2315 |
||
2316 |
clr.pixel = (unsigned long)__intVal(pix); |
|
2317 |
clr.color.red = __intVal(r); |
|
2318 |
clr.color.green = __intVal(g); |
|
2319 |
clr.color.blue = __intVal(b); |
|
2320 |
clr.color.alpha = __intVal(a); |
|
2321 |
||
2322 |
if ( __isStringLike(aString) ) { |
|
7221 | 2323 |
XftDrawString8((XftDraw*)__INST(address_), &clr, XFT_FONT(fontIdArg), |
2324 |
__x, __y, |
|
2325 |
__stringVal(aString) + (_start - 1), _stop - _start + 1); |
|
2326 |
RETURN ( self ); |
|
7114 | 2327 |
} else { |
7221 | 2328 |
error = @symbol(BadArg1); |
2329 |
goto err; |
|
7114 | 2330 |
} |
2331 |
err:; |
|
2332 |
#endif |
|
2333 |
%}. |
|
2334 |
self primitiveFailed: error. |
|
2335 |
||
2336 |
"Created: / 28-12-2013 / 12:32:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2337 |
"Modified: / 30-12-2013 / 20:00:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2338 |
! |
|
2339 |
||
2340 |
setClipRect:rect |
|
2341 |
| error xObj yObj wObj hObj | |
|
2342 |
||
2343 |
rect notNil ifTrue:[ |
|
7221 | 2344 |
xObj := rect left. |
2345 |
yObj := rect top. |
|
2346 |
wObj := rect width. |
|
2347 |
hObj := rect height. |
|
7114 | 2348 |
]. |
2349 |
%{ /* STACK: 64000 */ |
|
2350 |
#ifdef XFT |
|
2351 |
if (__INST(address_) == 0) { |
|
7221 | 2352 |
error = @symbol(BadHandle); |
2353 |
goto err; |
|
7114 | 2354 |
} |
2355 |
if (rect != nil) { |
|
7221 | 2356 |
XRectangle r; |
7114 | 2357 |
|
7221 | 2358 |
r.x = __intVal(xObj); |
2359 |
r.y = __intVal(yObj); |
|
2360 |
r.width = __intVal(wObj); |
|
2361 |
r.height = __intVal(hObj); |
|
2362 |
XftDrawSetClipRectangles((XftDraw*)__INST(address_), 0, 0, &r, 1); |
|
7114 | 2363 |
} else { |
7221 | 2364 |
XftDrawSetClipRectangles((XftDraw*)__INST(address_), 0, 0, (XRectangle*)NULL, 0); |
7114 | 2365 |
} |
2366 |
RETURN ( self ); |
|
2367 |
err:; |
|
2368 |
#endif |
|
2369 |
%}. |
|
2370 |
self primitiveFailed: error. |
|
2371 |
||
2372 |
"Created: / 31-12-2013 / 01:24:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2373 |
! ! |
|
2374 |
||
6176 | 2375 |
!XftFontDescription class methodsFor:'documentation'! |
2376 |
||
2377 |
version |
|
6936 | 2378 |
^ '$Header$' |
6176 | 2379 |
! |
2380 |
||
2381 |
version_CVS |
|
6936 | 2382 |
^ '$Header$' |
6176 | 2383 |
! ! |
6180
6034bf4c5022
More work on XftFontDescription.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6179
diff
changeset
|
2384 |
|
6184
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
2385 |
|
997414d312b5
Fixed font lookup to take face (aka weight) and style (aka slant) into an account).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6183
diff
changeset
|
2386 |
XftFontDescription initialize! |