FontDescription.st
author Claus Gittinger <cg@exept.de>
Thu, 27 Jan 2011 11:48:21 +0100
changeset 5689 474d50f11653
parent 5644 664ce01f38f5
child 5894 27858a4e6457
permissions -rw-r--r--
comment/format in: #inspectorExtraAttributes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
52
edf02eb2939c Initial revision
claus
parents:
diff changeset
     1
"
edf02eb2939c Initial revision
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1994 by Claus Gittinger
89
ea2bf46eb669 *** empty log message ***
claus
parents: 52
diff changeset
     3
	      All Rights Reserved
52
edf02eb2939c Initial revision
claus
parents:
diff changeset
     4
edf02eb2939c Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
edf02eb2939c Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
edf02eb2939c Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
edf02eb2939c Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
edf02eb2939c Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
edf02eb2939c Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
edf02eb2939c Initial revision
claus
parents:
diff changeset
    11
"
3246
213e4771d6fb typo fixed
Claus Gittinger <cg@exept.de>
parents: 3159
diff changeset
    12
"{ Package: 'stx:libview' }"
213e4771d6fb typo fixed
Claus Gittinger <cg@exept.de>
parents: 3159
diff changeset
    13
52
edf02eb2939c Initial revision
claus
parents:
diff changeset
    14
Object subclass:#FontDescription
1275
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    15
	instanceVariableNames:'family face style size encoding manufacturer name flags masks
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
    16
		sizeUnit pixelSize'
1265
c8030e99f941 added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
    17
	classVariableNames:'BoldnessMask FixedFlag ItalicFlag OutlineFlag SerifFlag
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
    18
		ShadowFlag StrikeoutFlag UnderlineFlag GenericFlag GenericFonts
5644
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
    19
		CharacterSetToFontMapping CharacterEncodingToCharacterSetMapping
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
    20
		IsTrueTypeFlag OverlappingCharactersFlag'
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    21
	poolDictionaries:''
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    22
	category:'Graphics-Support'
52
edf02eb2939c Initial revision
claus
parents:
diff changeset
    23
!
edf02eb2939c Initial revision
claus
parents:
diff changeset
    24
1275
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    25
!FontDescription class methodsFor:'documentation'!
52
edf02eb2939c Initial revision
claus
parents:
diff changeset
    26
edf02eb2939c Initial revision
claus
parents:
diff changeset
    27
copyright
edf02eb2939c Initial revision
claus
parents:
diff changeset
    28
"
edf02eb2939c Initial revision
claus
parents:
diff changeset
    29
 COPYRIGHT (c) 1994 by Claus Gittinger
89
ea2bf46eb669 *** empty log message ***
claus
parents: 52
diff changeset
    30
	      All Rights Reserved
52
edf02eb2939c Initial revision
claus
parents:
diff changeset
    31
edf02eb2939c Initial revision
claus
parents:
diff changeset
    32
 This software is furnished under a license and may be used
edf02eb2939c Initial revision
claus
parents:
diff changeset
    33
 only in accordance with the terms of that license and with the
edf02eb2939c Initial revision
claus
parents:
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
edf02eb2939c Initial revision
claus
parents:
diff changeset
    35
 be provided or otherwise made available to, or used by, any
edf02eb2939c Initial revision
claus
parents:
diff changeset
    36
 other person.  No title to or ownership of the software is
edf02eb2939c Initial revision
claus
parents:
diff changeset
    37
 hereby transferred.
edf02eb2939c Initial revision
claus
parents:
diff changeset
    38
"
edf02eb2939c Initial revision
claus
parents:
diff changeset
    39
!
edf02eb2939c Initial revision
claus
parents:
diff changeset
    40
edf02eb2939c Initial revision
claus
parents:
diff changeset
    41
documentation
edf02eb2939c Initial revision
claus
parents:
diff changeset
    42
"
edf02eb2939c Initial revision
claus
parents:
diff changeset
    43
    FontDescription is just a place-holder for scanned font names.
edf02eb2939c Initial revision
claus
parents:
diff changeset
    44
611
e0442439a3c6 documentation
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
    45
    [Instance variables:]
e0442439a3c6 documentation
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
    46
        family          <String>        the fonts family ('courier', 'helvetica' etc)
e0442439a3c6 documentation
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
    47
        face            <String>        the fonts face ('bold', 'medium' etc)
e0442439a3c6 documentation
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
    48
        style           <String>        the fonts style ('roman', 'italic', 'oblique')
e0442439a3c6 documentation
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
    49
        size            <String>        the fonts size (not in pixels) 
3991
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
    50
        encoding        <Symbol>        the fonts encoding (usually #iso8859-1)
611
e0442439a3c6 documentation
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
    51
3991
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
    52
        manufacturer    <nil|String|Array>
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
    53
                                        the fonts origin - if known
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
    54
        name            <nil|String|Array>
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
    55
                                        the platform specific name
1265
c8030e99f941 added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
    56
3991
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
    57
        flags           <SmallInteger>  holds serif/italic etc. as flag bits
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
    58
        masks           <SmallInteger>  currently dummy; to allow ST-80 compatible subclassing
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
    59
        pixelSize       <SmallInteger>  currently dummy; to allow ST-80 compatible subclassing
1265
c8030e99f941 added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
    60
c8030e99f941 added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
    61
    [class variables:]
3991
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
    62
        BoldnessMask                    currently dummy; to allow ST-80 compatible subclassing
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
    63
        FixedFlag                       currently dummy; to allow ST-80 compatible subclassing
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
    64
        ItalicFlag                      currently dummy; to allow ST-80 compatible subclassing
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
    65
        OutlineFlag                     currently dummy; to allow ST-80 compatible subclassing
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
    66
        SerifFlag                       currently dummy; to allow ST-80 compatible subclassing
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
    67
        ShadowFlag                      currently dummy; to allow ST-80 compatible subclassing
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
    68
        StrikeoutFlag                   currently dummy; to allow ST-80 compatible subclassing
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
    69
        UnderlineFlag                   currently dummy; to allow ST-80 compatible subclassing
1265
c8030e99f941 added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
    70
611
e0442439a3c6 documentation
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
    71
    [author:]
e0442439a3c6 documentation
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
    72
        Claus Gittinger
629
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
    73
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
    74
    [see also:]
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
    75
        Font
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
    76
        FontPanel
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
    77
        GraphicsContext
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
    78
        ( introduction to view programming :html: programming/viewintro.html#FONTS )
52
edf02eb2939c Initial revision
claus
parents:
diff changeset
    79
"
edf02eb2939c Initial revision
claus
parents:
diff changeset
    80
! !
edf02eb2939c Initial revision
claus
parents:
diff changeset
    81
1265
c8030e99f941 added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
    82
!FontDescription class methodsFor:'initialization'!
c8030e99f941 added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
    83
c8030e99f941 added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
    84
initialize
c8030e99f941 added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
    85
    "initialize class variables"
c8030e99f941 added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
    86
5644
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
    87
    BoldnessMask              := 2r000000000111.      "/ allows for 8 boldnesses to be encoded
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
    88
    FixedFlag                 := 2r000000001000.
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
    89
    ItalicFlag                := 2r000000010000.
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
    90
    OutlineFlag               := 2r000000100000.
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
    91
    SerifFlag                 := 2r000001000000.
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
    92
    ShadowFlag                := 2r000010000000.
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
    93
    StrikeoutFlag             := 2r000100000000.
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
    94
    UnderlineFlag             := 2r001000000000.
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
    95
    GenericFlag               := 2r010000000000.      "/ This is a pseudo font
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
    96
    OverlappingCharactersFlag := 2r100000000000.      "/ special for windows
3827
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
    97
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
    98
    self initializeGenericFonts.
3987
796ff0ae8306 more mapping
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
    99
    self initializeCharacterEncodingToCharacterSetMapping.
3827
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   100
    self initializeCharacterSetToFontMapping.
5644
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
   101
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
   102
    "Modified: / 08-11-2010 / 13:12:08 / cg"
3827
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   103
!
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   104
3987
796ff0ae8306 more mapping
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   105
initializeCharacterEncodingToCharacterSetMapping
796ff0ae8306 more mapping
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   106
    "character encoding"
796ff0ae8306 more mapping
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   107
796ff0ae8306 more mapping
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   108
    CharacterEncodingToCharacterSetMapping isNil ifTrue:[
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   109
        CharacterEncodingToCharacterSetMapping := Dictionary withKeysAndValues:#(
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   110
            utf7        unicode
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   111
            #'utf-7'    unicode
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   112
            utf8        unicode
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   113
            #'utf-8'    unicode
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   114
        ).
3987
796ff0ae8306 more mapping
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   115
    ].
796ff0ae8306 more mapping
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   116
!
796ff0ae8306 more mapping
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   117
3827
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   118
initializeCharacterSetToFontMapping
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   119
    "character sets"
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   120
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   121
    CharacterSetToFontMapping isNil ifTrue:[
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   122
        CharacterSetToFontMapping := Dictionary withKeysAndValues: #(
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   123
            unicode        'iso10646-*'
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   124
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   125
            'koi8-r'       'iso8859-5'
3827
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   126
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   127
            'iso2022-jp'   'jis*0208*'
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   128
            'x-iso2022-jp' 'jis*0208*'
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   129
            'x-euc-jp'     'jis*0208*'
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   130
            'x-shift-jis'  'jis*0208*'
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   131
            'x-sjis'       'jis*0208*'
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   132
            'x-jis7'       'jis*0208*'
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   133
            'jis7'         'jis*0208*'
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   134
            'euc'          'jis*0208*'
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   135
            'euc-jp'       'jis*0208*'
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   136
            'sjis'         'jis*0208*'
3987
796ff0ae8306 more mapping
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   137
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   138
            'big5'         'big5*'
3987
796ff0ae8306 more mapping
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   139
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   140
            'gb2312'       'gb*'
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   141
            'hz-gb-2312'   'gb*'
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   142
            'x-gbk'        'gb*'
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   143
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   144
            'iso2022-kr'   'ksc*'
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   145
            'x-euc-kr'     'ksc*'
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   146
        ).
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   147
    ].
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   148
!
3827
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   149
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   150
initializeGenericFonts
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   151
    "generic fonts, that do not exist as a device fonts and are
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   152
     replaced by a real font"
