|
|
Class: FontDescription
Object
|
+--FontDescription
|
+--BitmapFont
|
+--CompoundFont
|
+--Font
- Package:
- stx:libview
- Category:
- Graphics-Support
- Version:
- rev:
1.75
date: 2010/02/24 15:06:15
- user: ca
- file: FontDescription.st directory: libview
- module: stx stc-classLibrary: libview
- Author:
- Claus Gittinger
FontDescription is just a place-holder for scanned font names.
[Instance variables:]
family <String> the fonts family ('courier', 'helvetica' etc)
face <String> the fonts face ('bold', 'medium' etc)
style <String> the fonts style ('roman', 'italic', 'oblique')
size <String> the fonts size (not in pixels)
encoding <Symbol> the fonts encoding (usually #iso8859-1)
manufacturer <nil|String|Array>
the fonts origin - if known
name <nil|String|Array>
the platform specific name
flags <SmallInteger> holds serif/italic etc. as flag bits
masks <SmallInteger> currently dummy; to allow ST-80 compatible subclassing
pixelSize <SmallInteger> currently dummy; to allow ST-80 compatible subclassing
[class variables:]
BoldnessMask currently dummy; to allow ST-80 compatible subclassing
FixedFlag currently dummy; to allow ST-80 compatible subclassing
ItalicFlag currently dummy; to allow ST-80 compatible subclassing
OutlineFlag currently dummy; to allow ST-80 compatible subclassing
SerifFlag currently dummy; to allow ST-80 compatible subclassing
ShadowFlag currently dummy; to allow ST-80 compatible subclassing
StrikeoutFlag currently dummy; to allow ST-80 compatible subclassing
UnderlineFlag currently dummy; to allow ST-80 compatible subclassing
Font
FontPanel
GraphicsContext
[introduction to view programming]
accessing
-
genericFonts
-
defaults
-
defaultEncoding
-
-
defaultFace
-
-
defaultSize
-
-
defaultStyle
-
initialization
-
initialize
-
initialize class variables
-
initializeCharacterEncodingToCharacterSetMapping
-
character encoding
-
initializeCharacterSetToFontMapping
-
character sets
-
initializeGenericFonts
-
generic fonts, that do not exist as a device fonts and are
replaced by a real font
instance creation
-
family: familyString
-
returns a font for given family and default (12pt) size
with default encoding.
The new fonts face defaults `medium', its style to `roman'.
The returned font is not associated to a specific device
-
family: familyString face: faceString size: sizeNum
-
returns a font for given family and size with default encoding.
The new fonts style defaults to `roman'.
The returned font is not associated to a specific device
-
family: familyString face: faceString style: styleString size: sizeNum
-
returns a font for given family, face, style and size with default encoding.
The returned font is not associated to a specific device
-
family: familyString face: faceString style: styleString size: sizeNum encoding: encoding
-
returns a font for given family, face, style, size and the specified encoding.
The returned font is not associated to a specific device
-
family: familyString face: faceString style: styleString size: size sizeUnit: sizeUnit encoding: encoding
-
returns a font for given family, face, style, size and the specified encoding.
The returned font is not associated to a specific device
-
family: familyString pixelSize: sizeNum
-
returns a font for given family and pixelSize with default encoding.
The new fonts face defaults to `medium', its style to `roman'.
Notice: the returned font will typically only be usable on a screen,
and will not scale as to the devices resolution.
Use #family:size: for resolution-independent sizing.
-
family: familyString size: sizeNum
-
returns a font for given family and size with default encoding.
The new fonts face defaults to `medium', its style to `roman'.
The returned font is not associated to a specific device
-
family: familyString size: sizeNum encoding: encoding
-
returns a font for given family and size with default encoding.
The new fonts face defaults to `medium', its style to `roman'.
The returned font is not associated to a specific device
-
family: familyString style: aStyle size: sizeNum
-
returns a font for given family and size with default encoding.
The new fonts face defaults to `medium', its style to `roman'.
The returned font is not associated to a specific device
-
name: aFontName
-
returns a font with the given explicit name.
WARNING:
You shuld not use explicit naming, since font names vary
with operatingSystems, devices and architecture.
This interface is provided for special purposes only.
On X, the name given should be according the X fontname conventions;
i.e. something like: '-*-times-bold-r-normal-*-*-240-*-*-*-*-iso8859-1'.
On other devices, font naming may be completely different.
queries
-
characterSetForCharacterEncoding: encodingName
-
return the font-encoding for a character encoding
-
fontNamePatternForCharset: aCharSetName
-
return the font-encoding for an iso-charset
-
preferredFontEncodingFor: fileEncoding
-
given a file encoding, return a corresponding match pattern for a preferred fontEncoding
Compatibility-ST80
-
boldness: aNumber
-
added for ST-80 compatibility; actually ignored currently
-
color: aColor
-
added for ST-80 compatibility; actually ignored currently
-
encodings: aCollectionOfEncodings
-
added for ST-80 compatibility; actually ignored currently
-
fixedWidth: aBoolean
-
added for ST-80 compatibility; actually ignored currently
-
italic: aBoolean
-
added for ST-80 compatibility; actually ignored currently
-
outline: aBoolean
-
added for ST-80 compatibility; actually ignored currently
-
pixelSize
-
-
pixelSize: aNumber
-
if specified, the size is ignored, and a pixel-sized font is chosen.
-
serif: aBoolean
-
added for ST-80 compatibility; actually ignored currently
-
setPixelSize: aNumber
-
-
shadow: aBoolean
-
added for ST-80 compatibility; actually ignored currently
-
strikeout: aBoolean
-
added for ST-80 compatibility; actually ignored currently
-
underline: aBoolean
-
added for ST-80 compatibility; actually ignored currently
accessing
-
device
-
return the device I am on
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
encoding
-
return the fonts encoding, as a symbol
such as #'iso8859', #'jis0208.1983' or #ascii.
If the fonts encoding is not known, return nil;
You should assume ascii-encoding then.
-
face
-
return the face, a string
-
face: aString
-
set the face, a string such as 'bold'
-
family
-
return the family, a string
-
family: aString
-
set the family, a string
-
family: familyString face: faceString style: styleString size: sizeNum encoding: encodingString
-
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
family: familyString face: faceString style: styleString size: sizeArg sizeUnit: sizeUnitArg encoding: encodingString
-
set the instance values
-
flags
-
-
flags: something
-
-
fontId
-
return the device-dependent font-id
-
graphicsDevice
-
return the device I am on
-
isGenericFont: aBoolean
-
set wether this is a pseudo font
-
manufacturer
-
return the value of the instance variable 'manufacturer' (automatically generated)
-
manufacturer: something
-
set the value of the instance variable 'manufacturer' (automatically generated)
-
masks
-
-
masks: something
-
-
sizeUnit
-
currently returns one of #pt or #px (internal use only)
-
style
-
return the style, a string
comparing
-
= aFont
-
two fonts are considered equal, if the font-name components are;
independent of the device, the font is on
-
hash
-
return a number for hashing - req'd since = is redefined.
-
sameDeviceFontAs: aFont
-
converting
-
asBold
-
return the bold font corresponding to the receiver
-
asFace: anotherFace
-
return the bold font corresponding to the receiver
-
asFamily: anotherFamily
-
return another font corresponding to the receiver face, style and size but
with another family
-
asFontDescription
-
-
asFontWithPixelSize: anotherSize
-
return another font corresponding to the receivers family, face and style but
with another pixel size
-
asItalic
-
return the italic font corresponding to the receiver
-
asSize: anotherSize
-
return another font corresponding to the receivers family, face and style but
with another size
-
asStyle: anotherStyle
-
-
fromLiteralArrayEncoding: literalEncoding
-
read my contents from a aLiteralEncodedArray.
Must match to what is generated in #literalArrayEncoding
-
literalArrayEncoding
-
return myself encoded as a literal array.
Must match to what is expected in #fromLiteralArrayEncoding:
-
on: aDevice
-
given the receiver, return a device Font
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
onDevice: aDevice
-
given the receiver, return a device Font
-
size: anotherSize
-
** This is an obsolete interface - do not use it (it may vanish in future versions) **
displaying
-
displayOpaqueString: aString from: index1 to: index2 x: x y: y in: aGC
-
display a partial string at some position in aGC.
- display part of a string, drawing both fore- and background pixels
-
displayOpaqueString: aString x: x y: y in: aGC
-
display a string at some position in aGC.
-
displayString: aString from: index1 to: index2 x: x y: y in: aGC
-
display a partial string at some position in aGC.
-
displayString: aString from: index1 to: index2 x: x y: y in: aGC opaque: opaque
-
display a partial string at some position in aGC.
** This method raises an error - it must be redefined in concrete classes **
-
displayString: aString x: x y: y in: aGC
-
display a string at some position in aGC.
errors
-
errorNoDevice
-
a query was made for device-specific info
getting a device font
-
onDevice: aDevice ifAbsent: exceptionBlock
-
create a new Font representing the same font as
myself on aDevice. This does NOT try to look for existing
or replacement fonts (i.e. can be used to get physical fonts).
printing & storing
-
printOn: aStream
-
append a user-friendly representation of the receiver to aStream
-
userFriendlyName
-
return a user-friendly printed representation of the receiver
queries
-
bold
-
return true, if the receiver is a bold font -
Added for st-80 compatibility.
-
boldness
-
return the boldness of the characters in this font 0 .. 1 -
Added for st-80 compatibility
-
color
-
return the default color in which this font is to be rendered.
Added for st-80 compatibility.
For now always black.
-
existsOn: aDevice
-
return true, if the recevier is available on aDevice;
false otherwise. This is a kludge method; its better to
ask a device for its available fonts and use this info ...
Notice, that if you simply use a font by name, the system
will automatically take a replacement font.
-
fullName
-
-
isGenericFont
-
answer true, if this is a pseudo font
-
isScaledFont
-
-
italic
-
return true if this is an italic font -
Added for st-80 compatibility
-
serif
-
return true, if this font has serifs.
Added for st-80 compatibility
-
size
-
return the size, a number
-
species
-
-
underline
-
return true if this is an underlined font -
Added for st-80 compatibility
(always false here)
queries-dimensions
-
ascent
-
return the ascent - the number of pixels above the baseLine.
** This method raises an error - it must be redefined in concrete classes **
-
ascentOn: aDevice
-
return the ascent - the number of pixels above the baseLine.
-
descent
-
return the descent - the number of pixels below the baseLine.
** This method raises an error - it must be redefined in concrete classes **
-
descentOn: aDevice
-
return the ascent - the number of pixels above the baseLine.
-
height
-
return the height - the number of pixels above plus below the baseLine.
** This method raises an error - it must be redefined in concrete classes **
-
heightOf: aString
-
return the height of the given string.
Here, assume the characters are of constant height
-
heightOf: aString on: aDevice
-
return the height of the given string on the given device.
-
heightOn: aDevice
-
return the height - the number of pixels above PLUS below the baseLine.
-
isFixedWidth
-
return true, if this is a fixed pitch font (i.e. all characters
are of the same width)
** This method raises an error - it must be redefined in concrete classes **
-
maxAscent
-
return the fonts maximum-ascent (i.e. the maximum of all characters);
That is the number of units (usually pixels) above the baseline.
** This method raises an error - it must be redefined in concrete classes **
-
maxDescent
-
return the fonts maximum-descent (i.e. the maximum of all characters);
That is the number of units (usually pixels) below the baseline.
** This method raises an error - it must be redefined in concrete classes **
-
maxHeight
-
return the fonts characters maximum height;
That is the number of units (usually pixels).
-
maxWidth
-
return the fonts maximum-width character (i.e. the maximum of all characters);
That is a number of units (usually pixels).
** This method raises an error - it must be redefined in concrete classes **
-
width
-
return the fonts characters width;
That is a number of units (usually pixels).
For variable pitch fonts, the width of the space character is returned.
For fixed fonts, this is the same as minWidth or maxWidth (or any character).
The receiver must be associated to a device, for this query to be legal.
-
widthOf: aString
-
return the width of a string
-
widthOf: aString from: start to: stop
-
return the width of a sub string
** This method raises an error - it must be redefined in concrete classes **
-
widthOf: aString from: start to: stop on: aDevice
-
return the width of a sub string.
Here, assume that this fonts width is device independent.
-
widthOf: aString on: aDevice
-
return the width of a string
-
widthOn: aDevice
-
return the width on some device; that is the width of the space character
(which is the width of any character iff the font is a fixed pitch font)
queries-encoding
-
isASCII
-
return true, if the receivers encoding is
compatible with ascii (i.e. its ascii or iso8859)
-
isISO8859
-
return true, if the receivers encoding is
compatible with iso8859 (i.e. iso8859)
-
isJIS
-
return true, if the receivers encoding is
compatible with jis (i.e. jisXXX)
|