XftFontDescription.st
changeset 6587 c1790bb9af59
parent 6544 5d5d433806d2
child 6616 9dad6d1245cc
child 6631 b54e8a89dbdc
equal deleted inserted replaced
6586:9d16907daea8 6587:c1790bb9af59
   527     ^ fontId
   527     ^ fontId
   528 
   528 
   529     "Created: / 02-01-2014 / 23:29:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   529     "Created: / 02-01-2014 / 23:29:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   530 ! !
   530 ! !
   531 
   531 
       
   532 !XftFontDescription methodsFor:'converting'!
       
   533 
       
   534 asNonXftFont
       
   535     |newFont|
       
   536 
       
   537     newFont := FontDescription 
       
   538                     family:family 
       
   539                     face:face 
       
   540                     style:style 
       
   541                     size:(sizeUnit == #px ifTrue:[pixelSize] ifFalse:[size]) 
       
   542                     sizeUnit:sizeUnit
       
   543                     encoding:encoding.
       
   544 
       
   545     ^ newFont 
       
   546 ! !
       
   547 
   532 !XftFontDescription methodsFor:'displaying'!
   548 !XftFontDescription methodsFor:'displaying'!
   533 
   549 
   534 displayString:aString from:index1 to:index2Arg x:xArg y:yArg in:aGC opaque:opaque
   550 displayString:aString from:index1 to:index2Arg x:xArg y:yArg in:aGC opaque:opaque
   535     "display a partial string at some position in aGC."
   551     "display a partial string at some position in aGC."
   536 
   552 
   797             ^ aFont
   813             ^ aFont
   798         ].
   814         ].
   799     ].
   815     ].
   800 
   816 
   801     [
   817     [
   802         myPatternId := self xftPatternCreate.
   818         Error handle:[:ex |
       
   819             ^ self asNonXftFont onDevice:aGraphicsDevice
       
   820         ] do:[
       
   821             myPatternId := self xftPatternCreate.
       
   822         ].
   803         self xftPatternAdd: myPatternId attribute: FC_FAMILY  value: family.
   823         self xftPatternAdd: myPatternId attribute: FC_FAMILY  value: family.
   804         pixelSize notNil ifTrue:[
   824         pixelSize notNil ifTrue:[
   805             self xftPatternAdd: myPatternId attribute: FC_PIXEL_SIZE value: pixelSize.
   825             self xftPatternAdd: myPatternId attribute: FC_PIXEL_SIZE value: pixelSize.
   806         ] ifFalse:[
   826         ] ifFalse:[
   807             self xftPatternAdd: myPatternId attribute: FC_SIZE value: size.
   827             self xftPatternAdd: myPatternId attribute: FC_SIZE value: size.
  2043 ! !
  2063 ! !
  2044 
  2064 
  2045 !XftFontDescription class methodsFor:'documentation'!
  2065 !XftFontDescription class methodsFor:'documentation'!
  2046 
  2066 
  2047 version
  2067 version
  2048     ^ '$Header: /cvs/stx/stx/libview/XftFontDescription.st,v 1.60 2014-07-09 02:56:41 cg Exp $'
  2068     ^ '$Header: /cvs/stx/stx/libview/XftFontDescription.st,v 1.61 2014-11-12 12:14:33 ab Exp $'
  2049 !
  2069 !
  2050 
  2070 
  2051 version_CVS
  2071 version_CVS
  2052     ^ '$Header: /cvs/stx/stx/libview/XftFontDescription.st,v 1.60 2014-07-09 02:56:41 cg Exp $'
  2072     ^ '$Header: /cvs/stx/stx/libview/XftFontDescription.st,v 1.61 2014-11-12 12:14:33 ab Exp $'
  2053 ! !
  2073 ! !
  2054 
  2074 
  2055 
  2075 
  2056 XftFontDescription initialize!
  2076 XftFontDescription initialize!