3827
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   153
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   154
    GenericFonts isNil ifTrue:[
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   155
        GenericFonts := OrderedCollection new.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   156
        GenericFonts add:((self family:#serif face:nil style:nil size:0 sizeUnit:#pt encoding:nil) isGenericFont:true).
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   157
        GenericFonts add:((self family:#'sans-serif' face:nil style:nil size:0 sizeUnit:#pt encoding:nil) isGenericFont:true).
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   158
        GenericFonts add:((self family:#monospace face:nil style:nil size:0 sizeUnit:#pt encoding:nil) isGenericFont:true).
3827
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   159
    ].
1265
c8030e99f941 added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
   160
! !
c8030e99f941 added ST-80 compatible instVars (currently ignored, though)
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
   161
1275
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   162
!FontDescription class methodsFor:'instance creation'!
52
edf02eb2939c Initial revision
claus
parents:
diff changeset
   163
153
claus
parents: 109
diff changeset
   164
family:familyString
claus
parents: 109
diff changeset
   165
    "returns a font for given family and default (12pt) size 
3996
9ed3e413700c *** empty log message ***
ca
parents: 3993
diff changeset
   166
     with default encoding.
629
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   167
     The new fonts face defaults `medium', its style to `roman'.
153
claus
parents: 109
diff changeset
   168
     The returned font is not associated to a specific device"
claus
parents: 109
diff changeset
   169
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   170
    ^ self 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   171
        family:familyString
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   172
        face:(self defaultFace) 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   173
        style:(self defaultStyle) 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   174
        size:(self defaultSize) 
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   175
        sizeUnit:#pt
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   176
        encoding:(self defaultEncoding)
153
claus
parents: 109
diff changeset
   177
claus
parents: 109
diff changeset
   178
    "
claus
parents: 109
diff changeset
   179
     Font family:'helvetica'
claus
parents: 109
diff changeset
   180
     Font family:'courier'
claus
parents: 109
diff changeset
   181
    "
629
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   182
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   183
    "Modified: 30.4.1996 / 17:20:44 / cg"
153
claus
parents: 109
diff changeset
   184
!
claus
parents: 109
diff changeset
   185
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   186
family:familyString face:faceString size:sizeNum
3996
9ed3e413700c *** empty log message ***
ca
parents: 3993
diff changeset
   187
    "returns a font for given family and size with default encoding.
629
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   188
     The new fonts style defaults to `roman'.
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   189
     The returned font is not associated to a specific device"
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   190
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   191
    ^ self 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   192
        family:familyString
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   193
        face:faceString 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   194
        style:(self defaultStyle)
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   195
        size:sizeNum
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   196
        sizeUnit:#pt
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   197
        encoding:(self defaultEncoding)
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   198
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   199
    "
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   200
     Font family:'helvetica' face:'medium' size:10
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   201
     Font family:'helvetica' face:'bold' size:10
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   202
     Font family:'courier'   face:'bold' size:10
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   203
    "
629
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   204
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   205
    "Modified: 30.4.1996 / 17:21:07 / cg"
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   206
!
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   207
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   208
family:familyString face:faceString style:styleString size:sizeNum
3996
9ed3e413700c *** empty log message ***
ca
parents: 3993
diff changeset
   209
    "returns a font for given family, face, style and size with default encoding. 
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   210
     The returned font is not associated to a specific device"
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   211
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   212
    ^ self 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   213
        family:familyString
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   214
        face:faceString
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   215
        style:styleString
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   216
        size:sizeNum
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   217
        sizeUnit:#pt
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   218
        encoding:(self defaultEncoding)
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   219
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   220
    "
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   221
     Font family:'helvetica' face:'medium' style:'roman'  size:10
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   222
     Font family:'helvetica' face:'medium' style:'italic' size:10
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   223
     Font family:'helvetica' face:'bold'   style:'roman'  size:10
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   224
     Font family:'courier'   face:'bold'   style:'italic' size:10
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   225
    "
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   226
!
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   227
3993
7fc0939208e2 defaultEncoding is now 8859-1
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   228
family:familyString face:faceString style:styleString size:sizeNum encoding:encoding
3996
9ed3e413700c *** empty log message ***
ca
parents: 3993
diff changeset
   229
    "returns a font for given family, face, style, size and the specified encoding. 
576
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   230
     The returned font is not associated to a specific device"
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   231
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   232
    ^ self 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   233
          family:familyString 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   234
          face:faceString 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   235
          style:styleString 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   236
          size:sizeNum
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   237
          sizeUnit:#pt
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   238
          encoding:encoding
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   239
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   240
    "Modified: 20.4.1996 / 23:19:04 / cg"
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   241
!
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   242
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   243
family:familyString face:faceString style:styleString size:size sizeUnit:sizeUnit encoding:encoding
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   244
    "returns a font for given family, face, style, size and the specified encoding. 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   245
     The returned font is not associated to a specific device"
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   246
52
edf02eb2939c Initial revision
claus
parents:
diff changeset
   247
    ^ self new
576
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   248
          family:familyString 
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   249
          face:faceString 
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   250
          style:styleString 
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   251
          size:size
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   252
          sizeUnit:sizeUnit
3993
7fc0939208e2 defaultEncoding is now 8859-1
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   253
          encoding:encoding
576
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   254
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   255
    "Modified: 20.4.1996 / 23:19:04 / cg"
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   256
!
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   257
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   258
family:familyString pixelSize:sizeNum
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   259
    "returns a font for given family and pixelSize with default encoding.
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   260
     The new fonts face defaults to `medium', its style to `roman'.
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   261
     Notice: the returned font will typically only be usable on a screen, 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   262
     and will not scale as to the devices resolution.
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   263
     Use #family:size: for resolution-independent sizing."
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   264
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   265
    ^ self 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   266
        family:familyString
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   267
        face:(self defaultFace)
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   268
        style:(self defaultStyle)
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   269
        size:sizeNum
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   270
        sizeUnit:#px
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   271
        encoding:(self defaultEncoding)
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   272
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   273
    "
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   274
     (Font family:'helvetica' size:10) onDevice:Screen current
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   275
     (Font family:'helvetica' pixelSize:10) onDevice:Screen current
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   276
    "
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   277
!
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   278
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   279
family:familyString size:sizeNum
3996
9ed3e413700c *** empty log message ***
ca
parents: 3993
diff changeset
   280
    "returns a font for given family and size with default encoding.
629
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   281
     The new fonts face defaults to `medium', its style to `roman'.
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   282
     The returned font is not associated to a specific device"
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   283
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   284
    ^ self 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   285
        family:familyString
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   286
        face:(self defaultFace)
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   287
        style:(self defaultStyle)
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   288
        size:sizeNum
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   289
        sizeUnit:#pt
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   290
        encoding:(self defaultEncoding)
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   291
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   292
    "
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   293
     Font family:'helvetica' size:10
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   294
     Font family:'courier' size:10
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   295
    "
629
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   296
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   297
    "Modified: 30.4.1996 / 17:21:40 / cg"
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   298
!
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   299
4005
cbe56ccc85fa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3996
diff changeset
   300
family:familyString size:sizeNum encoding:encoding
cbe56ccc85fa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3996
diff changeset
   301
    "returns a font for given family and size with default encoding.
cbe56ccc85fa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3996
diff changeset
   302
     The new fonts face defaults to `medium', its style to `roman'.
cbe56ccc85fa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3996
diff changeset
   303
     The returned font is not associated to a specific device"
cbe56ccc85fa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3996
diff changeset
   304
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   305
    ^ self 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   306
        family:familyString
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   307
        face:(self defaultFace)
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   308
        style:(self defaultStyle)
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   309
        size:sizeNum
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   310
        sizeUnit:#pt
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   311
        encoding:encoding
4005
cbe56ccc85fa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3996
diff changeset
   312
cbe56ccc85fa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3996
diff changeset
   313
    "
cbe56ccc85fa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3996
diff changeset
   314
     Font family:'helvetica' size:10 encoding:#'iso8859-1'
cbe56ccc85fa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3996
diff changeset
   315
     Font family:'courier' size:10 encoding:#'iso8859-1'
cbe56ccc85fa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3996
diff changeset
   316
    "
cbe56ccc85fa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3996
diff changeset
   317
cbe56ccc85fa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3996
diff changeset
   318
    "Modified: 30.4.1996 / 17:21:40 / cg"
cbe56ccc85fa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3996
diff changeset
   319
!
cbe56ccc85fa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3996
diff changeset
   320
1071
ae5b36b93cf3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   321
family:familyString style:aStyle size:sizeNum
3996
9ed3e413700c *** empty log message ***
ca
parents: 3993
diff changeset
   322
    "returns a font for given family and size with default encoding.
1071
ae5b36b93cf3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   323
     The new fonts face defaults to `medium', its style to `roman'.
ae5b36b93cf3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   324
     The returned font is not associated to a specific device"
ae5b36b93cf3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   325
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   326
    ^ self 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   327
        family:familyString
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   328
        face:(self defaultFace)
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   329
        style:aStyle 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   330
        size:sizeNum
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   331
        sizeUnit:#pt
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   332
        encoding:(self defaultEncoding)
1071
ae5b36b93cf3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   333
ae5b36b93cf3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   334
    "
ae5b36b93cf3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   335
     Font family:'helvetica' style:#roman size:48
ae5b36b93cf3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   336
     Font family:'courier' style:#roman size:10
ae5b36b93cf3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   337
    "
ae5b36b93cf3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   338
ae5b36b93cf3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   339
    "Modified: 30.4.1996 / 17:21:40 / cg"
ae5b36b93cf3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   340
    "Created: 8.10.1996 / 18:33:55 / cg"
ae5b36b93cf3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   341
!
ae5b36b93cf3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   342
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   343
name:aFontName
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   344
    "returns a font with the given explicit name.
629
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   345
     WARNING:
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   346
       You shuld not use explicit naming, since font names vary
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   347
       with operatingSystems, devices and architecture.
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   348
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   349
     This interface is provided for special purposes only.
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   350
     On X, the name given should be according the X fontname conventions;
629
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   351
     i.e. something like: '-*-times-bold-r-normal-*-*-240-*-*-*-*-iso8859-1'.
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   352
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   353
     On other devices, font naming may be completely different."
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   354
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   355
    ^ self 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   356
        family:aFontName 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   357
        face:nil
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   358
        style:nil
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   359
        size:nil 
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   360
        sizeUnit:#px
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   361
        encoding:nil
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   362
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   363
    "
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   364
     Font name:'-*-times-bold-r-normal-*-*-240-*-*-*-*-iso8859-1'
629
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   365
     Font name:'6x10'
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   366
     Font name:'k14'
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   367
     ((Font name:'k14') on:Display) encoding
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   368
    "
629
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   369
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   370
    "Modified: 30.4.1996 / 17:23:09 / cg"
52
edf02eb2939c Initial revision
claus
parents:
diff changeset
   371
! !
edf02eb2939c Initial revision
claus
parents:
diff changeset
   372
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   373
!FontDescription class methodsFor:'accessing'!
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   374
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   375
genericFonts
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   376
    ^ GenericFonts
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   377
! !
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   378
3993
7fc0939208e2 defaultEncoding is now 8859-1
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   379
!FontDescription class methodsFor:'defaults'!
7fc0939208e2 defaultEncoding is now 8859-1
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   380
7fc0939208e2 defaultEncoding is now 8859-1
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   381
defaultEncoding
7fc0939208e2 defaultEncoding is now 8859-1
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   382
    ^ #'iso8859-1'
3996
9ed3e413700c *** empty log message ***
ca
parents: 3993
diff changeset
   383
!
9ed3e413700c *** empty log message ***
ca
parents: 3993
diff changeset
   384
9ed3e413700c *** empty log message ***
ca
parents: 3993
diff changeset
   385
defaultFace
9ed3e413700c *** empty log message ***
ca
parents: 3993
diff changeset
   386
    ^ 'medium'
9ed3e413700c *** empty log message ***
ca
parents: 3993
diff changeset
   387
!
9ed3e413700c *** empty log message ***
ca
parents: 3993
diff changeset
   388
9ed3e413700c *** empty log message ***
ca
parents: 3993
diff changeset
   389
defaultSize
9ed3e413700c *** empty log message ***
ca
parents: 3993
diff changeset
   390
    ^ 12
9ed3e413700c *** empty log message ***
ca
parents: 3993
diff changeset
   391
!
9ed3e413700c *** empty log message ***
ca
parents: 3993
diff changeset
   392
9ed3e413700c *** empty log message ***
ca
parents: 3993
diff changeset
   393
defaultStyle
9ed3e413700c *** empty log message ***
ca
parents: 3993
diff changeset
   394
    ^ 'roman' 
3993
7fc0939208e2 defaultEncoding is now 8859-1
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   395
! !
7fc0939208e2 defaultEncoding is now 8859-1
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   396
3827
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   397
!FontDescription class methodsFor:'queries'!
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   398
3987
796ff0ae8306 more mapping
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   399
characterSetForCharacterEncoding:encodingName
796ff0ae8306 more mapping
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   400
    "return the font-encoding for a character encoding"
796ff0ae8306 more mapping
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   401
4018
473a63a09368 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
   402
    ^ CharacterEncodingToCharacterSetMapping at:encodingName ifAbsent:encodingName
3987
796ff0ae8306 more mapping
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   403
796ff0ae8306 more mapping
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   404
    "
4018
473a63a09368 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
   405
     FontDescription characterSetForCharacterEncoding:'utf8'     
473a63a09368 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
   406
     FontDescription characterSetForCharacterEncoding:'koi8-r'     
473a63a09368 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
   407
     FontDescription characterSetForCharacterEncoding:'unicode'     
3987
796ff0ae8306 more mapping
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   408
    "
796ff0ae8306 more mapping
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   409
!
796ff0ae8306 more mapping
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   410
3827
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   411
fontNamePatternForCharset:aCharSetName
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   412
    "return the font-encoding for an iso-charset"
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   413
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   414
    ^ CharacterSetToFontMapping at:aCharSetName ifAbsent:nil
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   415
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   416
    "
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   417
     FontDescription fontNamePatternForCharset:'iso2022-jp'       
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   418
     FontDescription fontNamePatternForCharset:'euc-jp'     
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   419
    "
4010
7f899eceaf2d preferredFontEncodingFor moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents: 4005
diff changeset
   420
!
7f899eceaf2d preferredFontEncodingFor moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents: 4005
diff changeset
   421
7f899eceaf2d preferredFontEncodingFor moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents: 4005
diff changeset
   422
preferredFontEncodingFor:fileEncoding
7f899eceaf2d preferredFontEncodingFor moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents: 4005
diff changeset
   423
    "given a file encoding, return a corresponding match pattern for a preferred fontEncoding"
7f899eceaf2d preferredFontEncodingFor moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents: 4005
diff changeset
   424
7f899eceaf2d preferredFontEncodingFor moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents: 4005
diff changeset
   425
    |ce fe|
7f899eceaf2d preferredFontEncodingFor moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents: 4005
diff changeset
   426
7f899eceaf2d preferredFontEncodingFor moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents: 4005
diff changeset
   427
    ce := FontDescription characterSetForCharacterEncoding:fileEncoding.
7f899eceaf2d preferredFontEncodingFor moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents: 4005
diff changeset
   428
    ce isNil ifTrue:[
7f899eceaf2d preferredFontEncodingFor moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents: 4005
diff changeset
   429
        ce := fileEncoding.
7f899eceaf2d preferredFontEncodingFor moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents: 4005
diff changeset
   430
    ].
7f899eceaf2d preferredFontEncodingFor moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents: 4005
diff changeset
   431
7f899eceaf2d preferredFontEncodingFor moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents: 4005
diff changeset
   432
    fe := FontDescription fontNamePatternForCharset:ce.
7f899eceaf2d preferredFontEncodingFor moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents: 4005
diff changeset
   433
    fe notNil ifTrue:[^ fe].
7f899eceaf2d preferredFontEncodingFor moved from FileBrowser
Claus Gittinger <cg@exept.de>
parents: 4005
diff changeset
   434
    ^ ce ? 'iso8859*'
3827
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   435
! !
3390983893a2 font stuff moved from MIMETypes
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
   436
3880
c4c8268a2d9f method category rename
Claus Gittinger <cg@exept.de>
parents: 3827
diff changeset
   437
!FontDescription methodsFor:'Compatibility-ST80'!
1277
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   438
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   439
boldness:aNumber
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   440
    "added for ST-80 compatibility; actually ignored currently"
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   441
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   442
    |val|
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   443
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   444
    flags isNil ifTrue:[
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   445
        flags := masks := 0
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   446
    ].
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   447
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   448
    "/ scale from 0..1 to 0..BoldnessMask
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   449
    val := (aNumber max:0.0) min:1.0.
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   450
    val := (BoldnessMask * val) rounded.
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   451
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   452
    flags := flags bitOr:val.
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   453
    masks := masks bitOr:BoldnessMask
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   454
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   455
    "Created: 25.1.1997 / 03:20:05 / cg"
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   456
    "Modified: 25.1.1997 / 03:20:47 / cg"
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   457
!
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   458
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   459
color:aColor
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   460
    "added for ST-80 compatibility; actually ignored currently"
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   461
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   462
    "Created: 25.1.1997 / 03:21:28 / cg"
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   463
!
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   464
1760
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   465
encodings:aCollectionOfEncodings
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   466
    "added for ST-80 compatibility; actually ignored currently"
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   467
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   468
    "Created: 20.6.1997 / 09:52:46 / cg"
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   469
!
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   470
1277
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   471
fixedWidth:aBoolean
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   472
    "added for ST-80 compatibility; actually ignored currently"
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   473
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   474
    flags isNil ifTrue:[
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   475
        flags := masks := 0
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   476
    ].
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   477
    aBoolean ifTrue:[
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   478
        flags := flags bitOr:FixedFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   479
        masks := masks bitOr:FixedFlag
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   480
    ] ifFalse:[
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   481
        flags := flags bitClear:FixedFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   482
        masks := masks bitClear:FixedFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   483
    ].
1277
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   484
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   485
    "Created: 25.1.1997 / 03:14:06 / cg"
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   486
    "Modified: 25.1.1997 / 03:21:03 / cg"
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   487
!
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   488
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   489
italic:aBoolean
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   490
    "added for ST-80 compatibility; actually ignored currently"
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   491
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   492
    flags isNil ifTrue:[
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   493
        flags := masks := 0
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   494
    ].
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   495
    aBoolean ifTrue:[
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   496
        flags := flags bitOr:ItalicFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   497
        masks := masks bitOr:ItalicFlag
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   498
    ] ifFalse:[
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   499
        flags := flags bitClear:ItalicFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   500
        masks := masks bitClear:ItalicFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   501
    ].
1277
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   502
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   503
    "Created: 25.1.1997 / 03:15:37 / cg"
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   504
    "Modified: 25.1.1997 / 03:20:55 / cg"
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   505
!
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   506
1760
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   507
outline:aBoolean
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   508
    "added for ST-80 compatibility; actually ignored currently"
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   509
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   510
    flags isNil ifTrue:[
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   511
        flags := masks := 0
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   512
    ].
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   513
    aBoolean ifTrue:[
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   514
        flags := flags bitOr:OutlineFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   515
        masks := masks bitOr:OutlineFlag
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   516
    ] ifFalse:[
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   517
        flags := flags bitClear:OutlineFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   518
        masks := masks bitClear:OutlineFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   519
    ].
1760
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   520
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   521
    "Modified: 25.1.1997 / 03:20:55 / cg"
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   522
    "Created: 20.6.1997 / 09:50:06 / cg"
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   523
!
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   524
5165
3b03bd5bb18e preps for pixelSize fonts
Claus Gittinger <cg@exept.de>
parents: 4894
diff changeset
   525
pixelSize
3b03bd5bb18e preps for pixelSize fonts
Claus Gittinger <cg@exept.de>
parents: 4894
diff changeset
   526
    ^ pixelSize 
3b03bd5bb18e preps for pixelSize fonts
Claus Gittinger <cg@exept.de>
parents: 4894
diff changeset
   527
!
3b03bd5bb18e preps for pixelSize fonts
Claus Gittinger <cg@exept.de>
parents: 4894
diff changeset
   528
1277
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   529
pixelSize:aNumber
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   530
    "if specified, the size is ignored, and a pixel-sized font is chosen."
1277
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   531
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   532
    pixelSize := aNumber.
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   533
    sizeUnit := #px.
1277
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   534
!
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   535
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   536
serif:aBoolean
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   537
    "added for ST-80 compatibility; actually ignored currently"
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   538
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   539
    flags isNil ifTrue:[
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   540
        flags := masks := 0
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   541
    ].
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   542
    aBoolean ifTrue:[
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   543
        flags := flags bitOr:SerifFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   544
        masks := masks bitOr:SerifFlag
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   545
    ] ifFalse:[
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   546
        flags := flags bitClear:SerifFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   547
        masks := masks bitClear:SerifFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   548
    ].
1277
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   549
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   550
    "Created: 25.1.1997 / 03:15:17 / cg"
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   551
    "Modified: 25.1.1997 / 03:20:59 / cg"
1760
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   552
!
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   553
5196
90aeedb2a2b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   554
setPixelSize:aNumber
90aeedb2a2b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   555
    pixelSize := aNumber.
90aeedb2a2b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   556
!
90aeedb2a2b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   557
1760
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   558
shadow:aBoolean
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   559
    "added for ST-80 compatibility; actually ignored currently"
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   560
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   561
    flags isNil ifTrue:[
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   562
        flags := masks := 0
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   563
    ].
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   564
    aBoolean ifTrue:[
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   565
        flags := flags bitOr:ShadowFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   566
        masks := masks bitOr:ShadowFlag
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   567
    ] ifFalse:[
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   568
        flags := flags bitClear:ShadowFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   569
        masks := masks bitClear:ShadowFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   570
    ].
1760
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   571
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   572
    "Modified: 25.1.1997 / 03:20:55 / cg"
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   573
    "Created: 20.6.1997 / 09:51:03 / cg"
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   574
!
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   575
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   576
strikeout:aBoolean
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   577
    "added for ST-80 compatibility; actually ignored currently"
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   578
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   579
    flags isNil ifTrue:[
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   580
        flags := masks := 0
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   581
    ].
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   582
    aBoolean ifTrue:[
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   583
        flags := flags bitOr:StrikeoutFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   584
        masks := masks bitOr:StrikeoutFlag
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   585
    ] ifFalse:[
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   586
        flags := flags bitClear:StrikeoutFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   587
        masks := masks bitClear:StrikeoutFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   588
    ].
1760
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   589
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   590
    "Modified: 25.1.1997 / 03:20:55 / cg"
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   591
    "Created: 20.6.1997 / 09:51:36 / cg"
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   592
!
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   593
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   594
underline:aBoolean
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   595
    "added for ST-80 compatibility; actually ignored currently"
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   596
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   597
    flags isNil ifTrue:[
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   598
        flags := masks := 0
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   599
    ].
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   600
    aBoolean ifTrue:[
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   601
        flags := flags bitOr:UnderlineFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   602
        masks := masks bitOr:UnderlineFlag
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   603
    ] ifFalse:[
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   604
        flags := flags bitClear:UnderlineFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   605
        masks := masks bitClear:UnderlineFlag.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   606
    ].
1760
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   607
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   608
    "Modified: 25.1.1997 / 03:20:55 / cg"
ccd221469891 more ST80 compatibility (partially dummy)
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
   609
    "Created: 20.6.1997 / 09:51:18 / cg"
1277
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   610
! !
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   611
52
edf02eb2939c Initial revision
claus
parents:
diff changeset
   612
!FontDescription methodsFor:'accessing'!
edf02eb2939c Initial revision
claus
parents:
diff changeset
   613
2544
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
   614
device
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
   615
    "return the device I am on"
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
   616
4146
4c46ae30bd64 Use #graphicsDevice
Stefan Vogel <sv@exept.de>
parents: 4018
diff changeset
   617
    <resource:#obsolete>
4c46ae30bd64 Use #graphicsDevice
Stefan Vogel <sv@exept.de>
parents: 4018
diff changeset
   618
3661
b96d4f68b36e device -> graphicsDevice
Michael Beyl <mb@exept.de>
parents: 3629
diff changeset
   619
    self obsoleteMethodWarning:'use #graphicsDevice'.
b96d4f68b36e device -> graphicsDevice
Michael Beyl <mb@exept.de>
parents: 3629
diff changeset
   620
    ^ self graphicsDevice
2544
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
   621
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
   622
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   623
encoding
575
ad65411701b0 commentary
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   624
    "return the fonts encoding, as a symbol
456
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
   625
     such as #'iso8859', #'jis0208.1983' or #ascii.
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
   626
     If the fonts encoding is not known, return nil; 
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
   627
     You should assume ascii-encoding then."
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   628
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   629
    ^ encoding
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   630
575
ad65411701b0 commentary
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   631
    "Modified: 20.4.1996 / 23:14:36 / cg"
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   632
!
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   633
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   634
face
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   635
    "return the face, a string"
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   636
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   637
    ^ face
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   638
!
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   639
4892
9b15605f58ff check: bad change of attributes of a REAL font
Claus Gittinger <cg@exept.de>
parents: 4627
diff changeset
   640
face:aString
9b15605f58ff check: bad change of attributes of a REAL font
Claus Gittinger <cg@exept.de>
parents: 4627
diff changeset
   641
    "set the face, a string such as 'bold'"
9b15605f58ff check: bad change of attributes of a REAL font
Claus Gittinger <cg@exept.de>
parents: 4627
diff changeset
   642
9b15605f58ff check: bad change of attributes of a REAL font
Claus Gittinger <cg@exept.de>
parents: 4627
diff changeset
   643
    self assert:(self fontId isNil). "/ cannot change an instanciated font
9b15605f58ff check: bad change of attributes of a REAL font
Claus Gittinger <cg@exept.de>
parents: 4627
diff changeset
   644
    face := aString
9b15605f58ff check: bad change of attributes of a REAL font
Claus Gittinger <cg@exept.de>
parents: 4627
diff changeset
   645
9b15605f58ff check: bad change of attributes of a REAL font
Claus Gittinger <cg@exept.de>
parents: 4627
diff changeset
   646
    "Created: 25.1.1997 / 03:12:12 / cg"
9b15605f58ff check: bad change of attributes of a REAL font
Claus Gittinger <cg@exept.de>
parents: 4627
diff changeset
   647
!
9b15605f58ff check: bad change of attributes of a REAL font
Claus Gittinger <cg@exept.de>
parents: 4627
diff changeset
   648
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   649
family
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   650
    "return the family, a string"
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   651
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   652
    ^ family
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   653
!
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   654
1277
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   655
family:aString
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   656
    "set the family, a string"
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   657
4892
9b15605f58ff check: bad change of attributes of a REAL font
Claus Gittinger <cg@exept.de>
parents: 4627
diff changeset
   658
    self assert:(self fontId isNil). "/ cannot change an instanciated font
1277
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   659
    family := aString
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   660
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   661
    "Created: 25.1.1997 / 03:12:12 / cg"
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   662
!
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   663
89
ea2bf46eb669 *** empty log message ***
claus
parents: 52
diff changeset
   664
family:familyString face:faceString style:styleString size:sizeNum encoding:encodingString
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   665
    <resource: #obsolete>
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   666
    "set the instance values"
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   667
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   668
    self 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   669
        family:familyString 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   670
        face:faceString 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   671
        style:styleString 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   672
        size:sizeNum 
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   673
        sizeUnit:#pt
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   674
        encoding:encodingString
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   675
!
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   676
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   677
family:familyString face:faceString style:styleString size:sizeArg sizeUnit:sizeUnitArg encoding:encodingString
576
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   678
    "set the instance values"
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   679
4892
9b15605f58ff check: bad change of attributes of a REAL font
Claus Gittinger <cg@exept.de>
parents: 4627
diff changeset
   680
    self assert:(self fontId isNil). "/ cannot change an instanciated font
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   681
89
ea2bf46eb669 *** empty log message ***
claus
parents: 52
diff changeset
   682
    family := familyString asSymbol.
229
099543e5d779 handle empty family/style/encoding strings
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   683
    (faceString notNil and:[faceString notEmpty]) ifTrue:[
576
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   684
        face := faceString asSymbol.
89
ea2bf46eb669 *** empty log message ***
claus
parents: 52
diff changeset
   685
    ].
229
099543e5d779 handle empty family/style/encoding strings
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   686
    (styleString notNil and:[styleString notEmpty]) ifTrue:[
576
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   687
        style := styleString asSymbol.
89
ea2bf46eb669 *** empty log message ***
claus
parents: 52
diff changeset
   688
    ].
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   689
    sizeUnit := sizeUnitArg.
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   690
    sizeUnit == #px ifTrue:[
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   691
        pixelSize := sizeArg.
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   692
    ] ifFalse:[
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   693
        size := sizeArg.
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   694
    ].
229
099543e5d779 handle empty family/style/encoding strings
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   695
    (encodingString notNil and:[encodingString notEmpty]) ifTrue:[
576
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   696
        encoding := encodingString asSymbol.
89
ea2bf46eb669 *** empty log message ***
claus
parents: 52
diff changeset
   697
    ]
229
099543e5d779 handle empty family/style/encoding strings
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   698
576
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   699
    "Modified: 20.4.1996 / 23:19:25 / cg"
52
edf02eb2939c Initial revision
claus
parents:
diff changeset
   700
!
edf02eb2939c Initial revision
claus
parents:
diff changeset
   701
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   702
flags
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   703
    ^ flags
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   704
!
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   705
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   706
flags:something
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   707
    flags := something.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   708
!
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   709
2544
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
   710
fontId
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
   711
    "return the device-dependent font-id"
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
   712
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
   713
    ^ nil
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
   714
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
   715
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
   716
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
   717
3661
b96d4f68b36e device -> graphicsDevice
Michael Beyl <mb@exept.de>
parents: 3629
diff changeset
   718
graphicsDevice
b96d4f68b36e device -> graphicsDevice
Michael Beyl <mb@exept.de>
parents: 3629
diff changeset
   719
    "return the device I am on"
b96d4f68b36e device -> graphicsDevice
Michael Beyl <mb@exept.de>
parents: 3629
diff changeset
   720
b96d4f68b36e device -> graphicsDevice
Michael Beyl <mb@exept.de>
parents: 3629
diff changeset
   721
    ^ nil
b96d4f68b36e device -> graphicsDevice
Michael Beyl <mb@exept.de>
parents: 3629
diff changeset
   722
!
b96d4f68b36e device -> graphicsDevice
Michael Beyl <mb@exept.de>
parents: 3629
diff changeset
   723
5644
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
   724
hasOverlappingCharacters:aBoolean 
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
   725
    "set wether this has overlapping chars (for windows cleartype drawing only)"
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
   726
    
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
   727
    flags := (flags ? 0) changeMask:OverlappingCharactersFlag to:aBoolean
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
   728
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
   729
    "Created: / 08-11-2010 / 13:16:23 / cg"
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
   730
!
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
   731
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   732
isGenericFont:aBoolean 
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   733
    "set wether this is a pseudo font"
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   734
    
5644
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
   735
    flags := (flags ? 0) changeMask:GenericFlag to:aBoolean
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
   736
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
   737
    "Modified: / 08-11-2010 / 12:58:03 / cg"
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   738
!
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   739
1277
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   740
manufacturer
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   741
    "return the value of the instance variable 'manufacturer' (automatically generated)"
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   742
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   743
    ^ manufacturer
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   744
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   745
    "Created: 25.1.1997 / 03:12:43 / cg"
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   746
!
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   747
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   748
manufacturer:something
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   749
    "set the value of the instance variable 'manufacturer' (automatically generated)"
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   750
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   751
    manufacturer := something.
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   752
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   753
    "Created: 25.1.1997 / 03:12:43 / cg"
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   754
!
f79716195219 more ST-80 stuff
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
   755
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   756
masks
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   757
    ^ masks
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   758
!
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   759
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   760
masks:something
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   761
    masks := something.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   762
!
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   763
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   764
sizeUnit
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   765
    "currently returns one of #pt or #px (internal use only)"
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   766
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   767
    ^ sizeUnit ? #pt
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   768
!
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   769
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   770
style
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   771
    "return the style, a string"
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   772
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   773
    ^ style
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   774
! !
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   775
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   776
!FontDescription methodsFor:'comparing'!
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   777
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   778
= aFont
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   779
    "two fonts are considered equal, if the font-name components are;
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   780
     independent of the device, the font is on"
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   781
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   782
    (aFont species == self species) ifTrue:[
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   783
	(size == aFont size) ifTrue:[
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   784
	    (family = aFont family) ifTrue:[
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   785
		(face = aFont face) ifTrue:[
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   786
		    (style = aFont style) ifTrue:[
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   787
			(encoding == aFont encoding) ifTrue:[
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   788
			    ^ true
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   789
			]
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   790
		    ]
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   791
		]
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   792
	    ]
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   793
	]
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   794
    ].
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   795
    ^ false
2160
b57a3f138ae3 added #hash
Claus Gittinger <cg@exept.de>
parents: 1760
diff changeset
   796
!
b57a3f138ae3 added #hash
Claus Gittinger <cg@exept.de>
parents: 1760
diff changeset
   797
b57a3f138ae3 added #hash
Claus Gittinger <cg@exept.de>
parents: 1760
diff changeset
   798
hash
b57a3f138ae3 added #hash
Claus Gittinger <cg@exept.de>
parents: 1760
diff changeset
   799
    "return a number for hashing - req'd since = is redefined."
b57a3f138ae3 added #hash
Claus Gittinger <cg@exept.de>
parents: 1760
diff changeset
   800
2771
25c96682a2f3 really avoid LargeInteger arithmetic
Claus Gittinger <cg@exept.de>
parents: 2770
diff changeset
   801
    ^ ( (family hash bitAnd:16r1FFFFFFF)
25c96682a2f3 really avoid LargeInteger arithmetic
Claus Gittinger <cg@exept.de>
parents: 2770
diff changeset
   802
      + (face hash bitAnd:16r1FFFFFFF)
25c96682a2f3 really avoid LargeInteger arithmetic
Claus Gittinger <cg@exept.de>
parents: 2770
diff changeset
   803
      + (style hash bitAnd:16r1FFFFFFF)
3019
6dc6821c111c oops - care for fractional size in #hash
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
   804
      + (size ? 0) asInteger) bitAnd:16r3FFFFFFF
2160
b57a3f138ae3 added #hash
Claus Gittinger <cg@exept.de>
parents: 1760
diff changeset
   805
b57a3f138ae3 added #hash
Claus Gittinger <cg@exept.de>
parents: 1760
diff changeset
   806
    "Created: / 19.6.1998 / 04:19:06 / cg"
2164
2bd89f5166a9 oops - fixed #hash.
Claus Gittinger <cg@exept.de>
parents: 2160
diff changeset
   807
    "Modified: / 20.6.1998 / 17:04:00 / cg"
5166
a9cd84083df5 preps for pixelSized fonts
Claus Gittinger <cg@exept.de>
parents: 5165
diff changeset
   808
!
a9cd84083df5 preps for pixelSized fonts
Claus Gittinger <cg@exept.de>
parents: 5165
diff changeset
   809
a9cd84083df5 preps for pixelSized fonts
Claus Gittinger <cg@exept.de>
parents: 5165
diff changeset
   810
sameDeviceFontAs:aFont
a9cd84083df5 preps for pixelSized fonts
Claus Gittinger <cg@exept.de>
parents: 5165
diff changeset
   811
    (family = aFont family) ifFalse:[ ^ false ].
a9cd84083df5 preps for pixelSized fonts
Claus Gittinger <cg@exept.de>
parents: 5165
diff changeset
   812
    (face = aFont face) ifFalse:[ ^ false ].
a9cd84083df5 preps for pixelSized fonts
Claus Gittinger <cg@exept.de>
parents: 5165
diff changeset
   813
    ((style = aFont style) 
a9cd84083df5 preps for pixelSized fonts
Claus Gittinger <cg@exept.de>
parents: 5165
diff changeset
   814
    or:[ (style = 'italic' and:[aFont style = 'oblique'])
a9cd84083df5 preps for pixelSized fonts
Claus Gittinger <cg@exept.de>
parents: 5165
diff changeset
   815
    or:[ style = 'oblique' and:[aFont style = 'italic']]]) ifFalse:[ ^ false ].
5441
04ebe289a7e0 changed: #sameDeviceFontAs:
Claus Gittinger <cg@exept.de>
parents: 5223
diff changeset
   816
5166
a9cd84083df5 preps for pixelSized fonts
Claus Gittinger <cg@exept.de>
parents: 5165
diff changeset
   817
    (encoding isNil or:[encoding = aFont encoding]) ifFalse:[ ^ false ].
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   818
    (sizeUnit ? #pt) = aFont sizeUnit ifFalse:[ ^ false ].
5191
d3b4c72a8871 changed #sameDeviceFontAs:
Claus Gittinger <cg@exept.de>
parents: 5185
diff changeset
   819
    (sizeUnit ? #pt) == #pt ifTrue:[
d3b4c72a8871 changed #sameDeviceFontAs:
Claus Gittinger <cg@exept.de>
parents: 5185
diff changeset
   820
        (size = aFont size) ifFalse:[ ^ false ].
d3b4c72a8871 changed #sameDeviceFontAs:
Claus Gittinger <cg@exept.de>
parents: 5185
diff changeset
   821
    ] ifFalse:[
d3b4c72a8871 changed #sameDeviceFontAs:
Claus Gittinger <cg@exept.de>
parents: 5185
diff changeset
   822
        (pixelSize = aFont pixelSize) ifFalse:[ ^ false ].
d3b4c72a8871 changed #sameDeviceFontAs:
Claus Gittinger <cg@exept.de>
parents: 5185
diff changeset
   823
    ].
5166
a9cd84083df5 preps for pixelSized fonts
Claus Gittinger <cg@exept.de>
parents: 5165
diff changeset
   824
    ^ true
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   825
! !
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   826
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   827
!FontDescription methodsFor:'converting'!
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   828
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   829
asBold
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   830
    "return the bold font corresponding to the receiver"
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
   831
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   832
    ^ self asFace:#bold
4627
c3992b15969c asBold / asItalic return device fonts, if the receiver is one.
Claus Gittinger <cg@exept.de>
parents: 4626
diff changeset
   833
!
c3992b15969c asBold / asItalic return device fonts, if the receiver is one.
Claus Gittinger <cg@exept.de>
parents: 4626
diff changeset
   834
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   835
asFace:anotherFace
4894
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   836
    "return the bold font corresponding to the receiver"
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   837
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   838
    |newFont|
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   839
4894
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   840
    family isNil ifTrue:[
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   841
        "CompoundFonts do not have a family"
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   842
        ^ self
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   843
    ].
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   844
    newFont := self class 
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   845
                    family:family 
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   846
                    face:anotherFace 
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   847
                    style:style 
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   848
                    size:(sizeUnit == #px ifTrue:[pixelSize] ifFalse:[size]) 
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   849
                    sizeUnit:sizeUnit
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   850
                    encoding:encoding.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   851
    newFont isGenericFont:self isGenericFont.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   852
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   853
    ^ newFont onDevice:self graphicsDevice.
4894
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   854
!
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   855
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   856
asFamily:anotherFamily
4894
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   857
    "return another font corresponding to the receiver face, style and size but
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   858
     with another family"
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   859
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   860
    family isNil ifTrue:[
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   861
        "CompoundFonts do not have a family"
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   862
        ^ self
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   863
    ].
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   864
    ^ (self class 
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   865
        family:anotherFamily 
4894
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   866
        face:face 
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   867
        style:style 
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   868
        size:(sizeUnit == #px ifTrue:[pixelSize] ifFalse:[size]) 
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   869
        sizeUnit:sizeUnit
4894
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   870
        encoding:encoding) onDevice:self graphicsDevice.
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   871
!
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   872
5560
4f874d66dbde added: #asFontDescription
ca
parents: 5535
diff changeset
   873
asFontDescription
4f874d66dbde added: #asFontDescription
ca
parents: 5535
diff changeset
   874
    ^ self
4f874d66dbde added: #asFontDescription
ca
parents: 5535
diff changeset
   875
!
4f874d66dbde added: #asFontDescription
ca
parents: 5535
diff changeset
   876
5196
90aeedb2a2b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   877
asFontWithPixelSize:anotherSize
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   878
    "return another font corresponding to the receivers family, face and style but
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   879
     with another pixel size"
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   880
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   881
    |newFont|
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   882
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   883
    family isNil ifTrue:[
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   884
        "CompoundFonts do not have a family"
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   885
        ^ self
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   886
    ].
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   887
    newFont := self class 
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   888
        family:family 
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   889
        face:face 
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   890
        style:style 
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   891
        size:anotherSize 
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   892
        sizeUnit:#px
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   893
        encoding:encoding.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   894
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   895
    newFont isGenericFont:self isGenericFont.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   896
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   897
    ^ newFont onDevice:self graphicsDevice.
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   898
!
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   899
5196
90aeedb2a2b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   900
asItalic
90aeedb2a2b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   901
    "return the italic font corresponding to the receiver"
90aeedb2a2b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   902
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   903
    ^ self asStyle:#oblique
5196
90aeedb2a2b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   904
!
90aeedb2a2b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5191
diff changeset
   905
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   906
asSize:anotherSize
4894
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   907
    "return another font corresponding to the receivers family, face and style but
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   908
     with another size"
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   909
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   910
    |newFont|
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   911
4894
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   912
    family isNil ifTrue:[
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   913
        "CompoundFonts do not have a family"
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   914
        ^ self
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   915
    ].
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   916
    newFont := self class 
4894
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   917
        family:family 
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   918
        face:face 
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   919
        style:style 
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   920
        size:anotherSize 
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   921
        sizeUnit:#pt
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   922
        encoding:encoding.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   923
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   924
     newFont isGenericFont:self isGenericFont.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   925
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   926
    ^ newFont onDevice:self graphicsDevice.
4894
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   927
!
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   928
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   929
asStyle:anotherStyle
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   930
    |newFont|
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   931
4894
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   932
    family isNil ifTrue:[
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   933
        "CompoundFonts do not have a family"
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   934
        ^ self
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   935
    ].
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   936
    newFont := self class 
4894
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   937
        family:family 
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   938
        face:face 
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   939
        style:anotherStyle 
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   940
        size:(sizeUnit == #px ifTrue:[pixelSize] ifFalse:[size]) 
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   941
        sizeUnit:sizeUnit
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   942
        encoding:encoding.
4894
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   943
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   944
    newFont isGenericFont:self isGenericFont.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   945
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
   946
    ^ newFont onDevice:self graphicsDevice.
4894
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   947
    "Modified: / 27-09-2006 / 13:08:11 / cg"
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   948
!
37a8c77e6206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4892
diff changeset
   949
4297
10b461a37e26 added encoding to literal vector
Claus Gittinger <cg@exept.de>
parents: 4146
diff changeset
   950
fromLiteralArrayEncoding:literalEncoding
2436
4ef8d33c8951 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   951
    "read my contents from a aLiteralEncodedArray.
4ef8d33c8951 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   952
     Must match to what is generated in #literalArrayEncoding"
1740
804c5b51ec29 fromLiteralArrayEncoding:
ca
parents: 1618
diff changeset
   953
4297
10b461a37e26 added encoding to literal vector
Claus Gittinger <cg@exept.de>
parents: 4146
diff changeset
   954
    family := literalEncoding at:2.
10b461a37e26 added encoding to literal vector
Claus Gittinger <cg@exept.de>
parents: 4146
diff changeset
   955
    face   := literalEncoding at:3.
10b461a37e26 added encoding to literal vector
Claus Gittinger <cg@exept.de>
parents: 4146
diff changeset
   956
    style  := literalEncoding at:4.
10b461a37e26 added encoding to literal vector
Claus Gittinger <cg@exept.de>
parents: 4146
diff changeset
   957
    size   := literalEncoding at:5.
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   958
    "/ the following kludge is for backward compatibility 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   959
    "/ do not cleanup !!
4297
10b461a37e26 added encoding to literal vector
Claus Gittinger <cg@exept.de>
parents: 4146
diff changeset
   960
    literalEncoding size > 5 ifTrue:[
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   961
        literalEncoding size > 6 ifTrue:[
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   962
            sizeUnit := literalEncoding at:7.
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   963
            literalEncoding size > 7 ifTrue:[
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   964
                pixelSize := literalEncoding at:8.
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   965
            ].
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   966
        ].
4297
10b461a37e26 added encoding to literal vector
Claus Gittinger <cg@exept.de>
parents: 4146
diff changeset
   967
        encoding := literalEncoding at:6
4298
2b347bca3941 encoding
Claus Gittinger <cg@exept.de>
parents: 4297
diff changeset
   968
    ] ifFalse:[
2b347bca3941 encoding
Claus Gittinger <cg@exept.de>
parents: 4297
diff changeset
   969
        encoding := #'iso8859-1'
4297
10b461a37e26 added encoding to literal vector
Claus Gittinger <cg@exept.de>
parents: 4146
diff changeset
   970
    ].
1740
804c5b51ec29 fromLiteralArrayEncoding:
ca
parents: 1618
diff changeset
   971
!
804c5b51ec29 fromLiteralArrayEncoding:
ca
parents: 1618
diff changeset
   972
804c5b51ec29 fromLiteralArrayEncoding:
ca
parents: 1618
diff changeset
   973
literalArrayEncoding
2436
4ef8d33c8951 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   974
    "return myself encoded as a literal array.
4ef8d33c8951 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   975
     Must match to what is expected in #fromLiteralArrayEncoding:"
1740
804c5b51ec29 fromLiteralArrayEncoding:
ca
parents: 1618
diff changeset
   976
4298
2b347bca3941 encoding
Claus Gittinger <cg@exept.de>
parents: 4297
diff changeset
   977
    |myName|
2b347bca3941 encoding
Claus Gittinger <cg@exept.de>
parents: 4297
diff changeset
   978
4532
81d5a57183bd Fix comments.
Stefan Vogel <sv@exept.de>
parents: 4526
diff changeset
   979
    myName := self class name.
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   980
    "/ see comment in #fromLiteralArrayEncoding
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   981
    "/ do not cleanup !!
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   982
    (pixelSize isNil
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   983
    and:[ encoding == #'iso8859-1' ]) ifTrue:[
4298
2b347bca3941 encoding
Claus Gittinger <cg@exept.de>
parents: 4297
diff changeset
   984
        ^ Array
2b347bca3941 encoding
Claus Gittinger <cg@exept.de>
parents: 4297
diff changeset
   985
            with:myName
2b347bca3941 encoding
Claus Gittinger <cg@exept.de>
parents: 4297
diff changeset
   986
            with:family
2b347bca3941 encoding
Claus Gittinger <cg@exept.de>
parents: 4297
diff changeset
   987
            with:face
2b347bca3941 encoding
Claus Gittinger <cg@exept.de>
parents: 4297
diff changeset
   988
            with:style
2b347bca3941 encoding
Claus Gittinger <cg@exept.de>
parents: 4297
diff changeset
   989
            with:size
2b347bca3941 encoding
Claus Gittinger <cg@exept.de>
parents: 4297
diff changeset
   990
    ].
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
   991
    (pixelSize isNil and:[self sizeUnit == #pt]) ifTrue:[
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   992
        ^ Array
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   993
            with:myName
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   994
            with:family
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   995
            with:face
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   996
            with:style
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   997
            with:size
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   998
            with:encoding
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
   999
    ].
1740
804c5b51ec29 fromLiteralArrayEncoding:
ca
parents: 1618
diff changeset
  1000
    ^ Array
4298
2b347bca3941 encoding
Claus Gittinger <cg@exept.de>
parents: 4297
diff changeset
  1001
        with:myName
1740
804c5b51ec29 fromLiteralArrayEncoding:
ca
parents: 1618
diff changeset
  1002
        with:family
804c5b51ec29 fromLiteralArrayEncoding:
ca
parents: 1618
diff changeset
  1003
        with:face
804c5b51ec29 fromLiteralArrayEncoding:
ca
parents: 1618
diff changeset
  1004
        with:style
804c5b51ec29 fromLiteralArrayEncoding:
ca
parents: 1618
diff changeset
  1005
        with:size
4297
10b461a37e26 added encoding to literal vector
Claus Gittinger <cg@exept.de>
parents: 4146
diff changeset
  1006
        with:encoding
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
  1007
        with:sizeUnit
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
  1008
        with:pixelSize
1740
804c5b51ec29 fromLiteralArrayEncoding:
ca
parents: 1618
diff changeset
  1009
!
804c5b51ec29 fromLiteralArrayEncoding:
ca
parents: 1618
diff changeset
  1010
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1011
on:aDevice
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1012
    "given the receiver, return a device Font"
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1013
3623
16665d9b7263 #on: -> #onDevice
Claus Gittinger <cg@exept.de>
parents: 3265
diff changeset
  1014
    "/ send out a warning: #on: is typically used to create views
16665d9b7263 #on: -> #onDevice
Claus Gittinger <cg@exept.de>
parents: 3265
diff changeset
  1015
    "/ operating on a model.
16665d9b7263 #on: -> #onDevice
Claus Gittinger <cg@exept.de>
parents: 3265
diff changeset
  1016
    "/ Please use #onDevice: to avoid confusion.
16665d9b7263 #on: -> #onDevice
Claus Gittinger <cg@exept.de>
parents: 3265
diff changeset
  1017
16665d9b7263 #on: -> #onDevice
Claus Gittinger <cg@exept.de>
parents: 3265
diff changeset
  1018
    <resource:#obsolete>
16665d9b7263 #on: -> #onDevice
Claus Gittinger <cg@exept.de>
parents: 3265
diff changeset
  1019
16665d9b7263 #on: -> #onDevice
Claus Gittinger <cg@exept.de>
parents: 3265
diff changeset
  1020
    self obsoleteMethodWarning:'use #onDevice:'.
3629
9d06228191a6 Fix obsolete methods
Stefan Vogel <sv@exept.de>
parents: 3623
diff changeset
  1021
    ^ self onDevice:aDevice.
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1022
!
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1023
1497
697ac9b15962 added #onDevice: for protocol completeness.
Claus Gittinger <cg@exept.de>
parents: 1277
diff changeset
  1024
onDevice:aDevice
697ac9b15962 added #onDevice: for protocol completeness.
Claus Gittinger <cg@exept.de>
parents: 1277
diff changeset
  1025
    "given the receiver, return a device Font"
697ac9b15962 added #onDevice: for protocol completeness.
Claus Gittinger <cg@exept.de>
parents: 1277
diff changeset
  1026
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
  1027
    |newFont|
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
  1028
2980
409e9547a45c ignore nil device in #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
  1029
    aDevice isNil ifTrue:[^ self].
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
  1030
    newFont := Font
3629
9d06228191a6 Fix obsolete methods
Stefan Vogel <sv@exept.de>
parents: 3623
diff changeset
  1031
        family:family 
9d06228191a6 Fix obsolete methods
Stefan Vogel <sv@exept.de>
parents: 3623
diff changeset
  1032
        face:face 
9d06228191a6 Fix obsolete methods
Stefan Vogel <sv@exept.de>
parents: 3623
diff changeset
  1033
        style:style 
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
  1034
        size:(sizeUnit == #px ifTrue:[pixelSize] ifFalse:[size]) 
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
  1035
        sizeUnit:sizeUnit 
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
  1036
        encoding:encoding.
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
  1037
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
  1038
    newFont flags:flags.
1497
697ac9b15962 added #onDevice: for protocol completeness.
Claus Gittinger <cg@exept.de>
parents: 1277
diff changeset
  1039
5535
06501937fa4f #onDevice:aDevice -> creates a new font
sr
parents: 5511
diff changeset
  1040
    "SR:
06501937fa4f #onDevice:aDevice -> creates a new font
sr
parents: 5511
diff changeset
  1041
     old code is commented below,
06501937fa4f #onDevice:aDevice -> creates a new font
sr
parents: 5511
diff changeset
  1042
     someone has forgotten to set the incoming argument device,
06501937fa4f #onDevice:aDevice -> creates a new font
sr
parents: 5511
diff changeset
  1043
     why using the device from the old font??? is this a mistake???
06501937fa4f #onDevice:aDevice -> creates a new font
sr
parents: 5511
diff changeset
  1044
     at least the naming of this method wants a new font on given device...."
06501937fa4f #onDevice:aDevice -> creates a new font
sr
parents: 5511
diff changeset
  1045
    ^ newFont onDevice:aDevice.
06501937fa4f #onDevice:aDevice -> creates a new font
sr
parents: 5511
diff changeset
  1046
"/    ^ newFont onDevice:self graphicsDevice.
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
  1047
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
  1048
   "Created: 28.3.1997 / 16:09:30 / cg"
1497
697ac9b15962 added #onDevice: for protocol completeness.
Claus Gittinger <cg@exept.de>
parents: 1277
diff changeset
  1049
!
697ac9b15962 added #onDevice: for protocol completeness.
Claus Gittinger <cg@exept.de>
parents: 1277
diff changeset
  1050
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
  1051
size:anotherSize
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
  1052
    <resource: #obsolete>
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
  1053
 
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
  1054
    "return a font corresponding to the receiver, but with different size."
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
  1055
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
  1056
    self obsoleteMethodWarning:'use #asSize:'.
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
  1057
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
  1058
    ^ self class 
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
  1059
        family:family 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
  1060
        face:face 
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
  1061
        style:style 
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
  1062
        size:anotherSize 
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
  1063
        sizeUnit:#pt
5169
ad531e713603 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5166
diff changeset
  1064
        encoding:encoding
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
  1065
! !
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
  1066
2544
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1067
!FontDescription methodsFor:'displaying'!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1068
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1069
displayOpaqueString:aString from:index1 to:index2 x:x y:y in:aGC
3663
d40999d6cd1e refactored
Michael Beyl <mb@exept.de>
parents: 3661
diff changeset
  1070
    "display a partial string at some position in aGC.
d40999d6cd1e refactored
Michael Beyl <mb@exept.de>
parents: 3661
diff changeset
  1071
     - display part of a string, drawing both fore- and background pixels"
2544
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1072
3663
d40999d6cd1e refactored
Michael Beyl <mb@exept.de>
parents: 3661
diff changeset
  1073
    self displayString:aString from:index1 to:index2 x:x y:y in:aGC opaque:true
2544
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1074
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1075
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1076
displayOpaqueString:aString x:x y:y in:aGC
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1077
    "display a string at some position in aGC."
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1078
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1079
    self displayOpaqueString:aString from:1 to:aString size x:x y:y in:aGC
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1080
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1081
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1082
displayString:aString from:index1 to:index2 x:x y:y in:aGC
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1083
    "display a partial string at some position in aGC."
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1084
3663
d40999d6cd1e refactored
Michael Beyl <mb@exept.de>
parents: 3661
diff changeset
  1085
    self displayString:aString from:index1 to:index2 x:x y:y in:aGC opaque:false
d40999d6cd1e refactored
Michael Beyl <mb@exept.de>
parents: 3661
diff changeset
  1086
!
d40999d6cd1e refactored
Michael Beyl <mb@exept.de>
parents: 3661
diff changeset
  1087
d40999d6cd1e refactored
Michael Beyl <mb@exept.de>
parents: 3661
diff changeset
  1088
displayString:aString from:index1 to:index2 x:x y:y in:aGC opaque:opaque
d40999d6cd1e refactored
Michael Beyl <mb@exept.de>
parents: 3661
diff changeset
  1089
    "display a partial string at some position in aGC."
d40999d6cd1e refactored
Michael Beyl <mb@exept.de>
parents: 3661
diff changeset
  1090
2544
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1091
    self subclassResponsibility
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1092
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1093
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1094
displayString:aString x:x y:y in:aGC
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1095
    "display a string at some position in aGC."
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1096
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1097
    self displayString:aString from:1 to:aString size x:x y:y in:aGC
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1098
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1099
! !
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1100
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1101
!FontDescription methodsFor:'errors'!
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
  1102
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1103
errorNoDevice
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1104
    "a query was made for device-specific info"
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 89
diff changeset
  1105
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1106
    "
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1107
     this happens, when you ask a font for its height or width,
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1108
     ascent or any other dimension which depends on the device on
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1109
     which the font is rendered, AND the receiver font is not (yet)
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1110
     associated to a device.
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1111
     You should always use 
3159
3b040b0e4ae4 Fix error string 'for for'
Stefan Vogel <sv@exept.de>
parents: 3144
diff changeset
  1112
        font := font on:someDevice
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1113
     to get a device font, before asking for device specifics.
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1114
    "
3159
3b040b0e4ae4 Fix error string 'for for'
Stefan Vogel <sv@exept.de>
parents: 3144
diff changeset
  1115
    self error:'query device independent font for device specific info'
3b040b0e4ae4 Fix error string 'for for'
Stefan Vogel <sv@exept.de>
parents: 3144
diff changeset
  1116
3b040b0e4ae4 Fix error string 'for for'
Stefan Vogel <sv@exept.de>
parents: 3144
diff changeset
  1117
    "Modified: / 27.1.2000 / 16:55:05 / stefan"
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1118
! !
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1119
3785
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1120
!FontDescription methodsFor:'getting a device font'!
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1121
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1122
onDevice:aDevice ifAbsent:exceptionBlock 
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1123
    "create a new Font representing the same font as
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1124
     myself on aDevice. This does NOT try to look for existing
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1125
     or replacement fonts (i.e. can be used to get physical fonts)."
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1126
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1127
    |newFont id|
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1128
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1129
    "ask that device for the font"
5166
a9cd84083df5 preps for pixelSized fonts
Claus Gittinger <cg@exept.de>
parents: 5165
diff changeset
  1130
    id := aDevice 
a9cd84083df5 preps for pixelSized fonts
Claus Gittinger <cg@exept.de>
parents: 5165
diff changeset
  1131
            getFontWithFamily:family 
a9cd84083df5 preps for pixelSized fonts
Claus Gittinger <cg@exept.de>
parents: 5165
diff changeset
  1132
            face:face 
a9cd84083df5 preps for pixelSized fonts
Claus Gittinger <cg@exept.de>
parents: 5165
diff changeset
  1133
            style:style 
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
  1134
            size:(sizeUnit == #px ifTrue:[pixelSize] ifFalse:[size])  
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
  1135
            sizeUnit:sizeUnit  
5166
a9cd84083df5 preps for pixelSized fonts
Claus Gittinger <cg@exept.de>
parents: 5165
diff changeset
  1136
            encoding:encoding.
3785
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1137
    id isNil ifTrue:[
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1138
        "oops did not work - (device has no such font)"
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1139
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1140
        ^ exceptionBlock value
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1141
    ].
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1142
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1143
    newFont := (Font basicNew) 
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1144
                        setFamily:family 
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1145
                        face:face
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1146
                        style:style
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
  1147
                        size:(sizeUnit == #px ifTrue:[pixelSize] ifFalse:[size])  
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
  1148
                        sizeUnit:sizeUnit  
3785
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1149
                        encoding:encoding
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1150
                        device:aDevice.
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1151
    newFont setFontId:id.
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1152
    newFont getFontInfos.
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1153
    aDevice registerFont:newFont.
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1154
    ^ newFont
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1155
! !
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1156
1618
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1157
!FontDescription methodsFor:'printing & storing'!
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1158
3991
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1159
printOn:aStream
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1160
    "append a user-friendly representation of the receiver to aStream"
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1161
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1162
    aStream nextPutAll:self userFriendlyName
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1163
!
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1164
1618
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1165
userFriendlyName
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1166
    "return a user-friendly printed representation of the receiver"
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1167
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1168
    |nm|
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1169
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1170
    nm := family.
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1171
    face notNil ifTrue:[
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1172
        nm := nm , '-', face.
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1173
    ].
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1174
    style notNil ifTrue:[
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1175
        nm := nm , '-', style.
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1176
    ].
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1177
    size notNil ifTrue:[
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1178
        nm := nm , '-', size printString.
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1179
    ].
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1180
    encoding notNil ifTrue:[
3991
9810f304f469 printString
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1181
        nm := nm , '(', encoding , ')'.
1618
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1182
    ].
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1183
    ^ nm
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1184
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1185
    "
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1186
     View defaultFont userFriendlyName
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1187
     Button defaultFont userFriendlyName
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1188
    "
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1189
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1190
    "Modified: 20.4.1996 / 23:25:36 / cg"
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1191
    "Created: 19.4.1997 / 18:09:25 / cg"
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1192
! !
044de84f0d5f moved userFriendlyName up
Claus Gittinger <cg@exept.de>
parents: 1585
diff changeset
  1193
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1194
!FontDescription methodsFor:'queries'!
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1195
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1196
bold
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1197
    "return true, if the receiver is a bold font -
1585
7892ed31d333 fixed #italic and #bold
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  1198
     Added for st-80 compatibility."
7892ed31d333 fixed #italic and #bold
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  1199
7892ed31d333 fixed #italic and #bold
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  1200
    "/ Currently, this implementation is a dirty hack and will be changed soon.
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1201
1275
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1202
    ^ face = 'bold'
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1203
1585
7892ed31d333 fixed #italic and #bold
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  1204
    "Modified: 11.4.1997 / 21:31:25 / cg"
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1205
!
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1206
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1207
boldness
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1208
    "return the boldness of the characters in this font 0 .. 1 -
1275
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1209
     Added for st-80 compatibility"
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1210
1585
7892ed31d333 fixed #italic and #bold
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  1211
    "/ Currently, this implementation is a dirty hack and will be changed soon.
7892ed31d333 fixed #italic and #bold
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  1212
7892ed31d333 fixed #italic and #bold
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  1213
    face = 'roman' ifTrue:[^ 0.5].
7892ed31d333 fixed #italic and #bold
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  1214
    face = 'normal' ifTrue:[^ 0.5].
7892ed31d333 fixed #italic and #bold
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  1215
    face = 'bold' ifTrue:[^ 0.75].
7892ed31d333 fixed #italic and #bold
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  1216
    face = 'light' ifTrue:[^ 0.25].
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1217
    ^ 0.5
1275
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1218
1585
7892ed31d333 fixed #italic and #bold
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  1219
    "Modified: 11.4.1997 / 21:31:31 / cg"
1275
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1220
!
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1221
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1222
color
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1223
    "return the default color in which this font is to be rendered.
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1224
     Added for st-80 compatibility.
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1225
     For now always black."
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1226
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1227
    ^ Color black
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1228
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1229
    "Created: 25.1.1997 / 02:59:15 / cg"
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1230
    "Modified: 25.1.1997 / 03:02:14 / cg"
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1231
!
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1232
2544
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1233
existsOn:aDevice
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1234
    "return true, if the recevier is available on aDevice;
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1235
     false otherwise. This is a kludge method; its better to
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1236
     ask a device for its available fonts and use this info ...
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1237
     Notice, that if you simply use a font by name, the system
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1238
     will automatically take a replacement font."
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1239
3629
9d06228191a6 Fix obsolete methods
Stefan Vogel <sv@exept.de>
parents: 3623
diff changeset
  1240
    ^ ((Font
9d06228191a6 Fix obsolete methods
Stefan Vogel <sv@exept.de>
parents: 3623
diff changeset
  1241
        family:family 
9d06228191a6 Fix obsolete methods
Stefan Vogel <sv@exept.de>
parents: 3623
diff changeset
  1242
        face:face 
9d06228191a6 Fix obsolete methods
Stefan Vogel <sv@exept.de>
parents: 3623
diff changeset
  1243
        style:style 
5185
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
  1244
        size:(sizeUnit == #px ifTrue:[pixelSize] ifFalse:[size]) 
c807ae478014 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5169
diff changeset
  1245
        sizeUnit:sizeUnit
3629
9d06228191a6 Fix obsolete methods
Stefan Vogel <sv@exept.de>
parents: 3623
diff changeset
  1246
        encoding:encoding) onDevice:aDevice ifAbsent:nil) notNil
2544
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1247
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1248
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1249
fullName
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1250
    ^ nil
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1251
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1252
    "Created: 23.2.1996 / 00:45:45 / cg"
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1253
!
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1254
5644
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
  1255
hasOverlappingCharacters
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
  1256
    "answer true, if this is a windows font where characters overlap"
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
  1257
    
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
  1258
    ^ flags notNil and:[ flags bitTest:OverlappingCharactersFlag ].
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
  1259
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
  1260
    "Created: / 08-11-2010 / 13:16:51 / cg"
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
  1261
!
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
  1262
5511
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
  1263
isGenericFont
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
  1264
    "answer true, if this is a pseudo font"
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
  1265
    
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
  1266
    ^ flags notNil and:[ flags bitTest:GenericFlag ].
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
  1267
!
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
  1268
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
  1269
isScaledFont
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
  1270
    ^ size = 0
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
  1271
!
bc18d5eb3527 Support a list of replacement fonts and try each in order
Stefan Vogel <sv@exept.de>
parents: 5441
diff changeset
  1272
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1273
italic
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1274
    "return true if this is an italic font -
1585
7892ed31d333 fixed #italic and #bold
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  1275
     Added for st-80 compatibility"
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1276
1585
7892ed31d333 fixed #italic and #bold
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  1277
    "/ Currently, this implementation is a dirty hack and will be changed soon.
7892ed31d333 fixed #italic and #bold
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  1278
7892ed31d333 fixed #italic and #bold
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  1279
    style = 'italic' ifTrue:[^ true].
3246
213e4771d6fb typo fixed
Claus Gittinger <cg@exept.de>
parents: 3159
diff changeset
  1280
    style = 'oblique' ifTrue:[^ true].
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1281
    ^ false
1275
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1282
1585
7892ed31d333 fixed #italic and #bold
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  1283
    "Modified: 11.4.1997 / 21:31:42 / cg"
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1284
!
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1285
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1286
serif
1275
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1287
    "return true, if this font has serifs.
1585
7892ed31d333 fixed #italic and #bold
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  1288
     Added for st-80 compatibility"
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1289
1585
7892ed31d333 fixed #italic and #bold
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  1290
    "/ Currently, this implementation is a dirty hack and will be changed soon.
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1291
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1292
    family = 'Times' ifTrue:[^ true].
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1293
    family = 'times' ifTrue:[^ true].
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1294
    ^ false.
1275
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1295
1585
7892ed31d333 fixed #italic and #bold
Claus Gittinger <cg@exept.de>
parents: 1497
diff changeset
  1296
    "Modified: 11.4.1997 / 21:31:51 / cg"
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1297
!
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1298
3265
408fac627dc4 category change
Claus Gittinger <cg@exept.de>
parents: 3254
diff changeset
  1299
size
408fac627dc4 category change
Claus Gittinger <cg@exept.de>
parents: 3254
diff changeset
  1300
    "return the size, a number"
408fac627dc4 category change
Claus Gittinger <cg@exept.de>
parents: 3254
diff changeset
  1301
408fac627dc4 category change
Claus Gittinger <cg@exept.de>
parents: 3254
diff changeset
  1302
    ^ size
408fac627dc4 category change
Claus Gittinger <cg@exept.de>
parents: 3254
diff changeset
  1303
!
408fac627dc4 category change
Claus Gittinger <cg@exept.de>
parents: 3254
diff changeset
  1304
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1305
species
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1306
    ^ Font
1275
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1307
!
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1308
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1309
underline
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1310
    "return true if this is an underlined font -
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1311
     Added for st-80 compatibility
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1312
     (always false here)"
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1313
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1314
    ^ false
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1315
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1316
    "Created: 25.1.1997 / 02:58:30 / cg"
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1317
    "Modified: 25.1.1997 / 03:01:12 / cg"
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1318
! !
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1319
2544
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1320
!FontDescription methodsFor:'queries-dimensions'!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1321
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1322
ascent
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1323
    "return the ascent - the number of pixels above the baseLine."
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1324
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1325
    ^ self subclassResponsibility
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1326
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1327
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1328
ascentOn:aDevice
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1329
    "return the ascent - the number of pixels above the baseLine."
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1330
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1331
    ^ (self onDevice:aDevice) ascent
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1332
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1333
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1334
descent
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1335
    "return the descent - the number of pixels below the baseLine."
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1336
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1337
    ^ self subclassResponsibility
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1338
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1339
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1340
descentOn:aDevice
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1341
    "return the ascent - the number of pixels above the baseLine."
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1342
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1343
    ^ (self onDevice:aDevice) descent
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1344
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1345
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1346
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1347
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1348
height
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1349
    "return the height - the number of pixels above plus below the baseLine."
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1350
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1351
    ^ self subclassResponsibility
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1352
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1353
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1354
heightOf:aString
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1355
    "return the height of the given string.
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1356
     Here, assume the characters are of constant height"
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1357
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1358
    ^ self height
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1359
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1360
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1361
heightOf:aString on:aDevice
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1362
    "return the height of the given string on the given device."
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1363
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1364
    ^ (self onDevice:aDevice) heightOf:aString
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1365
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1366
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1367
heightOn:aDevice
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1368
    "return the height - the number of pixels above PLUS below the baseLine."
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1369
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1370
    ^ (self onDevice:aDevice) height
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1371
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1372
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1373
isFixedWidth
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1374
    "return true, if this is a fixed pitch font (i.e. all characters
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1375
     are of the same width)"
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1376
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1377
    self subclassResponsibility
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1378
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1379
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1380
maxAscent
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1381
    "return the fonts maximum-ascent (i.e. the maximum of all characters);
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1382
     That is the number of units (usually pixels) above the baseline."
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1383
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1384
    ^ self subclassResponsibility
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1385
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1386
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1387
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1388
maxDescent
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1389
    "return the fonts maximum-descent (i.e. the maximum of all characters);
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1390
     That is the number of units (usually pixels) below the baseline."
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1391
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1392
    ^ self subclassResponsibility
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1393
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1394
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1395
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1396
maxHeight
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1397
    "return the fonts characters maximum height;
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1398
     That is the number of units (usually pixels)."
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1399
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1400
    ^ self maxAscent + self maxDescent
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1401
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1402
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1403
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1404
maxWidth
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1405
    "return the fonts maximum-width character (i.e. the maximum of all characters);
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1406
     That is a number of units (usually pixels)."
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1407
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1408
    ^ self subclassResponsibility
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1409
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1410
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1411
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1412
width
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1413
    "return the fonts characters width;
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1414
     That is a number of units (usually pixels).
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1415
     For variable pitch fonts, the width of the space character is returned.
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1416
     For fixed fonts, this is the same as minWidth or maxWidth (or any character).
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1417
     The receiver must be associated to a device, for this query to be legal."
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1418
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1419
    ^ self widthOf:' '
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1420
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1421
    "Modified: 30.4.1996 / 16:43:45 / cg"
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1422
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1423
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1424
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1425
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1426
widthOf:aString
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1427
    "return the width of a string"
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1428
3667
53ebf11c6dd9 widthOf fixed for Text-item
Michael Beyl <mb@exept.de>
parents: 3663
diff changeset
  1429
    ^ self widthOf:aString string from:1 to:aString size
2544
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1430
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1431
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1432
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1433
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1434
widthOf:aString from:start to:stop
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1435
    "return the width of a sub string"
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1436
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1437
    ^ self subclassResponsibility
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1438
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1439
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1440
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1441
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1442
widthOf:aString from:start to:stop on:aDevice
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1443
    "return the width of a sub string.
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1444
     Here, assume that this fonts width is device independent."
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1445
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1446
    ^ (self onDevice:aDevice) widthOf:aString from:start to:stop
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1447
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1448
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1449
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1450
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1451
widthOf:aString on:aDevice
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1452
    "return the width of a string"
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1453
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1454
    ^ (self onDevice:aDevice) widthOf:aString
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1455
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1456
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1457
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1458
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1459
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1460
!
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1461
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1462
widthOn:aDevice
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1463
    "return the width on some device; that is the width of the space character
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1464
     (which is the width of any character iff the font is a fixed pitch font)"
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1465
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1466
    ^ (self onDevice:aDevice) width
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1467
! !
8fdf3d873964 code refactoring
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
  1468
456
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
  1469
!FontDescription methodsFor:'queries-encoding'!
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
  1470
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
  1471
isASCII
576
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
  1472
    "return true, if the receivers encoding is
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
  1473
     compatible with ascii (i.e. its ascii or iso8859)"
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
  1474
456
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
  1475
    ^ (encoding == #iso8859) or:[encoding == #ascii]
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
  1476
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
  1477
    "Created: 24.2.1996 / 22:47:30 / cg"
576
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
  1478
    "Modified: 20.4.1996 / 23:20:01 / cg"
456
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
  1479
!
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
  1480
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
  1481
isISO8859
576
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
  1482
    "return true, if the receivers encoding is
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
  1483
     compatible with iso8859 (i.e. iso8859)"
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
  1484
456
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
  1485
    ^ encoding == #iso8859
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
  1486
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
  1487
    "Created: 24.2.1996 / 22:47:12 / cg"
576
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
  1488
    "Modified: 20.4.1996 / 23:20:13 / cg"
456
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
  1489
!
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
  1490
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
  1491
isJIS
576
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
  1492
    "return true, if the receivers encoding is
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
  1493
     compatible with jis (i.e. jisXXX)"
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
  1494
456
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
  1495
    ^ (encoding startsWith:'jis')
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
  1496
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
  1497
    "Created: 24.2.1996 / 22:47:47 / cg"
576
6a7392220976 commentary
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
  1498
    "Modified: 20.4.1996 / 23:20:30 / cg"
456
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
  1499
! !
3ab60f26b5a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 437
diff changeset
  1500
1275
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1501
!FontDescription class methodsFor:'documentation'!
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1502
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1503
version
5644
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
  1504
    ^ '$Header: /cvs/stx/stx/libview/FontDescription.st,v 1.76 2010-11-08 13:46:15 cg Exp $'
5441
04ebe289a7e0 changed: #sameDeviceFontAs:
Claus Gittinger <cg@exept.de>
parents: 5223
diff changeset
  1505
!
04ebe289a7e0 changed: #sameDeviceFontAs:
Claus Gittinger <cg@exept.de>
parents: 5223
diff changeset
  1506
04ebe289a7e0 changed: #sameDeviceFontAs:
Claus Gittinger <cg@exept.de>
parents: 5223
diff changeset
  1507
version_CVS
5644
664ce01f38f5 +hasOverlappingCharacters
Claus Gittinger <cg@exept.de>
parents: 5560
diff changeset
  1508
    ^ '$Header: /cvs/stx/stx/libview/FontDescription.st,v 1.76 2010-11-08 13:46:15 cg Exp $'
437
a81ce3a8038b return dummy default encoding & fullNames
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
  1509
! !
3785
045a05c6abbe onDevice:ifAbsent:
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  1510
1275
9c3461bb0232 more ST-80 mimicri
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
  1511
FontDescription initialize!