TTCFont
Last updated at 9:49 am UTC on 4 March 2022
Subclass of AbstractFont
Class comment:
I represent a font that uses TrueType derived glyph. Upon a request for glyph for a character through a call to #formOf: (or #widthOf:), I first search corresponding glyph in the cache. If there is not, it creates a 32bit depth form with the glyph.
The cache is weakly held. The entries are zapped at full GC.
Structure:
- ttcDescription TTFontDescription – The Squeak data structure for a TrueType font data file.
- pointSize Number – Nominal Em size in points. Conversion to pixel sizes depends on the definition of TextStyle class>>pixelsPerInch.
- foregroundColor Color – So far, this font need to know the glyph color in cache.
- cache WeakArray of <Color -> <Array(256) of glyph>>
- derivatives Array – stores the fonts in the same family but different emphasis.
Important method:
displayString: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta baselineY: baselineY
displayString:on:from:to:at:kern:baselineY:
This method is called from
DisplayText composeForm
through
Project composeDisplayTextIntoForm: displayText
It uses TTGlyph to create an instance of Form.
March 2022: new import method, see comment.
TTCFont class >> #installFromFileNames:
TTCFont class >> #uninstallFontNames:
See also
FontImporterTool
Liberation Sans TrueType font (installation by drag and drop)
Installing and debugging TrueType fonts (an example how to tweak a TrueType font)