DeviceWorkstation.st
changeset 1796 9384026b7b20
parent 1794 3d80e825f47a
child 1810 f08ab2614ae3
equal deleted inserted replaced
1795:ea9c8a452434 1796:9384026b7b20
  3576     allFonts := self listOfAvailableFonts.
  3576     allFonts := self listOfAvailableFonts.
  3577     allFonts isNil ifTrue:[^ nil].
  3577     allFonts isNil ifTrue:[^ nil].
  3578 
  3578 
  3579     fonts := Set new.
  3579     fonts := Set new.
  3580     allFonts do:[:fntDescr |
  3580     allFonts do:[:fntDescr |
  3581 	(aFamilyName = fntDescr family) ifTrue:[
  3581         (aFamilyName match:fntDescr family) ifTrue:[
  3582 	    (aFaceName = fntDescr face) ifTrue:[
  3582             (aFaceName match:fntDescr face) ifTrue:[
  3583 		(filter isNil or:[filter value:fntDescr]) ifTrue:[
  3583                 (filter isNil or:[filter value:fntDescr]) ifTrue:[
  3584 		    fonts add:fntDescr
  3584                     fonts add:fntDescr
  3585 		]
  3585                 ]
  3586 	    ]
  3586             ]
  3587 	]
  3587         ]
  3588     ].
  3588     ].
  3589     ^ fonts
  3589     ^ fonts
  3590 
  3590 
  3591     "
  3591     "
  3592      Display fontsInFamily:'fixed' face:'medium' filtering:[:f |
  3592      Display fontsInFamily:'fixed' face:'medium' filtering:[:f |
  3593 	f encoding notNil and:[f encoding startsWith:'jis']]
  3593         f encoding notNil and:[f encoding startsWith:'jis']]
  3594     "
  3594     "
  3595 
  3595 
  3596     "Created: 29.2.1996 / 04:32:56 / cg"
  3596     "Created: 29.2.1996 / 04:32:56 / cg"
       
  3597     "Modified: 30.6.1997 / 11:07:21 / cg"
  3597 !
  3598 !
  3598 
  3599 
  3599 fontsInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
  3600 fontsInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
  3600     "return a set of all available font in aFamily/aFace/aStyle
  3601     "return a set of all available font in aFamily/aFace/aStyle
  3601      on this display.
  3602      on this display.
  3606     allFonts := self listOfAvailableFonts.
  3607     allFonts := self listOfAvailableFonts.
  3607     allFonts isNil ifTrue:[^ nil].
  3608     allFonts isNil ifTrue:[^ nil].
  3608 
  3609 
  3609     fonts := Set new.
  3610     fonts := Set new.
  3610     allFonts do:[:fntDescr |
  3611     allFonts do:[:fntDescr |
  3611 	(aFamilyName = fntDescr family) ifTrue:[
  3612         (aFamilyName match:fntDescr family) ifTrue:[
  3612 	    (aFaceName = fntDescr face) ifTrue:[
  3613             (aFaceName match:fntDescr face) ifTrue:[
  3613 		(aStyleName = fntDescr style) ifTrue:[
  3614                 (aStyleName match:fntDescr style) ifTrue:[
  3614 		    (filter isNil or:[filter value:fntDescr]) ifTrue:[
  3615                     (filter isNil or:[filter value:fntDescr]) ifTrue:[
  3615 			fonts add:fntDescr
  3616                         fonts add:fntDescr
  3616 		    ]    
  3617                     ]    
  3617 		]
  3618                 ]
  3618 	    ]
  3619             ]
  3619 	]
  3620         ]
  3620     ].
  3621     ].
  3621     ^ fonts
  3622     ^ fonts
  3622 
  3623 
  3623     "
  3624     "
  3624      Display fontsInFamily:'fixed' face:'medium' style:'roman' filtering:[:f |
  3625      Display fontsInFamily:'fixed' face:'medium' style:'roman' filtering:[:f |
  3625 	f encoding notNil and:[f encoding startsWith:'jis']]
  3626         f encoding notNil and:[f encoding startsWith:'jis']]
       
  3627     "
       
  3628     "
       
  3629      Display fontsInFamily:'fixed' face:'*' style:'roman' filtering:[:f |
       
  3630         f encoding notNil and:[f encoding startsWith:'jis']]  
  3626     "
  3631     "
  3627 
  3632 
  3628     "Created: 29.2.1996 / 04:25:30 / cg"
  3633     "Created: 29.2.1996 / 04:25:30 / cg"
       
  3634     "Modified: 30.6.1997 / 11:07:08 / cg"
  3629 !
  3635 !
  3630 
  3636 
  3631 fontsInFamily:aFamilyName filtering:filterBlock
  3637 fontsInFamily:aFamilyName filtering:filterBlock
  3632     "return a set of all available font in aFamily on this display.
  3638     "return a set of all available font in aFamily on this display.
  3633      But only those matching filterBlock (if nonNil)."
  3639      But only those matching filterBlock (if nonNil)."
  3637     allFonts := self listOfAvailableFonts.
  3643     allFonts := self listOfAvailableFonts.
  3638     allFonts isNil ifTrue:[^ nil].
  3644     allFonts isNil ifTrue:[^ nil].
  3639 
  3645 
  3640     fonts := Set new.
  3646     fonts := Set new.
  3641     allFonts do:[:fntDescr |
  3647     allFonts do:[:fntDescr |
  3642 	aFamilyName = fntDescr family ifTrue:[
  3648         (aFamilyName match:fntDescr family) ifTrue:[
  3643 	    (filterBlock isNil or:[filterBlock value:fntDescr]) ifTrue:[
  3649             (filterBlock isNil or:[filterBlock value:fntDescr]) ifTrue:[
  3644 		fonts add:fntDescr
  3650                 fonts add:fntDescr
  3645 	    ]
  3651             ]
  3646 	]
  3652         ]
  3647     ].
  3653     ].
  3648     ^ fonts
  3654     ^ fonts
  3649 
  3655 
  3650     "
  3656     "
  3651      Display fontsInFamily:'fixed' filtering:[:f |
  3657      Display fontsInFamily:'fixed' filtering:[:f |
  3652 	f encoding notNil and:[f encoding startsWith:'jis']]
  3658         f encoding notNil and:[f encoding startsWith:'jis']]
  3653     "
  3659     "
  3654 
  3660     "
  3655     "Modified: 27.2.1996 / 01:34:11 / cg"
  3661      Display fontsInFamily:'*' filtering:[:f |
       
  3662         f encoding notNil and:[f encoding startsWith:'jis']] 
       
  3663     "
       
  3664 
  3656     "Created: 29.2.1996 / 04:27:49 / cg"
  3665     "Created: 29.2.1996 / 04:27:49 / cg"
       
  3666     "Modified: 30.6.1997 / 11:06:36 / cg"
  3657 !
  3667 !
  3658 
  3668 
  3659 fullNameOf:aFontId
  3669 fullNameOf:aFontId
  3660     "return the full name of a font.
  3670     "return the full name of a font.
  3661      Here, we return nil, not knowing anything about fonts"
  3671      Here, we return nil, not knowing anything about fonts"
  5643 ! !
  5653 ! !
  5644 
  5654 
  5645 !DeviceWorkstation class methodsFor:'documentation'!
  5655 !DeviceWorkstation class methodsFor:'documentation'!
  5646 
  5656 
  5647 version
  5657 version
  5648     ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.232 1997-06-28 18:21:42 cg Exp $'
  5658     ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.233 1997-06-30 09:09:02 cg Exp $'
  5649 ! !
  5659 ! !
  5650 DeviceWorkstation initialize!
  5660 DeviceWorkstation initialize!