mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
formatting
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user