TrueType

TTCompositeGlyph
This class represents a composite TrueType glyph, e.g.one which contains many simple TTGlyphs.
addGlyph:transformation:
computeContours
contours
flipAroundY
glyphs
glyphsAndTransformationsDo:
initialize
Subclasses should redefine this method to perform initializations on instance creation
isComposite
TTContourConstruction
This class represents a temporary contour structure during the construction of a TTGlyph from a TrueType file.
Instance variables:
points <Array of: TTPoint> The points defining this contour
asCompressedPoints
Return the receiver compressed into a PointArray.
All lines will be converted into bezier segments with
the control point set to the start point
on:
points
points:
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
segments
segmentsDo:
Evaluate aBlock with the segments of the receiver. This may either be straight line
segments or quadratic bezier curves. The decision is made upon the type flags
in TTPoint as follows:
a) Two subsequent #OnCurve points define a straight segment
b) An #OnCurve point followed by an #OffCurve point followed
by an #OnCurve point defines a quadratic bezier segment
c) Two subsequent #OffCurve points have an implicitely defined
#OnCurve point at half the distance between them
TTFontDescription
Holds a TrueType font in memory. Is used by TTSampleStringMorph as its font.
Class owns a default example.
addFromTTFile:
addFromTTStream:
asMorph
Open a morph, as best one can, on the receiver
asStrikeFontScale:
Generate a StrikeFont (actually a FormSetFont) for this TTF font at a given scale.
ascender
at:
Primitive. Assumes receiver is indexable. Answer the value of an
indexable element in the receiver. Fail if the argument index is not an
Integer or is out of bounds. Essential. See Object documentation
whatIsAPrimitive.
at:put:
Primitive. Assumes receiver is indexable. Store the argument value in
the indexable element of the receiver indicated by index. Fail if the
index is not an Integer or is out of bounds. Or fail if the value is not of
the right type for this kind of collection. Answer the value that was
stored. Essential. See Object documentation whatIsAPrimitive.
blankGlyphForSeparators
bounds
clearDefault
clearDescriptions
copyright
deepCopy
Since it shouldn't be copied for transmitting or any reason, it returns self.
default
descender
descriptionFullNamed:
descriptionNamed:
familyName
flipAroundY
fullName
initialize
Subclasses should redefine this method to perform initializations on instance creation
lineGap
name
Answer a name for the receiver. This is used generically in the title of certain inspectors, such as the referred-to inspector, and specificially by various subsystems. By default, we let the object just print itself out..
objectForDataStream:
I am about to be written on an object file. Write a reference to a known Font in the other system instead.
postscriptName
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
removeDescriptionNamed:
removeDescriptionNamed:subfamilyName:
setAscender:descender:lineGap:
setBounds:unitsPerEm:
setDefault
setGlyphs:mapping:
setKernPairs:
setStrings:
size
Primitive. Answer the number of indexable variables in the receiver.
This value is the same as the largest legal subscript. Essential. See Object
documentation whatIsAPrimitive.
subfamilyName
trademark
uniqueName
unitsPerEm
versionName
veryDeepCopyWith:
Return self. I am shared. Do not record me.
TTFontReader
TTFontReader constructs a TTFontDescription from a TrueType font (.ttf).
decodeCmapFmtTable:
fileReaderServicesForFile:suffix:
getGlyphFlagsFrom:size:
Read in the flags for this glyph. The outer loop gathers the flags that
are actually contained in the table. If the repeat bit is set in a flag
then the next byte is read from the table; this is the number of times
to repeat the last flag. The inner loop does this, incrementing the
outer loops index each time.
getTableDirEntry:from:
Find the table named tagString in fontData and return a table directory entry for it.
initialize
Subclasses should redefine this method to perform initializations on instance creation
installTTF:asTextStyle:sizes:
macToWin:
openTTFFile:
parseFileNamed:
processCharMap:
Process the given character map
processCharacterMappingTable:
Read the font's character to glyph index mapping table.
If an appropriate mapping can be found then return an association
with the format identifier and the contents of the table
processCompositeGlyph:contours:from:
Read a composite glyph from the font data. The glyph passed into this method contains some state variables that must be copied into the resulting composite glyph.
processFontHeaderTable:
Value Data Type Description
unitsPerEm USHORT Granularity of the font's em square.
xMax USHORT Maximum X-coordinate for the entire font.
xMin USHORT Minimum X-coordinate for the entire font.
yMax USHORT Maximum Y-coordinate for the entire font.
yMin USHORT Minimum Y-coordinate for the entire font.
indexToLocFormat SHORT Used when processing the Index To Loc Table.
processGlyphDataTable:offsets:
Read the actual glyph data from the font.
offsetArray contains the start offsets in the data for each glyph.
processHorizontalHeaderTable:
ascender SHORT Typographic ascent.
descender SHORT Typographic descent.
lineGap SHORT Typographic lineGap.
numberOfHMetrics USHORT Number hMetric entries in the HTMX
Table; may be smaller than the total
number of glyphs.
processHorizontalMetricsTable:length:
Extract the advance width, left side bearing, and right
side bearing for each glyph from the Horizontal Metrics Table.
processIndexToLocationTable:format:
glyphOffset ULONG[numGlyphs] An array that contains each glyph's
offset into the Glyph Data Table.
processKerningTable:
Extract the kerning information for pairs of glyphs.
processMaximumProfileTable:
numGlyphs USHORT The number of glyphs in the font.
processNamingTable:
copyright CHARPTR The font's copyright notice.
familyName CHARPTR The font's family name.
subfamilyName CHARPTR The font's subfamily name.
uniqueName CHARPTR A unique identifier for this font.
fullName CHARPTR The font's full name (a combination of
familyName and subfamilyName).
versionName CHARPTR The font's version string.
processSimpleGlyph:contours:from:
readFrom:
Read the raw font byte data
readGlyphXCoords:glyph:nContours:flags:endPoints:
Read the x coordinates for the given glyph from the font file.
readGlyphYCoords:glyph:nContours:flags:endPoints:
Read the y coordinates for the given glyph from the font file.
readTTFFrom:
serviceOpenTrueTypeFont
services
unload
warn:
winToMac:
TTFontTableDirEntry
This class represents an entry in a truetype font table directory. Used by TTFontReader only.
nextByte
nextBytes:into:startingAt:
nextLong
nextShort
nextULong
nextUShort
offset
offset:
on:at:
skip:
Skip n bytes
stringAt:length:multiByte:
TTGlyph
This class represents a glyph of a TrueType font.
Instance variables:
bounds <Rectangle> The receiver's bounds
contours <Array of: PointArray> The compressed contours in the receiver
advanceWidth <Integer> advance width of the glyph
leftSideBearing <Integer> left side bearing
rightSideBearing <Integer> right side bearing
glyphIndex <Integer> the original index of the glyph (used for kerning)
advanceWidth
advanceWidth:
asFormWithScale:ascender:descender:
asFormWithScale:ascender:descender:fgColor:bgColor:depth:
asFormWithScale:ascender:descender:fgColor:bgColor:depth:replaceColor:
asFormWithScale:ascender:descender:fgColor:bgColor:depth:replaceColor:lineGlyph:lingGlyphWidth:emphasis:
bounds
bounds:
buildContours
Build the contours in the receiver glyph.
The contour is constructed by converting the points
form each contour into an absolute value and then
compressing the contours into PointArrays.
calculateWidth
contours
contours:
display
flipAroundY
glyphIndex
glyphIndex:
glyphsAndTransformationsDo:
initialize
Subclasses should redefine this method to perform initializations on instance creation
initializeContours:with:
Initialize the contours for creation of the glyph.
isComposite
leftSideBearing
leftSideBearing:
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
rightSideBearing
rightSideBearing:
updateRightSideBearing
Update the right side bearing value
TTKernPair
A TTKernPair represents a TrueType kerning pair.
Instance variables:
left <Integer> The glyph index for the left character.
right <Integer> The glyph index for the right character.
value <Integer> The amount of kerning.
mask <Integer> An efficient representation for the left and the right value.
left
left:
mask
maskFor:with:
right
right:
value
value:
TTPoint
A representation of a TrueType point which includes a 'type' flag defining whether this point is an 'on' or an 'off' curve point.
asPoint
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
type
type:
x
x:
y
y: