FontPanel.st
changeset 5008 2af062c3a407
parent 5007 dc3587ec2444
child 5102 30b7e7cc2d99
equal deleted inserted replaced
5007:dc3587ec2444 5008:2af062c3a407
   482     "set the font to be selected initially"
   482     "set the font to be selected initially"
   483 
   483 
   484     |encoding|
   484     |encoding|
   485 
   485 
   486     selectedFont := aFont.
   486     selectedFont := aFont.
       
   487     currentFamily := aFont family.
       
   488     currentFace := aFont face.
       
   489     currentStyle := aFont style.
       
   490     currentSize := aFont size.
       
   491     currentFaceAndStyle := currentFace,'-',currentStyle.
       
   492 
   487     self xftFontsOnlyHolder value:(aFont isXftFont).
   493     self xftFontsOnlyHolder value:(aFont isXftFont).
   488     encoding := aFont encoding.    
   494     encoding := aFont encoding.    
   489     sizeUnit := aFont sizeUnit.
   495     sizeUnit := aFont sizeUnit.
   490 
   496 
   491 "/ self halt.
   497 "/ self halt.
  1203         ]
  1209         ]
  1204     ].
  1210     ].
  1205 
  1211 
  1206     faceList list:list.
  1212     faceList list:list.
  1207     currentFaceAndStyle notNil ifTrue:[
  1213     currentFaceAndStyle notNil ifTrue:[
       
  1214         (list includes:currentFaceAndStyle) ifFalse:[
       
  1215             currentFaceAndStyle = 'normal-roman' ifTrue:[
       
  1216                 (list includes:'regular-roman') ifTrue:[
       
  1217                     currentFaceAndStyle := 'regular-roman'.
       
  1218                     currentFace := 'regular'.
       
  1219                     currentStyle := 'roman'.
       
  1220                 ].
       
  1221                 (list includes:'medium-roman') ifTrue:[
       
  1222                     currentFaceAndStyle := 'medium-roman'.
       
  1223                     currentFace := 'medium'.
       
  1224                     currentStyle := 'roman'.
       
  1225                 ].
       
  1226             ].
       
  1227         ].
  1208         (list includes:currentFaceAndStyle) ifTrue:[
  1228         (list includes:currentFaceAndStyle) ifTrue:[
  1209             faceList setSelectElement:currentFaceAndStyle.
  1229             faceList setSelectElement:currentFaceAndStyle.
  1210             self faceSelected:currentFaceAndStyle showPreview:showPreview.
  1230             self faceSelected:currentFaceAndStyle showPreview:showPreview.
  1211             ^ self
  1231             ^ self
  1212         ]
  1232         ]
  1213     ].
  1233     ].
  1214     list notEmptyOrNil ifTrue:[
  1234     list notEmptyOrNil ifTrue:[
  1215         "/ faceList setSelectElement:(list first).
  1235         "/ faceList setSelectElement:(list first).
  1216         faceList selectElement:(list first).
  1236         faceList selectElement:(list first).
  1217         self faceSelected:(list first) showPreview:showPreview.
  1237         self faceSelected:(list first) showPreview:showPreview.
       
  1238         self updateSizeList.
  1218         ^ self
  1239         ^ self
  1219     ].
  1240     ].
  1220 
  1241 
  1221     sizeList list:nil.
  1242     sizeList list:nil.
  1222     self clearPreview.
  1243     self clearPreview.
  1295 ! !
  1316 ! !
  1296 
  1317 
  1297 !FontPanel class methodsFor:'documentation'!
  1318 !FontPanel class methodsFor:'documentation'!
  1298 
  1319 
  1299 version
  1320 version
  1300     ^ '$Header: /cvs/stx/stx/libwidg/FontPanel.st,v 1.125 2014-04-27 20:45:00 cg Exp $'
  1321     ^ '$Header: /cvs/stx/stx/libwidg/FontPanel.st,v 1.126 2014-04-27 21:57:23 cg Exp $'
  1301 !
  1322 !
  1302 
  1323 
  1303 version_CVS
  1324 version_CVS
  1304     ^ '$Header: /cvs/stx/stx/libwidg/FontPanel.st,v 1.125 2014-04-27 20:45:00 cg Exp $'
  1325     ^ '$Header: /cvs/stx/stx/libwidg/FontPanel.st,v 1.126 2014-04-27 21:57:23 cg Exp $'
  1305 ! !
  1326 ! !
  1306 
  1327