Standalone text engine for iOS aimed to be free from platform limitations
COLR
/ CPAL
tablesTypeface
:
var paletteEntryNames: [String]
var predefinedPalettes: [ColorPalette]
var associatedColors: [UIColor]
func colorInstance(forColors colors: [UIColor]) -> Typeface?
TLabel
:
fill
, fillStroke
, stroke
color
, width
, cap
, join
, miter
FontFile
:
init?(path: String)
init?(data: Data)
init?(stream: InputStream)
Typeface
:
init?(data: Data)
func variationInstance(forCoordinates coordinates: [CGFloat]) -> Typeface?
var isVariable: Bool
var variationAxes: [VariationAxis]
var variationCoordinates: [CGFloat]
ComposedFrame
:
var codeUnitRange: Range<Int>
func indexOfLine(forCodeUnitAt index: Int) -> Int
func selectionPath(forCodeUnitRange codeUnitRange: Range<Int>) -> CGPath
ComposedLine
:
var codeUnitRange: Range<Int>
func distance(forCodeUnitAt index: Int) -> CGFloat
func visualEdges(forCodeUnitRange: Range<Int>) -> [CGFloat]
func indexOfCodeUnit(at distance: CGFloat) -> Int
FrameResolver
:
func makeFrame(codeUnitRange: Range<Int>) -> ComposedFrame?
GlyphRun
:
func clusterStart(forCodeUnitAt index: Int) -> Int
func clusterEnd(forCodeUnitAt index: Int) -> Int
func leadingGlyphIndex(forCodeUnitAt index: Int) -> Int
func trailingGlyphIndex(forCodeUnitAt index: Int) -> Int
func distance(forCodeUnitAt index: Int) -> CGFloat
func indexOfCodeUnit(at distance: CGFloat) -> Int
ScriptClassifier
:
func scriptRuns(forCodeUnitRange: Range<Int>) -> RunSequence
ScriptRun
:
var codeUnitRange: Range<Int>
ShapingEngine
:
func shape(string: String, codeUnitRange: Range<Int>) -> ShapingResult
ShapingResult
:
var codeUnitRange: Range<Int>
Typesetter
:
func suggestForwardBreak(inCodeUnitRange: Range<Int>, extent: CGFloat, breakMode: BreakMode)
func suggestBackwardBreak(inCodeUnitRange: Range<Int>, extent: CGFloat, breakMode: BreakMode)
func makeSimpleLine(codeUnitRange: Range<Int>) -> ComposedLine
func makeTruncatedLine(codeUnitRange: Range<Int>, extent: CGFloat, breakMode: BreakMode, truncationPlace: TruncationPlace, tokenString: String?) -> ComposedLine
func makeTruncatedLine(codeUnitRange: Range<Int>, extent: CGFloat, breakMode: BreakMode, truncationPlace: TruncationPlace, tokenLine: ComposedLine) -> ComposedLine
CGLayer
for glyph renderingBidiAlgorithm
:
paragraphBoundary(inCodeUnitRange: Range<Int>) -> Int
makeParagraph(codeUnitRange: Range<Int>, direction: BaseDirection) -> BidiParagraph?
makeParagraph(codeUnitRange: Range<Int>, baseLevel: UInt8) -> BidiParagraph?
BidiParagraph
:
makeLine(codeUnitRange: Range<Int>) -> BidiLine?
var codeUnitRange: Range<Int>
BidiLine
:
var codeUnitRange: Range<Int>
BidiRun
:
var codeUnitRange: Range<Int>
BidiPair
:
var characterIndex: String.Index
Typesetter
:
func makeTruncatedLine(characterRange: Range<String.Index>, extent: CGFloat, breakMode: BreakMode, truncationPlace: TruncationPlace, tokenString: String?) -> ComposedLine
func makeTruncatedLine(characterRange: Range<String.Index>, extent: CGFloat, breakMode: BreakMode, truncationPlace: TruncationPlace, tokenLine: ComposedLine) -> ComposedLine
FrameResolver
:
var truncationMode: BreakMode = .line
var truncationPlace: TruncationPlace? = nil
TLabel
:
func indexOfCodeUnit(at position: CGPoint) -> Int?
func indexOfCharacter(at position: CGPoint) -> String.Index?
var truncationMode: BreakMode
var truncationPlace: TruncationPlace?
var textFrame: ComposedFrame?
Demo Project:
LinkableLabel
in demo projectTLabel
to open