XftFontDescription.st
changeset 6963 26d226d61d32
parent 6957 5493f1a1b259
child 6974 21d7c77069a1
equal deleted inserted replaced
6962:e310074c6d77 6963:26d226d61d32
   348     ^ super
   348     ^ super
   349         family:familyString face:faceString style:styleString size:size sizeUnit:sizeUnit encoding:encoding
   349         family:familyString face:faceString style:styleString size:size sizeUnit:sizeUnit encoding:encoding
   350 !
   350 !
   351 
   351 
   352 new
   352 new
   353 "/    self halt.
   353     ^ self basicNew initialize.
   354     ^ super new.
       
   355 ! !
   354 ! !
   356 
   355 
   357 !XftFontDescription class methodsFor:'change & update'!
   356 !XftFontDescription class methodsFor:'change & update'!
   358 
   357 
   359 aboutToDestroyViewWithDevice:aDevice id:aWindowId
   358 aboutToDestroyViewWithDevice:aDevice id:aWindowId
   464      XftFontDescription listOfAvailableFonts
   463      XftFontDescription listOfAvailableFonts
   465     "
   464     "
   466 ! !
   465 ! !
   467 
   466 
   468 !XftFontDescription methodsFor:'accessing'!
   467 !XftFontDescription methodsFor:'accessing'!
   469 
       
   470 encoding
       
   471     ^ encoding ? 'iso10646-1'
       
   472 !
       
   473 
   468 
   474 face
   469 face
   475     ^ face ? ''
   470     ^ face ? ''
   476 !
   471 !
   477 
   472 
   991     "Modified (comment): / 04-01-2014 / 02:06:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   986     "Modified (comment): / 04-01-2014 / 02:06:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   992 ! !
   987 ! !
   993 
   988 
   994 !XftFontDescription methodsFor:'initialization'!
   989 !XftFontDescription methodsFor:'initialization'!
   995 
   990 
       
   991 initialize
       
   992     "Invoked when a new instance is created."
       
   993 
       
   994     super initialize.
       
   995     size := 0.
       
   996     encoding := #'iso10646-1'.
       
   997 !
       
   998 
   996 setDevice: deviceArg patternId: patternIdArg fontId: fontIdArg
   999 setDevice: deviceArg patternId: patternIdArg fontId: fontIdArg
   997     device := deviceArg.
  1000     device := deviceArg.
   998     fontId := fontIdArg.
  1001     fontId := fontIdArg.
   999     patternIdArg notNil ifTrue:[
  1002     patternIdArg notNil ifTrue:[
  1000         family  := self xftPatternGet: patternIdArg attribute: FC_FAMILY index: 0.
  1003         family  := self xftPatternGet: patternIdArg attribute: FC_FAMILY index: 0.
  1008 
  1011 
  1009         encoding:= self xftPatternGet: patternIdArg attribute: 'encoding' index: 0.
  1012         encoding:= self xftPatternGet: patternIdArg attribute: 'encoding' index: 0.
  1010     ].
  1013     ].
  1011     size isNil ifTrue:[
  1014     size isNil ifTrue:[
  1012         size := 0.
  1015         size := 0.
       
  1016     ].
       
  1017     encoding isNil ifTrue:[
       
  1018         encoding := #'iso10646-1'.
  1013     ].
  1019     ].
  1014 
  1020 
  1015     "Created: / 21-12-2013 / 00:46:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1021     "Created: / 21-12-2013 / 00:46:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1016     "Modified: / 30-12-2013 / 12:49:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1022     "Modified: / 30-12-2013 / 12:49:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1017 ! !
  1023 ! !
  1858     drawableId := view id.
  1864     drawableId := view id.
  1859     drawableId isNil ifTrue: [ ^ self ].
  1865     drawableId isNil ifTrue: [ ^ self ].
  1860 %{
  1866 %{
  1861 #ifdef XFT
  1867 #ifdef XFT
  1862     if ( __INST(sharedDrawId) != nil ) {
  1868     if ( __INST(sharedDrawId) != nil ) {
  1863 	if (XftDrawDrawable(XFT_DRAW(__INST(sharedDrawId))) == DRAWABLE(drawableId)) {
  1869 	XftDraw *xftDrawable = XFT_DRAW(__INST(sharedDrawId));
       
  1870 
       
  1871 	if (XftDrawDrawable(xftDrawable) == DRAWABLE(drawableId)) {
  1864 	    __INST(sharedDrawId) = nil;
  1872 	    __INST(sharedDrawId) = nil;
  1865 	    XftDrawDestroy(DRAWABLE(drawableId));
  1873 	    XftDrawDestroy(xftDrawable);
  1866 	}
  1874 	}
  1867     }
  1875     }
  1868     RETURN (self);
  1876     RETURN (self);
  1869 #endif
  1877 #endif
  1870 %}.
  1878 %}.
  1935                 lineStream := l readStream. lineStream skipSeparators.
  1943                 lineStream := l readStream. lineStream skipSeparators.
  1936                 key := lineStream upToSeparator.
  1944                 key := lineStream upToSeparator.
  1937                 (
  1945                 (
  1938                     #('family:' 'style:' 'slant:' 'weight:' 'width:'
  1946                     #('family:' 'style:' 'slant:' 'weight:' 'width:'
  1939                       'pixelsize:' 'spacing:' 'foundry:' 'antialias:'
  1947                       'pixelsize:' 'spacing:' 'foundry:' 'antialias:'
  1940                       'file:' 'outline' 'scalable:' 'charset:' 'lang:'
  1948                       'file:' 'outline:' 'scalable:' 'charset:' 'lang:'
  1941                       'fontversion:' 'fontformat:' 'decorative:' 'index:'
  1949                       'fontversion:' 'fontformat:' 'decorative:' 'index:'
  1942                       'outline:' 'familylang:' 'stylelang:' 'fullname:'
  1950                       'outline:' 'familylang:' 'stylelang:' 'fullname:'
  1943                       'fullnamelang:' 'capability:' 'hash:' 'postscriptname:'
  1951                       'fullnamelang:' 'capability:' 'hash:' 'postscriptname:'
  1944                     ) includes:key
  1952                     ) includes:key
  1945                 ) ifTrue:[
  1953                 ) ifTrue:[
  2189     |s|
  2197     |s|
  2190 
  2198 
  2191     lineStream skipSeparators.
  2199     lineStream skipSeparators.
  2192     s := lineStream nextAlphaNumericWord.
  2200     s := lineStream nextAlphaNumericWord.
  2193     ^ (s indexOfSubCollection:'True') ~~ 0.     "/ match at least 'True' and 'FCTrue'
  2201     ^ (s indexOfSubCollection:'True') ~~ 0.     "/ match at least 'True' and 'FCTrue'
       
  2202 
       
  2203     "
       
  2204         'xxFalse' indexOfSubCollection:'True'
       
  2205         'FcTrue' indexOfSubCollection:'True'
       
  2206     "
  2194 !
  2207 !
  2195 
  2208 
  2196 getInteger
  2209 getInteger
  2197     "helper for font listing"
  2210     "helper for font listing"
  2198 
  2211