equal
deleted
inserted
replaced
14 "{ NameSpace: Smalltalk }" |
14 "{ NameSpace: Smalltalk }" |
15 |
15 |
16 Object subclass:#FontDescription |
16 Object subclass:#FontDescription |
17 instanceVariableNames:'family face style size encoding manufacturer name flags masks |
17 instanceVariableNames:'family face style size encoding manufacturer name flags masks |
18 sizeUnit pixelSize weight slant' |
18 sizeUnit pixelSize weight slant' |
19 classVariableNames:'BoldnessMask FixedFlag ItalicFlag OutlineFlag SerifFlag |
19 classVariableNames:'AntialiasedFlag BoldnessMask |
20 ShadowFlag StrikeoutFlag UnderlineFlag GenericFlag GenericFonts |
20 CharacterEncodingToCharacterSetMapping CharacterSetToFontMapping |
21 CharacterSetToFontMapping CharacterEncodingToCharacterSetMapping |
21 DecorativeFlag DefaultEncoding FixedFlag GenericFlag GenericFonts |
22 IsTrueTypeFlag OverlappingCharactersFlag DefaultEncoding |
22 IsTrueTypeFlag ItalicFlag OutlineFlag OverlappingCharactersFlag |
23 AntialiasedFlag ScalableFlag DecorativeFlag' |
23 ScalableFlag SerifFlag ShadowFlag StrikeoutFlag UnderlineFlag' |
24 poolDictionaries:'' |
24 poolDictionaries:'' |
25 category:'Graphics-Support' |
25 category:'Graphics-Support' |
26 ! |
26 ! |
27 |
27 |
28 !FontDescription class methodsFor:'documentation'! |
28 !FontDescription class methodsFor:'documentation'! |
1335 onDevice:aDevice ifAbsent:exceptionBlock |
1335 onDevice:aDevice ifAbsent:exceptionBlock |
1336 "create a new Font representing the same font as |
1336 "create a new Font representing the same font as |
1337 myself on aDevice. This does NOT try to look for existing |
1337 myself on aDevice. This does NOT try to look for existing |
1338 or replacement fonts (i.e. can be used to get physical fonts)." |
1338 or replacement fonts (i.e. can be used to get physical fonts)." |
1339 |
1339 |
1340 |newFont id| |
1340 |newFont id xftFont| |
|
1341 |
|
1342 (aDevice supportsXftFonts |
|
1343 and:[ UserPreferences current useXFontsOnly not ]) ifTrue:[ |
|
1344 xftFont := (XftFontDescription for:self) onDevice:aDevice ifAbsent:[nil]. |
|
1345 xftFont notNil ifTrue:[^ xftFont]. |
|
1346 UserPreferences current useXftFontsOnly ifTrue:[^ nil]. |
|
1347 ]. |
1341 |
1348 |
1342 "ask that device for the font" |
1349 "ask that device for the font" |
1343 id := aDevice |
1350 id := aDevice |
1344 getFontWithFamily:family |
1351 getFontWithFamily:family |
1345 face:face |
1352 face:face |