Instance Method
baseGlyph(forName:suffix:test:) baseGlyphForName:suffix:test: baseGlyphForName_suffix_test_
Finds the longest dot-separated base name of name that resolves to a glyph accepted by test. this is useful for finding glyph info for alternate of PUA glyphs.
Declaration
func baseGlyph(forName name: String, suffix outSuffix: AutoreleasingUnsafeMutablePointer<NSString?>?, test: ((GSGlyph) -> Bool)? = nil) -> GSGlyph?Declaration
- (GSGlyph *) baseGlyphForName:(NSString *) name suffix:(NSString **) outSuffix test:(BOOL (^)(GSGlyph *candidate)) test;Declaration
baseGlyphForName_suffix_test_(name: str, candidate: GSGlyph, test) -> tuple[GSGlyph, str]Parameters
nameFull glyph name, e.g. @“a.sc.alt”.
outSuffixOn success, the cut off suffix including its leading dot, e.g. @”.alt”. Pass NULL if not needed. Only valid when the return value is non-nil; untouched otherwise.
testCalled for each candidate, longest base name first. Return YES to accept. Pass nil to accept any glyph.
Return Value
The accepted base glyph, or nil if no base name resolved.