formatting

This commit is contained in:
daboe01
2026-05-17 16:47:12 +02:00
parent 78e1ea43c8
commit d6c5d8b4f2
2 changed files with 7 additions and 0 deletions
+4
View File
@@ -1229,6 +1229,10 @@ var _objectsInRange = function(aList, aRange)
}
}
// The spacings with kerning/ligatures are recalculated here for the visible part
// See comment in layoutGlyphsInLayoutManager: of CPSimpleTypesetter
// This gives an overall speed imrovement of ~20% in my testing (depending on text size / view size of course)
- (CPArray)glyphFrames
{
if (!_exactFramesCalculated && _glyphsFrames && _runs && _runs.length > 0)
+3
View File
@@ -318,6 +318,9 @@ var CPSystemTypesetterFactory,
var currentCharCode = theString.charCodeAt(glyphIndex),
charStr = theString.charAt(glyphIndex),
// this is ignoring kerning and ligatures but 100x faster than calculating the full string
// we cut corners here and do the exact calculation in - glyphFrames of _CPLineFragment (CPLayoutManager.j)
// this gives an overall speed imrovement of ~20% in my testing (depending on text size / view size of course)
charWidth = [charStr sizeWithFont:currentFont inWidth:NULL].width,
rangeWidth = prevRangeWidth + charWidth;