[squeak-dev] The Trunk: TrueType-mt.63.mcz
commits at source.squeak.org
commits at source.squeak.org
Sat Feb 5 18:51:31 UTC 2022
Marcel Taeumel uploaded a new version of TrueType to project The Trunk:
http://source.squeak.org/trunk/TrueType-mt.63.mcz
==================== Summary ====================
Name: TrueType-mt.63
Author: mt
Time: 5 February 2022, 7:51:30.426366 pm
UUID: 30e76ca2-1832-f442-9463-e9168ba20851
Ancestors: TrueType-mt.62
Let TrueType fonts report accurately on #minCodePoint and #maxCodePoint. We might want to make both a quick-return. Hmm...
=============== Diff against TrueType-mt.62 ===============
Item was changed:
AbstractFont subclass: #TTCFont
+ instanceVariableNames: 'ttcDescription pointSize foregroundColor cache derivatives fallbackFont height ascent descent colorToCacheMap lineGap lineGapSlice minCodePoint maxCodePoint'
- instanceVariableNames: 'ttcDescription pointSize foregroundColor cache derivatives fallbackFont height ascent descent maxAscii colorToCacheMap lineGap lineGapSlice'
classVariableNames: 'GlyphCacheData GlyphCacheIndex GlyphCacheReady GlyphCacheSize NamesToIndexes Registry Scale ShutdownList'
poolDictionaries: ''
category: 'TrueType-Fonts'!
!TTCFont commentStamp: 'nk 4/2/2004 11:32' prior: 0!
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.
!
Item was added:
+ ----- Method: TTCFont>>isSymbolFont (in category 'testing') -----
+ isSymbolFont
+
+ ^ (self hasGlyphOf: $a) not!
Item was changed:
----- Method: TTCFont>>maxCodePoint (in category 'accessing') -----
maxCodePoint
+ ^ maxCodePoint ifNil: [maxCodePoint := ((ttcDescription size - 1 to: 0 by: -1)
+ detect: [:ea | (ttcDescription at: ea) isFallback not] ifNone: [0])]!
- ^maxAscii ifNil: [ttcDescription size - 1]!
Item was added:
+ ----- Method: TTCFont>>minCodePoint (in category 'accessing') -----
+ minCodePoint
+
+ ^ minCodePoint ifNil: [minCodePoint := (0 to: ttcDescription size - 1)
+ detect: [:ea | (ttcDescription at: ea) isFallback not] ifNone: [1]]!
More information about the Squeak-dev
mailing list
|