author | Claus Gittinger <cg@exept.de> |
Sat, 20 Jun 1998 17:04:25 +0200 | |
changeset 2164 | 2bd89f5166a9 |
parent 2160 | b57a3f138ae3 |
child 2436 | 4ef8d33c8951 |
permissions | -rw-r--r-- |
52 | 1 |
" |
2 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
89 | 3 |
All Rights Reserved |
52 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
Object subclass:#FontDescription |
|
1275 | 14 |
instanceVariableNames:'family face style size encoding manufacturer name flags masks |
15 |
pixelSize' |
|
1265
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
16 |
classVariableNames:'BoldnessMask FixedFlag ItalicFlag OutlineFlag SerifFlag |
1275 | 17 |
ShadowFlag StrikeoutFlag UnderlineFlag' |
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
18 |
poolDictionaries:'' |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
19 |
category:'Graphics-Support' |
52 | 20 |
! |
21 |
||
1275 | 22 |
!FontDescription class methodsFor:'documentation'! |
52 | 23 |
|
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
89 | 27 |
All Rights Reserved |
52 | 28 |
|
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
38 |
documentation |
|
39 |
" |
|
40 |
FontDescription is just a place-holder for scanned font names. |
|
41 |
||
611 | 42 |
[Instance variables:] |
43 |
family <String> the fonts family ('courier', 'helvetica' etc) |
|
44 |
face <String> the fonts face ('bold', 'medium' etc) |
|
45 |
style <String> the fonts style ('roman', 'italic', 'oblique') |
|
46 |
size <String> the fonts size (not in pixels) |
|
47 |
encoding <Symbol> the fonts encoding (usually #iso8859) |
|
48 |
||
1265
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
49 |
manufacturer <nil|String|Array> |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
50 |
the fonts origin - if known |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
51 |
name <nil|String|Array> |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
52 |
the platform specific name |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
53 |
|
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
54 |
flags <SmallInteger> holds serif/italic etc. as flag bits |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
55 |
masks <SmallInteger> currently dummy; to allow ST-80 compatible subclassing |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
56 |
pixelSize <SmallInteger> currently dummy; to allow ST-80 compatible subclassing |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
57 |
|
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
58 |
[class variables:] |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
59 |
BoldnessMask currently dummy; to allow ST-80 compatible subclassing |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
60 |
FixedFlag currently dummy; to allow ST-80 compatible subclassing |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
61 |
ItalicFlag currently dummy; to allow ST-80 compatible subclassing |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
62 |
OutlineFlag currently dummy; to allow ST-80 compatible subclassing |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
63 |
SerifFlag currently dummy; to allow ST-80 compatible subclassing |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
64 |
ShadowFlag currently dummy; to allow ST-80 compatible subclassing |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
65 |
StrikeoutFlag currently dummy; to allow ST-80 compatible subclassing |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
66 |
UnderlineFlag currently dummy; to allow ST-80 compatible subclassing |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
67 |
|
611 | 68 |
[author:] |
69 |
Claus Gittinger |
|
629 | 70 |
|
71 |
[see also:] |
|
72 |
Font |
|
73 |
FontPanel |
|
74 |
GraphicsContext |
|
75 |
( introduction to view programming :html: programming/viewintro.html#FONTS ) |
|
52 | 76 |
" |
77 |
! ! |
|
78 |
||
1265
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
79 |
!FontDescription class methodsFor:'initialization'! |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
80 |
|
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
81 |
initialize |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
82 |
"initialize class variables" |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
83 |
|
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
84 |
BoldnessMask := 2r0000000111. "/ allows for 8 boldnesses to be encoded |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
85 |
FixedFlag := 2r0000001000. |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
86 |
ItalicFlag := 2r0000010000. |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
87 |
OutlineFlag := 2r0000100000. |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
88 |
SerifFlag := 2r0001000000. |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
89 |
ShadowFlag := 2r0010000000. |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
90 |
StrikeoutFlag := 2r0100000000. |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
91 |
UnderlineFlag := 2r1000000000. |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
92 |
! ! |
c8030e99f941
added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents:
1071
diff
changeset
|
93 |
|
1275 | 94 |
!FontDescription class methodsFor:'instance creation'! |
52 | 95 |
|
153 | 96 |
family:familyString |
97 |
"returns a font for given family and default (12pt) size |
|
98 |
with unspecified encoding. |
|
629 | 99 |
The new fonts face defaults `medium', its style to `roman'. |
153 | 100 |
The returned font is not associated to a specific device" |
101 |
||
102 |
^ self family:familyString |
|
629 | 103 |
face:'medium' |
104 |
style:'roman' |
|
105 |
size:12 |
|
106 |
encoding:nil |
|
153 | 107 |
|
108 |
" |
|
109 |
Font family:'helvetica' |
|
110 |
Font family:'courier' |
|
111 |
" |
|
629 | 112 |
|
113 |
"Modified: 30.4.1996 / 17:20:44 / cg" |
|
153 | 114 |
! |
115 |
||
109 | 116 |
family:familyString face:faceString size:sizeNum |
117 |
"returns a font for given family and size with unspecified encoding. |
|
629 | 118 |
The new fonts style defaults to `roman'. |
109 | 119 |
The returned font is not associated to a specific device" |
120 |
||
121 |
^ self family:familyString |
|
629 | 122 |
face:faceString |
123 |
style:'roman' |
|
124 |
size:sizeNum |
|
125 |
encoding:nil |
|
109 | 126 |
|
127 |
" |
|
128 |
Font family:'helvetica' face:'medium' size:10 |
|
129 |
Font family:'helvetica' face:'bold' size:10 |
|
130 |
Font family:'courier' face:'bold' size:10 |
|
131 |
" |
|
629 | 132 |
|
133 |
"Modified: 30.4.1996 / 17:21:07 / cg" |
|
109 | 134 |
! |
135 |
||
136 |
family:familyString face:faceString style:styleString size:sizeNum |
|
137 |
"returns a font for given family, face, style and size with |
|
138 |
unspecified encoding. |
|
139 |
The returned font is not associated to a specific device" |
|
140 |
||
141 |
^ self family:familyString |
|
142 |
face:faceString |
|
143 |
style:styleString |
|
144 |
size:sizeNum |
|
145 |
encoding:nil |
|
146 |
||
147 |
" |
|
148 |
Font family:'helvetica' face:'medium' style:'roman' size:10 |
|
149 |
Font family:'helvetica' face:'medium' style:'italic' size:10 |
|
150 |
Font family:'helvetica' face:'bold' style:'roman' size:10 |
|
151 |
Font family:'courier' face:'bold' style:'italic' size:10 |
|
152 |
" |
|
153 |
! |
|
154 |
||
52 | 155 |
family:familyString face:faceString style:styleString size:sizeNum encoding:encodingSym |
576 | 156 |
"returns a font for given family, face, style, size and |
157 |
the specified encoding. |
|
158 |
The returned font is not associated to a specific device" |
|
159 |
||
52 | 160 |
^ self new |
576 | 161 |
family:familyString |
162 |
face:faceString |
|
163 |
style:styleString |
|
164 |
size:sizeNum |
|
165 |
encoding:encodingSym |
|
166 |
||
167 |
"Modified: 20.4.1996 / 23:19:04 / cg" |
|
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
168 |
! |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
169 |
|
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
170 |
family:familyString size:sizeNum |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
171 |
"returns a font for given family and size with unspecified encoding. |
629 | 172 |
The new fonts face defaults to `medium', its style to `roman'. |
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
173 |
The returned font is not associated to a specific device" |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
174 |
|
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
175 |
^ self family:familyString |
629 | 176 |
face:'medium' |
177 |
style:'roman' |
|
178 |
size:sizeNum |
|
179 |
encoding:nil |
|
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
180 |
|
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
181 |
" |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
182 |
Font family:'helvetica' size:10 |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
183 |
Font family:'courier' size:10 |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
184 |
" |
629 | 185 |
|
186 |
"Modified: 30.4.1996 / 17:21:40 / cg" |
|
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
187 |
! |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
188 |
|
1071 | 189 |
family:familyString style:aStyle size:sizeNum |
190 |
"returns a font for given family and size with unspecified encoding. |
|
191 |
The new fonts face defaults to `medium', its style to `roman'. |
|
192 |
The returned font is not associated to a specific device" |
|
193 |
||
194 |
^ self family:familyString |
|
195 |
face:'medium' |
|
196 |
style:aStyle |
|
197 |
size:sizeNum |
|
198 |
encoding:nil |
|
199 |
||
200 |
" |
|
201 |
Font family:'helvetica' style:#roman size:48 |
|
202 |
Font family:'courier' style:#roman size:10 |
|
203 |
" |
|
204 |
||
205 |
"Modified: 30.4.1996 / 17:21:40 / cg" |
|
206 |
"Created: 8.10.1996 / 18:33:55 / cg" |
|
207 |
! |
|
208 |
||
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
209 |
name:aFontName |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
210 |
"returns a font with the given explicit name. |
629 | 211 |
WARNING: |
212 |
You shuld not use explicit naming, since font names vary |
|
213 |
with operatingSystems, devices and architecture. |
|
214 |
||
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
215 |
This interface is provided for special purposes only. |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
216 |
On X, the name given should be according the X fontname conventions; |
629 | 217 |
i.e. something like: '-*-times-bold-r-normal-*-*-240-*-*-*-*-iso8859-1'. |
218 |
||
219 |
On other devices, font naming may be completely different." |
|
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
220 |
|
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
221 |
^ self family:aFontName |
629 | 222 |
face:nil |
223 |
style:nil |
|
224 |
size:nil |
|
225 |
encoding:nil |
|
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
226 |
|
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
227 |
" |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
228 |
Font name:'-*-times-bold-r-normal-*-*-240-*-*-*-*-iso8859-1' |
629 | 229 |
Font name:'6x10' |
230 |
Font name:'k14' |
|
231 |
((Font name:'k14') on:Display) encoding |
|
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
232 |
" |
629 | 233 |
|
234 |
"Modified: 30.4.1996 / 17:23:09 / cg" |
|
52 | 235 |
! ! |
236 |
||
1277 | 237 |
!FontDescription methodsFor:'ST-80 compatibility'! |
238 |
||
239 |
boldness:aNumber |
|
240 |
"added for ST-80 compatibility; actually ignored currently" |
|
241 |
||
242 |
|val| |
|
243 |
||
244 |
flags isNil ifTrue:[ |
|
245 |
flags := masks := 0 |
|
246 |
]. |
|
247 |
||
248 |
"/ scale from 0..1 to 0..BoldnessMask |
|
249 |
val := (aNumber max:0.0) min:1.0. |
|
250 |
val := (BoldnessMask * val) rounded. |
|
251 |
||
252 |
flags := flags bitOr:val. |
|
253 |
masks := masks bitOr:BoldnessMask |
|
254 |
||
255 |
"Created: 25.1.1997 / 03:20:05 / cg" |
|
256 |
"Modified: 25.1.1997 / 03:20:47 / cg" |
|
257 |
! |
|
258 |
||
259 |
color:aColor |
|
260 |
"added for ST-80 compatibility; actually ignored currently" |
|
261 |
||
262 |
"Created: 25.1.1997 / 03:21:28 / cg" |
|
263 |
! |
|
264 |
||
1760
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
265 |
encodings:aCollectionOfEncodings |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
266 |
"added for ST-80 compatibility; actually ignored currently" |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
267 |
|
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
268 |
"Created: 20.6.1997 / 09:52:46 / cg" |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
269 |
! |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
270 |
|
1277 | 271 |
fixedWidth:aBoolean |
272 |
"added for ST-80 compatibility; actually ignored currently" |
|
273 |
||
274 |
flags isNil ifTrue:[ |
|
275 |
flags := masks := 0 |
|
276 |
]. |
|
277 |
flags := flags bitOr:FixedFlag. |
|
278 |
masks := masks bitOr:FixedFlag |
|
279 |
||
280 |
"Created: 25.1.1997 / 03:14:06 / cg" |
|
281 |
"Modified: 25.1.1997 / 03:21:03 / cg" |
|
282 |
! |
|
283 |
||
284 |
italic:aBoolean |
|
285 |
"added for ST-80 compatibility; actually ignored currently" |
|
286 |
||
287 |
flags isNil ifTrue:[ |
|
288 |
flags := masks := 0 |
|
289 |
]. |
|
290 |
flags := flags bitOr:ItalicFlag. |
|
291 |
masks := masks bitOr:ItalicFlag |
|
292 |
||
293 |
"Created: 25.1.1997 / 03:15:37 / cg" |
|
294 |
"Modified: 25.1.1997 / 03:20:55 / cg" |
|
295 |
! |
|
296 |
||
1760
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
297 |
outline:aBoolean |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
298 |
"added for ST-80 compatibility; actually ignored currently" |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
299 |
|
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
300 |
flags isNil ifTrue:[ |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
301 |
flags := masks := 0 |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
302 |
]. |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
303 |
flags := flags bitOr:OutlineFlag. |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
304 |
masks := masks bitOr:OutlineFlag |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
305 |
|
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
306 |
"Modified: 25.1.1997 / 03:20:55 / cg" |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
307 |
"Created: 20.6.1997 / 09:50:06 / cg" |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
308 |
! |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
309 |
|
1277 | 310 |
pixelSize:aNumber |
311 |
"added for ST-80 compatibility; actually ignored currently" |
|
312 |
||
313 |
pixelSize := aNumber |
|
314 |
||
315 |
"Modified: 25.1.1997 / 03:20:47 / cg" |
|
316 |
"Created: 25.1.1997 / 03:21:47 / cg" |
|
317 |
! |
|
318 |
||
319 |
serif:aBoolean |
|
320 |
"added for ST-80 compatibility; actually ignored currently" |
|
321 |
||
322 |
flags isNil ifTrue:[ |
|
323 |
flags := masks := 0 |
|
324 |
]. |
|
325 |
flags := flags bitOr:SerifFlag. |
|
326 |
masks := masks bitOr:SerifFlag |
|
327 |
||
328 |
"Created: 25.1.1997 / 03:15:17 / cg" |
|
329 |
"Modified: 25.1.1997 / 03:20:59 / cg" |
|
1760
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
330 |
! |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
331 |
|
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
332 |
shadow:aBoolean |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
333 |
"added for ST-80 compatibility; actually ignored currently" |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
334 |
|
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
335 |
flags isNil ifTrue:[ |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
336 |
flags := masks := 0 |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
337 |
]. |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
338 |
flags := flags bitOr:ShadowFlag. |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
339 |
masks := masks bitOr:ShadowFlag |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
340 |
|
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
341 |
"Modified: 25.1.1997 / 03:20:55 / cg" |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
342 |
"Created: 20.6.1997 / 09:51:03 / cg" |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
343 |
! |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
344 |
|
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
345 |
strikeout:aBoolean |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
346 |
"added for ST-80 compatibility; actually ignored currently" |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
347 |
|
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
348 |
flags isNil ifTrue:[ |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
349 |
flags := masks := 0 |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
350 |
]. |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
351 |
flags := flags bitOr:StrikeoutFlag. |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
352 |
masks := masks bitOr:StrikeoutFlag |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
353 |
|
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
354 |
"Modified: 25.1.1997 / 03:20:55 / cg" |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
355 |
"Created: 20.6.1997 / 09:51:36 / cg" |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
356 |
! |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
357 |
|
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
358 |
underline:aBoolean |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
359 |
"added for ST-80 compatibility; actually ignored currently" |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
360 |
|
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
361 |
flags isNil ifTrue:[ |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
362 |
flags := masks := 0 |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
363 |
]. |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
364 |
flags := flags bitOr:UnderlineFlag. |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
365 |
masks := masks bitOr:UnderlineFlag |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
366 |
|
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
367 |
"Modified: 25.1.1997 / 03:20:55 / cg" |
ccd221469891
more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
368 |
"Created: 20.6.1997 / 09:51:18 / cg" |
1277 | 369 |
! ! |
370 |
||
52 | 371 |
!FontDescription methodsFor:'accessing'! |
372 |
||
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
373 |
encoding |
575 | 374 |
"return the fonts encoding, as a symbol |
456 | 375 |
such as #'iso8859', #'jis0208.1983' or #ascii. |
376 |
If the fonts encoding is not known, return nil; |
|
377 |
You should assume ascii-encoding then." |
|
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
378 |
|
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
379 |
^ encoding |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
380 |
|
575 | 381 |
"Modified: 20.4.1996 / 23:14:36 / cg" |
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
382 |
! |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
383 |
|
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
384 |
face |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
385 |
"return the face, a string" |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
386 |
|
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
387 |
^ face |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
388 |
! |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
389 |
|
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
390 |
family |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
391 |
"return the family, a string" |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
392 |
|
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
393 |
^ family |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
394 |
! |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
395 |
|
1277 | 396 |
family:aString |
397 |
"set the family, a string" |
|
398 |
||
399 |
family := aString |
|
400 |
||
401 |
"Created: 25.1.1997 / 03:12:12 / cg" |
|
402 |
! |
|
403 |
||
89 | 404 |
family:familyString face:faceString style:styleString size:sizeNum encoding:encodingString |
576 | 405 |
"set the instance values" |
406 |
||
89 | 407 |
family := familyString asSymbol. |
229
099543e5d779
handle empty family/style/encoding strings
Claus Gittinger <cg@exept.de>
parents:
219
diff
changeset
|
408 |
(faceString notNil and:[faceString notEmpty]) ifTrue:[ |
576 | 409 |
face := faceString asSymbol. |
89 | 410 |
]. |
229
099543e5d779
handle empty family/style/encoding strings
Claus Gittinger <cg@exept.de>
parents:
219
diff
changeset
|
411 |
(styleString notNil and:[styleString notEmpty]) ifTrue:[ |
576 | 412 |
style := styleString asSymbol. |
89 | 413 |
]. |
52 | 414 |
size := sizeNum. |
229
099543e5d779
handle empty family/style/encoding strings
Claus Gittinger <cg@exept.de>
parents:
219
diff
changeset
|
415 |
(encodingString notNil and:[encodingString notEmpty]) ifTrue:[ |
576 | 416 |
encoding := encodingString asSymbol. |
89 | 417 |
] |
229
099543e5d779
handle empty family/style/encoding strings
Claus Gittinger <cg@exept.de>
parents:
219
diff
changeset
|
418 |
|
576 | 419 |
"Modified: 20.4.1996 / 23:19:25 / cg" |
52 | 420 |
! |
421 |
||
1277 | 422 |
manufacturer |
423 |
"return the value of the instance variable 'manufacturer' (automatically generated)" |
|
424 |
||
425 |
^ manufacturer |
|
426 |
||
427 |
"Created: 25.1.1997 / 03:12:43 / cg" |
|
428 |
! |
|
429 |
||
430 |
manufacturer:something |
|
431 |
"set the value of the instance variable 'manufacturer' (automatically generated)" |
|
432 |
||
433 |
manufacturer := something. |
|
434 |
||
435 |
"Created: 25.1.1997 / 03:12:43 / cg" |
|
436 |
! |
|
437 |
||
52 | 438 |
size |
439 |
"return the size, a number" |
|
440 |
||
441 |
^ size |
|
442 |
! |
|
443 |
||
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
444 |
style |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
445 |
"return the style, a string" |
109 | 446 |
|
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
447 |
^ style |
109 | 448 |
! ! |
449 |
||
450 |
!FontDescription methodsFor:'comparing'! |
|
451 |
||
452 |
= aFont |
|
453 |
"two fonts are considered equal, if the font-name components are; |
|
454 |
independent of the device, the font is on" |
|
455 |
||
456 |
(aFont species == self species) ifTrue:[ |
|
457 |
(size == aFont size) ifTrue:[ |
|
458 |
(family = aFont family) ifTrue:[ |
|
459 |
(face = aFont face) ifTrue:[ |
|
460 |
(style = aFont style) ifTrue:[ |
|
461 |
(encoding == aFont encoding) ifTrue:[ |
|
462 |
^ true |
|
463 |
] |
|
464 |
] |
|
465 |
] |
|
466 |
] |
|
467 |
] |
|
468 |
]. |
|
469 |
^ false |
|
2160 | 470 |
! |
471 |
||
472 |
hash |
|
473 |
"return a number for hashing - req'd since = is redefined." |
|
474 |
||
2164 | 475 |
^ (((family hash + face hash + style hash) bitShift:5) + (size hash)) bitAnd:16r3FFFFFFF |
2160 | 476 |
|
477 |
"Created: / 19.6.1998 / 04:19:06 / cg" |
|
2164 | 478 |
"Modified: / 20.6.1998 / 17:04:00 / cg" |
109 | 479 |
! ! |
480 |
||
481 |
!FontDescription methodsFor:'converting'! |
|
482 |
||
483 |
asBold |
|
484 |
"return the bold font corresponding to the receiver" |
|
485 |
||
486 |
^ self class |
|
487 |
family:family |
|
488 |
face:'bold' |
|
489 |
style:style |
|
490 |
size:size |
|
491 |
encoding:encoding |
|
492 |
! |
|
493 |
||
494 |
asItalic |
|
495 |
"return the italic font corresponding to the receiver" |
|
496 |
||
497 |
^ self class |
|
498 |
family:family |
|
499 |
face:face |
|
500 |
style:'oblique' |
|
501 |
size:size |
|
502 |
encoding:encoding |
|
503 |
! |
|
504 |
||
1740 | 505 |
fromLiteralArrayEncoding:encoding |
506 |
"read my contents from a aLiteralEncodedArray" |
|
507 |
||
508 |
|items groups values| |
|
509 |
||
510 |
family := encoding at:2. |
|
511 |
face := encoding at:3. |
|
512 |
style := encoding at:4. |
|
513 |
size := encoding at:5. |
|
514 |
||
515 |
||
516 |
||
517 |
! |
|
518 |
||
519 |
literalArrayEncoding |
|
520 |
"return myself encoded as a literal array" |
|
521 |
||
522 |
^ Array |
|
523 |
with:self class name asSymbol |
|
524 |
with:family |
|
525 |
with:face |
|
526 |
with:style |
|
527 |
with:size |
|
528 |
||
529 |
! |
|
530 |
||
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
531 |
on:aDevice |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
532 |
"given the receiver, return a device Font" |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
533 |
|
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
534 |
^ (Font |
478
91a8a5889bf2
oops - always returned a bold font
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
535 |
family:family |
91a8a5889bf2
oops - always returned a bold font
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
536 |
face:face |
91a8a5889bf2
oops - always returned a bold font
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
537 |
style:style |
91a8a5889bf2
oops - always returned a bold font
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
538 |
size:size |
91a8a5889bf2
oops - always returned a bold font
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
539 |
encoding:encoding) on:aDevice |
91a8a5889bf2
oops - always returned a bold font
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
540 |
|
91a8a5889bf2
oops - always returned a bold font
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
541 |
"Modified: 29.2.1996 / 04:45:11 / cg" |
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
542 |
! |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
543 |
|
1497
697ac9b15962
added #onDevice: for protocol completeness.
Claus Gittinger <cg@exept.de>
parents:
1277
diff
changeset
|
544 |
onDevice:aDevice |
697ac9b15962
added #onDevice: for protocol completeness.
Claus Gittinger <cg@exept.de>
parents:
1277
diff
changeset
|
545 |
"given the receiver, return a device Font" |
697ac9b15962
added #onDevice: for protocol completeness.
Claus Gittinger <cg@exept.de>
parents:
1277
diff
changeset
|
546 |
|
697ac9b15962
added #onDevice: for protocol completeness.
Claus Gittinger <cg@exept.de>
parents:
1277
diff
changeset
|
547 |
^ self on:aDevice |
697ac9b15962
added #onDevice: for protocol completeness.
Claus Gittinger <cg@exept.de>
parents:
1277
diff
changeset
|
548 |
|
697ac9b15962
added #onDevice: for protocol completeness.
Claus Gittinger <cg@exept.de>
parents:
1277
diff
changeset
|
549 |
"Created: 28.3.1997 / 16:09:30 / cg" |
697ac9b15962
added #onDevice: for protocol completeness.
Claus Gittinger <cg@exept.de>
parents:
1277
diff
changeset
|
550 |
! |
697ac9b15962
added #onDevice: for protocol completeness.
Claus Gittinger <cg@exept.de>
parents:
1277
diff
changeset
|
551 |
|
109 | 552 |
size:newSize |
553 |
"return a font corresponding to the receiver, but with different size." |
|
554 |
||
555 |
^ self class |
|
556 |
family:family |
|
557 |
face:face |
|
558 |
style:style |
|
559 |
size:newSize |
|
560 |
encoding:encoding |
|
561 |
! ! |
|
562 |
||
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
563 |
!FontDescription methodsFor:'errors'! |
109 | 564 |
|
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
565 |
errorNoDevice |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
566 |
"a query was made for device-specific info" |
109 | 567 |
|
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
568 |
" |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
569 |
this happens, when you ask a font for its height or width, |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
570 |
ascent or any other dimension which depends on the device on |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
571 |
which the font is rendered, AND the receiver font is not (yet) |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
572 |
associated to a device. |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
573 |
You should always use |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
574 |
font := font on:someDevice |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
575 |
to get a device font, before asking for device specifics. |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
576 |
" |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
577 |
self error:'query device independent font for for device specific info' |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
578 |
! ! |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
579 |
|
1618 | 580 |
!FontDescription methodsFor:'printing & storing'! |
581 |
||
582 |
userFriendlyName |
|
583 |
"return a user-friendly printed representation of the receiver" |
|
584 |
||
585 |
|nm| |
|
586 |
||
587 |
nm := family. |
|
588 |
face notNil ifTrue:[ |
|
589 |
nm := nm , '-', face. |
|
590 |
]. |
|
591 |
style notNil ifTrue:[ |
|
592 |
nm := nm , '-', style. |
|
593 |
]. |
|
594 |
size notNil ifTrue:[ |
|
595 |
nm := nm , '-', size printString. |
|
596 |
]. |
|
597 |
encoding notNil ifTrue:[ |
|
598 |
nm := nm , '-', encoding . |
|
599 |
]. |
|
600 |
^ nm |
|
601 |
||
602 |
" |
|
603 |
View defaultFont userFriendlyName |
|
604 |
Button defaultFont userFriendlyName |
|
605 |
" |
|
606 |
||
607 |
"Modified: 20.4.1996 / 23:25:36 / cg" |
|
608 |
"Created: 19.4.1997 / 18:09:25 / cg" |
|
609 |
! ! |
|
610 |
||
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
611 |
!FontDescription methodsFor:'queries'! |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
612 |
|
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
613 |
bold |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
614 |
"return true, if the receiver is a bold font - |
1585 | 615 |
Added for st-80 compatibility." |
616 |
||
617 |
"/ Currently, this implementation is a dirty hack and will be changed soon. |
|
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
618 |
|
1275 | 619 |
^ face = 'bold' |
620 |
||
1585 | 621 |
"Modified: 11.4.1997 / 21:31:25 / cg" |
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
622 |
! |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
623 |
|
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
624 |
boldness |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
625 |
"return the boldness of the characters in this font 0 .. 1 - |
1275 | 626 |
Added for st-80 compatibility" |
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
627 |
|
1585 | 628 |
"/ Currently, this implementation is a dirty hack and will be changed soon. |
629 |
||
630 |
face = 'roman' ifTrue:[^ 0.5]. |
|
631 |
face = 'normal' ifTrue:[^ 0.5]. |
|
632 |
face = 'bold' ifTrue:[^ 0.75]. |
|
633 |
face = 'light' ifTrue:[^ 0.25]. |
|
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
634 |
^ 0.5 |
1275 | 635 |
|
1585 | 636 |
"Modified: 11.4.1997 / 21:31:31 / cg" |
1275 | 637 |
! |
638 |
||
639 |
color |
|
640 |
"return the default color in which this font is to be rendered. |
|
641 |
Added for st-80 compatibility. |
|
642 |
For now always black." |
|
643 |
||
644 |
^ Color black |
|
645 |
||
646 |
"Created: 25.1.1997 / 02:59:15 / cg" |
|
647 |
"Modified: 25.1.1997 / 03:02:14 / cg" |
|
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
648 |
! |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
649 |
|
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
650 |
fullName |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
651 |
^ nil |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
652 |
|
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
653 |
"Created: 23.2.1996 / 00:45:45 / cg" |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
654 |
! |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
655 |
|
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
656 |
italic |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
657 |
"return true if this is an italic font - |
1585 | 658 |
Added for st-80 compatibility" |
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
659 |
|
1585 | 660 |
"/ Currently, this implementation is a dirty hack and will be changed soon. |
661 |
||
662 |
style = 'italic' ifTrue:[^ true]. |
|
663 |
style = 'obligue' ifTrue:[^ true]. |
|
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
664 |
^ false |
1275 | 665 |
|
1585 | 666 |
"Modified: 11.4.1997 / 21:31:42 / cg" |
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
667 |
! |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
668 |
|
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
669 |
serif |
1275 | 670 |
"return true, if this font has serifs. |
1585 | 671 |
Added for st-80 compatibility" |
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
672 |
|
1585 | 673 |
"/ Currently, this implementation is a dirty hack and will be changed soon. |
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
674 |
|
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
675 |
family = 'Times' ifTrue:[^ true]. |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
676 |
family = 'times' ifTrue:[^ true]. |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
677 |
^ false. |
1275 | 678 |
|
1585 | 679 |
"Modified: 11.4.1997 / 21:31:51 / cg" |
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
680 |
! |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
681 |
|
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
682 |
species |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
683 |
^ Font |
1275 | 684 |
! |
685 |
||
686 |
underline |
|
687 |
"return true if this is an underlined font - |
|
688 |
Added for st-80 compatibility |
|
689 |
(always false here)" |
|
690 |
||
691 |
^ false |
|
692 |
||
693 |
"Created: 25.1.1997 / 02:58:30 / cg" |
|
694 |
"Modified: 25.1.1997 / 03:01:12 / cg" |
|
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
695 |
! ! |
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
696 |
|
456 | 697 |
!FontDescription methodsFor:'queries-encoding'! |
698 |
||
699 |
isASCII |
|
576 | 700 |
"return true, if the receivers encoding is |
701 |
compatible with ascii (i.e. its ascii or iso8859)" |
|
702 |
||
456 | 703 |
^ (encoding == #iso8859) or:[encoding == #ascii] |
704 |
||
705 |
"Created: 24.2.1996 / 22:47:30 / cg" |
|
576 | 706 |
"Modified: 20.4.1996 / 23:20:01 / cg" |
456 | 707 |
! |
708 |
||
709 |
isISO8859 |
|
576 | 710 |
"return true, if the receivers encoding is |
711 |
compatible with iso8859 (i.e. iso8859)" |
|
712 |
||
456 | 713 |
^ encoding == #iso8859 |
714 |
||
715 |
"Created: 24.2.1996 / 22:47:12 / cg" |
|
576 | 716 |
"Modified: 20.4.1996 / 23:20:13 / cg" |
456 | 717 |
! |
718 |
||
719 |
isJIS |
|
576 | 720 |
"return true, if the receivers encoding is |
721 |
compatible with jis (i.e. jisXXX)" |
|
722 |
||
456 | 723 |
^ (encoding startsWith:'jis') |
724 |
||
725 |
"Created: 24.2.1996 / 22:47:47 / cg" |
|
576 | 726 |
"Modified: 20.4.1996 / 23:20:30 / cg" |
456 | 727 |
! ! |
728 |
||
1275 | 729 |
!FontDescription class methodsFor:'documentation'! |
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
730 |
|
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
731 |
version |
2164 | 732 |
^ '$Header: /cvs/stx/stx/libview/Attic/FontDescr.st,v 1.25 1998-06-20 15:04:25 cg Exp $' |
437
a81ce3a8038b
return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents:
229
diff
changeset
|
733 |
! ! |
1275 | 734 |
FontDescription initialize! |