Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.1138.mcz
==================== Summary ====================
Name: Tools-mt.1138
Author: mt
Time: 1 March 2022, 5:36:12.550136 pm
UUID: 18107322-ed21-a74d-8d0b-922e83e066c7
Ancestors: Tools-ct.1137
Complements TrueType-mt.78
=============== Diff against Tools-ct.1137 ===============
Item was changed:
----- Method: AbstractFont>>browseAllSymbols (in category '*Tools-Browsing') -----
browseAllSymbols
"This is a variation of #browseAllGlyphs that is optimized to show all available glyphs in a single run, even though their code points may be scattered all over the Unicode range. See #browseAllSymbolsByCategory."
+ "self isSymbolFont ifFalse: [self notify: 'This is not a symbol font: ', self familyName]."
- self isSymbolFont ifFalse: [self notify: 'This is not a symbol font: ', self familyName].
^ self
+ browseGlyphsOf: (((self minCodePoint max: 16r1000) to: self maxCodePoint) select: [:ea | self hasGlyphForCode: ea])
- browseGlyphsOf: ((self minCodePoint to: self maxCodePoint) select: [:ea | self hasGlyphForCode: ea])
label: 'All symbols in ', self familyName!
Item was added:
+ ----- Method: TTCFont>>browseAllGlyphsScaledToDisplay (in category '*Tools-Browsing') -----
+ browseAllGlyphsScaledToDisplay
+ "Overwritten to support not-yet-registered fonts, e.g. through the FontImporterTool."
+
+ ^ self isInstalled
+ ifTrue: [super browseAllGlyphsScaledToDisplay]
+ ifFalse: [self browseAllGlyphs]!
Item was added:
+ ----- Method: TTCFont>>browseGlyphsByCategoryOf:select:label: (in category '*Tools-Browsing') -----
+ browseGlyphsByCategoryOf: someCodePointsOrCharacters select: aBlock label: aLabelOrNil
+ "Overwritten to speed up browsing for remote fonts. We have to compose a paragraph with a lot of new glyphs in a paragraph ... even though we will not render all at the same time."
+
+ ttcDescription cacheGlyphDataDuring: [
+ ^ super browseGlyphsByCategoryOf: someCodePointsOrCharacters select: aBlock label: aLabelOrNil].!
Item was added:
+ ----- Method: TTCFont>>browseGlyphsOf:select:label: (in category '*Tools-Browsing') -----
+ browseGlyphsOf: someCodePointsOrCharacters select: aBlock label: aLabelOrNil
+ "Overwritten to speed up browsing for remote fonts. We have to compose a paragraph with a lot of new glyphs in a paragraph ... even though we will not render all at the same time."
+
+ ttcDescription cacheGlyphDataDuring: [
+ ^ super browseGlyphsOf: someCodePointsOrCharacters select: aBlock label: aLabelOrNil].!
Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-mt.489.mcz
==================== Summary ====================
Name: Graphics-mt.489
Author: mt
Time: 1 March 2022, 4:52:26.923172 pm
UUID: 7699a405-9499-7549-9985-d0ef424ae0df
Ancestors: Graphics-mt.488
Some quality-of-life enhancements for fonts:
- Look up the regular version of any font instance you have at hand via #asRegular (complements #isRegular)
- Use #larger or #smaller to resize a font (like Color's #darker or #lighter)
- Offer a way to access a default style and font that definitely uses flexible TrueType data, which is not the case, e.g., for our 100% default where a pre-rendered StrikeFont is used
=============== Diff against Graphics-mt.488 ===============
Item was added:
+ ----- Method: AbstractFont>>asRegular (in category 'converting') -----
+ asRegular
+ "Try to lookup the receiver with normal emphasis. If the receiver itself looks bold face, this might be okay. Rely on what is registered on the font family's text style. Not that this is different from #emphasized: with 0, which does nothing."
+
+ self emphasis = 0 ifTrue: [^ self].
+ ^ self textStyleOrNil
+ ifNil: [self]
+ ifNotNil: [:style | style fontOfPointSize: self pointSize]!
Item was added:
+ ----- Method: AbstractFont>>larger (in category 'converting') -----
+ larger
+ "Answer a font that is about 20% larger than the receiver but has the same font family and emphasis. Round to 0.5 points to not yield so many different font instances."
+
+ ^ self asPointSize: ((self pointSize asFloat * 1.2) roundTo: 0.5)!
Item was added:
+ ----- Method: AbstractFont>>smaller (in category 'converting') -----
+ smaller
+ "Answer a font that is about 20% smaller than the receiver but has the same font family and emphasis. Round to 0.5 points to not yield so many different font instances."
+
+ ^ self asPointSize: ((self pointSize asFloat * 0.8) roundTo: 0.5)!
Item was added:
+ ----- Method: TextStyle class>>defaultTT (in category 'constants') -----
+ defaultTT
+ "Answer the default TrueType text style."
+
+ ^ self default isTTCStyle
+ ifTrue: [self default]
+ ifFalse: [self named: #BitstreamVeraSans]!
Item was added:
+ ----- Method: TextStyle class>>defaultTTFont (in category 'constants') -----
+ defaultTTFont
+
+ ^ self defaultTT defaultFont!
Marcel Taeumel uploaded a new version of TrueType to project The Trunk:
http://source.squeak.org/trunk/TrueType-mt.77.mcz
==================== Summary ====================
Name: TrueType-mt.77
Author: mt
Time: 1 March 2022, 4:46:05.378172 pm
UUID: 295b5945-b51f-8946-b43e-254b9151ba2a
Ancestors: TrueType-mt.76
I forgot to commit 'familyName' instVar. Sorry for the noise. Nuke unused 'NamesToIndexes' and 'Scale' classVars.
=============== Diff against TrueType-mt.76 ===============
Item was changed:
AbstractFont subclass: #TTCFont
+ instanceVariableNames: 'ttcDescription pointSize foregroundColor cache derivatives fallbackFont height ascent descent colorToCacheMap lineGap lineGapSlice minCodePoint maxCodePoint extraGlyphScale extraLineGap familyName'
+ classVariableNames: 'GlyphCacheData GlyphCacheIndex GlyphCacheReady GlyphCacheSize Registry ShutdownList'
- instanceVariableNames: 'ttcDescription pointSize foregroundColor cache derivatives fallbackFont height ascent descent colorToCacheMap lineGap lineGapSlice minCodePoint maxCodePoint extraGlyphScale extraLineGap'
- 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.
!