public final class CoreText
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
CoreText.Block_CTFontDescriptorMatchFontDescriptorsWithProgressHandler |
static interface |
CoreText.Block_CTFontManagerRegisterFontDescriptors |
static interface |
CoreText.Block_CTFontManagerRegisterFontsWithAssetNames |
static interface |
CoreText.Block_CTFontManagerRegisterFontURLs |
static interface |
CoreText.Block_CTFontManagerRequestFonts |
static interface |
CoreText.Block_CTFontManagerUnregisterFontDescriptors |
static interface |
CoreText.Block_CTFontManagerUnregisterFontURLs |
static interface |
CoreText.Block_CTLineEnumerateCaretOffsets |
static interface |
CoreText.Function_CTFontCollectionCreateMatchingFontDescriptorsSortedWithCallback |
| Modifier and Type | Method and Description |
|---|---|
static CFArrayRef |
CTFontCollectionCopyFontAttribute(CTFontCollectionRef collection,
CFStringRef attributeName,
int options)
[@function] CTFontCollectionCopyFontAttribute
|
static CFArrayRef |
CTFontCollectionCopyFontAttributes(CTFontCollectionRef collection,
CFSetRef attributeNames,
int options)
[@function] CTFontCollectionCopyFontAttributes
|
static CTFontCollectionRef |
CTFontCollectionCreateCopyWithFontDescriptors(CTFontCollectionRef original,
CFArrayRef queryDescriptors,
CFDictionaryRef options)
[@function] CTFontCollectionCreateCopyWithFontDescriptors
|
static CTFontCollectionRef |
CTFontCollectionCreateFromAvailableFonts(CFDictionaryRef options)
[@function] CTFontCollectionCreateFromAvailableFonts
|
static CFArrayRef |
CTFontCollectionCreateMatchingFontDescriptors(CTFontCollectionRef collection)
[@function] CTFontCollectionCreateMatchingFontDescriptors
|
static CFArrayRef |
CTFontCollectionCreateMatchingFontDescriptorsSortedWithCallback(CTFontCollectionRef collection,
CoreText.Function_CTFontCollectionCreateMatchingFontDescriptorsSortedWithCallback sortCallback,
org.moe.natj.general.ptr.VoidPtr refCon)
[@function] CTFontCollectionCreateMatchingFontDescriptorsSortedWithCallback
|
static CFArrayRef |
CTFontCollectionCreateMatchingFontDescriptorsWithOptions(CTFontCollectionRef collection,
CFDictionaryRef options)
[@function] CTFontCollectionCreateMatchingFontDescriptorsWithOptions
|
static CTFontCollectionRef |
CTFontCollectionCreateWithFontDescriptors(CFArrayRef queryDescriptors,
CFDictionaryRef options)
[@function] CTFontCollectionCreateWithFontDescriptors
|
static long |
CTFontCollectionGetTypeID()
[@function] CTFontCollectionGetTypeID
|
static org.moe.natj.general.ptr.ConstVoidPtr |
CTFontCopyAttribute(CTFontRef font,
CFStringRef attribute)
[@function] CTFontCopyAttribute
|
static CFArrayRef |
CTFontCopyAvailableTables(CTFontRef font,
int options)
[@function] CTFontCopyAvailableTables
|
static CFCharacterSetRef |
CTFontCopyCharacterSet(CTFontRef font)
[@function] CTFontCopyCharacterSet
|
static CFArrayRef |
CTFontCopyDefaultCascadeListForLanguages(CTFontRef font,
CFArrayRef languagePrefList)
[@function] CTFontCopyDefaultCascadeListForLanguages
|
static CFStringRef |
CTFontCopyDisplayName(CTFontRef font)
[@function] CTFontCopyDisplayName
|
static CFStringRef |
CTFontCopyFamilyName(CTFontRef font)
[@function] CTFontCopyFamilyName
|
static CFArrayRef |
CTFontCopyFeatures(CTFontRef font)
[@function] CTFontCopyFeatures
|
static CFArrayRef |
CTFontCopyFeatureSettings(CTFontRef font)
[@function] CTFontCopyFeatureSettings
|
static CTFontDescriptorRef |
CTFontCopyFontDescriptor(CTFontRef font)
[@function] CTFontCopyFontDescriptor
|
static CFStringRef |
CTFontCopyFullName(CTFontRef font)
[@function] CTFontCopyFullName
|
static CGFontRef |
CTFontCopyGraphicsFont(CTFontRef font,
org.moe.natj.general.ptr.Ptr<CTFontDescriptorRef> attributes)
[@function] CTFontCopyGraphicsFont
|
static CFStringRef |
CTFontCopyLocalizedName(CTFontRef font,
CFStringRef nameKey,
org.moe.natj.general.ptr.Ptr<CFStringRef> actualLanguage)
[@function] CTFontCopyLocalizedName
|
static CFStringRef |
CTFontCopyName(CTFontRef font,
CFStringRef nameKey)
[@function] CTFontCopyName
|
static CFStringRef |
CTFontCopyNameForGlyph(CTFontRef font,
char glyph)
[@function] CTFontCopyNameForGlyph
|
static CFStringRef |
CTFontCopyPostScriptName(CTFontRef font)
[@function] CTFontCopyPostScriptName
|
static CFArrayRef |
CTFontCopySupportedLanguages(CTFontRef font)
[@function] CTFontCopySupportedLanguages
|
static CFDataRef |
CTFontCopyTable(CTFontRef font,
int table,
int options)
[@function] CTFontCopyTable
|
static CFDictionaryRef |
CTFontCopyTraits(CTFontRef font)
[@function] CTFontCopyTraits
|
static CFDictionaryRef |
CTFontCopyVariation(CTFontRef font)
[@function] CTFontCopyVariation
|
static CFArrayRef |
CTFontCopyVariationAxes(CTFontRef font)
[@function] CTFontCopyVariationAxes
|
static CTFontRef |
CTFontCreateCopyWithAttributes(CTFontRef font,
double size,
CGAffineTransform matrix,
CTFontDescriptorRef attributes)
[@function] CTFontCreateCopyWithAttributes
|
static CTFontRef |
CTFontCreateCopyWithFamily(CTFontRef font,
double size,
CGAffineTransform matrix,
CFStringRef family)
[@function] CTFontCreateCopyWithFamily
|
static CTFontRef |
CTFontCreateCopyWithSymbolicTraits(CTFontRef font,
double size,
CGAffineTransform matrix,
int symTraitValue,
int symTraitMask)
[@function] CTFontCreateCopyWithSymbolicTraits
|
static CTFontRef |
CTFontCreateForString(CTFontRef currentFont,
CFStringRef string,
CFRange range)
[@function] CTFontCreateForString
|
static CTFontRef |
CTFontCreateForStringWithLanguage(CTFontRef currentFont,
CFStringRef string,
CFRange range,
CFStringRef language)
[@function] CTFontCreateForStringWithLanguage
|
static CGPathRef |
CTFontCreatePathForGlyph(CTFontRef font,
char glyph,
CGAffineTransform matrix)
[@function] CTFontCreatePathForGlyph
|
static CTFontRef |
CTFontCreateUIFontForLanguage(int uiType,
double size,
CFStringRef language)
[@function] CTFontCreateUIFontForLanguage
|
static CTFontRef |
CTFontCreateWithFontDescriptor(CTFontDescriptorRef descriptor,
double size,
CGAffineTransform matrix)
[@function] CTFontCreateWithFontDescriptor
|
static CTFontRef |
CTFontCreateWithFontDescriptorAndOptions(CTFontDescriptorRef descriptor,
double size,
CGAffineTransform matrix,
long options)
[@function] CTFontCreateWithFontDescriptorAndOptions
|
static CTFontRef |
CTFontCreateWithGraphicsFont(CGFontRef graphicsFont,
double size,
CGAffineTransform matrix,
CTFontDescriptorRef attributes)
[@function] CTFontCreateWithGraphicsFont
|
static CTFontRef |
CTFontCreateWithName(CFStringRef name,
double size,
CGAffineTransform matrix)
[@function] CTFontCreateWithName
|
static CTFontRef |
CTFontCreateWithNameAndOptions(CFStringRef name,
double size,
CGAffineTransform matrix,
long options)
[@function] CTFontCreateWithNameAndOptions
|
static org.moe.natj.general.ptr.ConstVoidPtr |
CTFontDescriptorCopyAttribute(CTFontDescriptorRef descriptor,
CFStringRef attribute)
[@function] CTFontDescriptorCopyAttribute
|
static CFDictionaryRef |
CTFontDescriptorCopyAttributes(CTFontDescriptorRef descriptor)
[@function] CTFontDescriptorCopyAttributes
|
static org.moe.natj.general.ptr.ConstVoidPtr |
CTFontDescriptorCopyLocalizedAttribute(CTFontDescriptorRef descriptor,
CFStringRef attribute,
org.moe.natj.general.ptr.Ptr<CFStringRef> language)
function CTFontDescriptorCopyLocalizedAttribute
|
static CTFontDescriptorRef |
CTFontDescriptorCreateCopyWithAttributes(CTFontDescriptorRef original,
CFDictionaryRef attributes)
[@function] CTFontDescriptorCreateCopyWithAttributes
|
static CTFontDescriptorRef |
CTFontDescriptorCreateCopyWithFamily(CTFontDescriptorRef original,
CFStringRef family)
[@function] CTFontCreateCopyWithFamily
|
static CTFontDescriptorRef |
CTFontDescriptorCreateCopyWithFeature(CTFontDescriptorRef original,
CFNumberRef featureTypeIdentifier,
CFNumberRef featureSelectorIdentifier)
[@function] CTFontDescriptorCreateCopyWithFeature
|
static CTFontDescriptorRef |
CTFontDescriptorCreateCopyWithSymbolicTraits(CTFontDescriptorRef original,
int symTraitValue,
int symTraitMask)
[@function] CTFontDescriptorCreateCopyWithSymbolicTraits
|
static CTFontDescriptorRef |
CTFontDescriptorCreateCopyWithVariation(CTFontDescriptorRef original,
CFNumberRef variationIdentifier,
double variationValue)
[@function] CTFontDescriptorCreateCopyWithVariation
|
static CTFontDescriptorRef |
CTFontDescriptorCreateMatchingFontDescriptor(CTFontDescriptorRef descriptor,
CFSetRef mandatoryAttributes)
[@function] CTFontDescriptorCreateMatchingFontDescriptor
|
static CFArrayRef |
CTFontDescriptorCreateMatchingFontDescriptors(CTFontDescriptorRef descriptor,
CFSetRef mandatoryAttributes)
[@function] CTFontDescriptorCreateMatchingFontDescriptors
|
static CTFontDescriptorRef |
CTFontDescriptorCreateWithAttributes(CFDictionaryRef attributes)
[@function] CTFontDescriptorCreateWithAttributes
|
static CTFontDescriptorRef |
CTFontDescriptorCreateWithNameAndSize(CFStringRef name,
double size)
[@function] CTFontDescriptorCreateWithNameAndSize
|
static long |
CTFontDescriptorGetTypeID()
[@function] CTFontDescriptorGetTypeID
|
static boolean |
CTFontDescriptorMatchFontDescriptorsWithProgressHandler(CFArrayRef descriptors,
CFSetRef mandatoryAttributes,
CoreText.Block_CTFontDescriptorMatchFontDescriptorsWithProgressHandler progressBlock)
[@function] CTFontDescriptorMatchFontDescriptorsWithProgressHandler
This function returns immediately, but can potentially take long time to process.
|
static void |
CTFontDrawGlyphs(CTFontRef font,
org.moe.natj.general.ptr.ConstCharPtr glyphs,
CGPoint positions,
long count,
CGContextRef context)
[@function] CTFontDrawGlyphs
|
static double |
CTFontGetAdvancesForGlyphs(CTFontRef font,
int orientation,
org.moe.natj.general.ptr.ConstCharPtr glyphs,
CGSize advances,
long count)
[@function] CTFontGetAdvancesForGlyphs
|
static double |
CTFontGetAscent(CTFontRef font)
[@function] CTFontGetAscent
|
static CGRect |
CTFontGetBoundingBox(CTFontRef font)
[@function] CTFontGetBoundingBox
|
static CGRect |
CTFontGetBoundingRectsForGlyphs(CTFontRef font,
int orientation,
org.moe.natj.general.ptr.ConstCharPtr glyphs,
CGRect boundingRects,
long count)
[@function] CTFontGetBoundingRectsForGlyphs
|
static double |
CTFontGetCapHeight(CTFontRef font)
[@function] CTFontGetCapHeight
|
static double |
CTFontGetDescent(CTFontRef font)
[@function] CTFontGetDescent
|
static long |
CTFontGetGlyphCount(CTFontRef font)
[@function] CTFontGetGlyphCount
|
static boolean |
CTFontGetGlyphsForCharacters(CTFontRef font,
org.moe.natj.general.ptr.ConstCharPtr characters,
org.moe.natj.general.ptr.CharPtr glyphs,
long count)
[@function] CTFontGetGlyphsForCharacters
|
static char |
CTFontGetGlyphWithName(CTFontRef font,
CFStringRef glyphName)
[@function] CTFontGetGlyphWithName
|
static double |
CTFontGetLeading(CTFontRef font)
[@function] CTFontGetLeading
|
static long |
CTFontGetLigatureCaretPositions(CTFontRef font,
char glyph,
org.moe.natj.general.ptr.NFloatPtr positions,
long maxPositions)
[@function] CTFontGetLigatureCaretPositions
|
static CGAffineTransform |
CTFontGetMatrix(CTFontRef font)
[@function] CTFontGetMatrix
|
static CGRect |
CTFontGetOpticalBoundsForGlyphs(CTFontRef font,
org.moe.natj.general.ptr.ConstCharPtr glyphs,
CGRect boundingRects,
long count,
long options)
[@function] CTFontGetOpticalBoundsForGlyphs
|
static double |
CTFontGetSize(CTFontRef font)
[@function] CTFontGetSize
|
static double |
CTFontGetSlantAngle(CTFontRef font)
[@function] CTFontGetSlantAngle
|
static int |
CTFontGetStringEncoding(CTFontRef font)
[@function] CTFontGetStringEncoding
|
static int |
CTFontGetSymbolicTraits(CTFontRef font)
[@function] CTFontGetSymbolicTraits
|
static long |
CTFontGetTypeID()
[@function] CTFontGetTypeID
|
static double |
CTFontGetUnderlinePosition(CTFontRef font)
[@function] CTFontGetUnderlinePosition
|
static double |
CTFontGetUnderlineThickness(CTFontRef font)
[@function] CTFontGetUnderlineThickness
|
static int |
CTFontGetUnitsPerEm(CTFontRef font)
[@function] CTFontGetUnitsPerEm
|
static void |
CTFontGetVerticalTranslationsForGlyphs(CTFontRef font,
org.moe.natj.general.ptr.ConstCharPtr glyphs,
CGSize translations,
long count)
[@function] CTFontGetVerticalTranslationsForGlyphs
|
static double |
CTFontGetXHeight(CTFontRef font)
[@function] CTFontGetXHeight
|
static CFArrayRef |
CTFontManagerCopyAvailableFontFamilyNames()
[@function] CTFontManagerCopyAvailableFontFamilyNames
|
static CFArrayRef |
CTFontManagerCopyAvailablePostScriptNames()
[@function] CTFontManagerCopyAvailablePostScriptNames
|
static CFArrayRef |
CTFontManagerCopyRegisteredFontDescriptors(int scope,
boolean enabled)
[@function] CTFontManagerCopyRegisteredFontDescriptors
|
static CTFontDescriptorRef |
CTFontManagerCreateFontDescriptorFromData(CFDataRef data)
[@function] CTFontManagerCreateFontDescriptorFromData
|
static CFArrayRef |
CTFontManagerCreateFontDescriptorsFromData(CFDataRef data)
[@function] CTFontManagerCreateFontDescriptorsFromData
|
static CFArrayRef |
CTFontManagerCreateFontDescriptorsFromURL(CFURLRef fileURL)
[@function] CTFontManagerCreateFontDescriptorsFromURL
|
static void |
CTFontManagerRegisterFontDescriptors(CFArrayRef fontDescriptors,
int scope,
boolean enabled,
CoreText.Block_CTFontManagerRegisterFontDescriptors registrationHandler)
[@function] CTFontManagerRegisterFontDescriptors
|
static boolean |
CTFontManagerRegisterFontsForURL(CFURLRef fontURL,
int scope,
org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
[@function] CTFontManagerRegisterFontsForURL
|
static boolean |
CTFontManagerRegisterFontsForURLs(CFArrayRef fontURLs,
int scope,
org.moe.natj.general.ptr.Ptr<CFArrayRef> errors)
[@function] CTFontManagerRegisterFontsForURLs
|
static void |
CTFontManagerRegisterFontsWithAssetNames(CFArrayRef fontAssetNames,
CFBundleRef bundle,
int scope,
boolean enabled,
CoreText.Block_CTFontManagerRegisterFontsWithAssetNames registrationHandler)
[@function] CTFontManagerRegisterFontsWithAssetNames
|
static void |
CTFontManagerRegisterFontURLs(CFArrayRef fontURLs,
int scope,
boolean enabled,
CoreText.Block_CTFontManagerRegisterFontURLs registrationHandler)
[@function] CTFontManagerRegisterFontURLs
|
static boolean |
CTFontManagerRegisterGraphicsFont(CGFontRef font,
org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
[@function] CTFontManagerRegisterGraphicsFont
|
static void |
CTFontManagerRequestFonts(CFArrayRef fontDescriptors,
CoreText.Block_CTFontManagerRequestFonts completionHandler)
[@function] CTFontManagerRequestFonts
|
static void |
CTFontManagerUnregisterFontDescriptors(CFArrayRef fontDescriptors,
int scope,
CoreText.Block_CTFontManagerUnregisterFontDescriptors registrationHandler)
[@function] CTFontManagerUnregisterFontDescriptors
|
static boolean |
CTFontManagerUnregisterFontsForURL(CFURLRef fontURL,
int scope,
org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
[@function] CTFontManagerUnregisterFontsForURL
|
static boolean |
CTFontManagerUnregisterFontsForURLs(CFArrayRef fontURLs,
int scope,
org.moe.natj.general.ptr.Ptr<CFArrayRef> errors)
[@function] CTFontManagerUnregisterFontsForURLs
|
static void |
CTFontManagerUnregisterFontURLs(CFArrayRef fontURLs,
int scope,
CoreText.Block_CTFontManagerUnregisterFontURLs registrationHandler)
[@function] CTFontManagerUnregisterFontURLs
|
static boolean |
CTFontManagerUnregisterGraphicsFont(CGFontRef font,
org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
[@function] CTFontManagerUnregisterGraphicsFont
|
static void |
CTFrameDraw(CTFrameRef frame,
CGContextRef context)
[@function] CTFrameDraw
|
static CFDictionaryRef |
CTFrameGetFrameAttributes(CTFrameRef frame)
[@function] CTFrameGetFrameAttributes
|
static void |
CTFrameGetLineOrigins(CTFrameRef frame,
CFRange range,
CGPoint origins)
[@function] CTFrameGetLineOrigins
|
static CFArrayRef |
CTFrameGetLines(CTFrameRef frame)
[@function] CTFrameGetLines
|
static CGPathRef |
CTFrameGetPath(CTFrameRef frame)
[@function] CTFrameGetPath
|
static CFRange |
CTFrameGetStringRange(CTFrameRef frame)
[@function] CTFrameGetStringRange
|
static long |
CTFrameGetTypeID()
[@function] CTFrameGetTypeID
|
static CFRange |
CTFrameGetVisibleStringRange(CTFrameRef frame)
[@function] CTFrameGetVisibleStringRange
|
static CTFrameRef |
CTFramesetterCreateFrame(CTFramesetterRef framesetter,
CFRange stringRange,
CGPathRef path,
CFDictionaryRef frameAttributes)
[@function] CTFramesetterCreateFrame
|
static CTFramesetterRef |
CTFramesetterCreateWithAttributedString(CFAttributedStringRef attrString)
[@function] CTFramesetterCreateWithAttributedString
|
static CTFramesetterRef |
CTFramesetterCreateWithTypesetter(CTTypesetterRef typesetter)
[@function] CTFramesetterCreateWithTypesetter
|
static long |
CTFramesetterGetTypeID()
[@function] CTFramesetterGetTypeID
|
static CTTypesetterRef |
CTFramesetterGetTypesetter(CTFramesetterRef framesetter)
[@function] CTFramesetterGetTypesetter
|
static CGSize |
CTFramesetterSuggestFrameSizeWithConstraints(CTFramesetterRef framesetter,
CFRange stringRange,
CFDictionaryRef frameAttributes,
CGSize constraints,
CFRange fitRange)
[@function] CTFramesetterSuggestFrameSizeWithConstraints
|
static int |
CTGetCoreTextVersion()
[@function] CTGetCoreTextVersion
|
static CTGlyphInfoRef |
CTGlyphInfoCreateWithCharacterIdentifier(char cid,
short collection,
CFStringRef baseString)
[@function] CTGlyphInfoCreateWithCharacterIdentifier
|
static CTGlyphInfoRef |
CTGlyphInfoCreateWithGlyph(char glyph,
CTFontRef font,
CFStringRef baseString)
[@function] CTGlyphInfoCreateWithGlyph
|
static CTGlyphInfoRef |
CTGlyphInfoCreateWithGlyphName(CFStringRef glyphName,
CTFontRef font,
CFStringRef baseString)
[@function] CTGlyphInfoCreateWithGlyphName
|
static short |
CTGlyphInfoGetCharacterCollection(CTGlyphInfoRef glyphInfo)
[@function] CTGlyphInfoGetCharacterCollection
|
static char |
CTGlyphInfoGetCharacterIdentifier(CTGlyphInfoRef glyphInfo)
[@function] CTGlyphInfoGetCharacterIdentifier
|
static char |
CTGlyphInfoGetGlyph(CTGlyphInfoRef glyphInfo)
[@function] CTGlyphInfoGetGlyph
|
static CFStringRef |
CTGlyphInfoGetGlyphName(CTGlyphInfoRef glyphInfo)
[@function] CTGlyphInfoGetGlyphName
|
static long |
CTGlyphInfoGetTypeID()
[@function] CTGlyphInfoGetTypeID
|
static CTLineRef |
CTLineCreateJustifiedLine(CTLineRef line,
double justificationFactor,
double justificationWidth)
[@function] CTLineCreateJustifiedLine
|
static CTLineRef |
CTLineCreateTruncatedLine(CTLineRef line,
double width,
int truncationType,
CTLineRef truncationToken)
[@function] CTLineCreateTruncatedLine
|
static CTLineRef |
CTLineCreateWithAttributedString(CFAttributedStringRef attrString)
[@function] CTLineCreateWithAttributedString
|
static void |
CTLineDraw(CTLineRef line,
CGContextRef context)
[@function] CTLineDraw
|
static void |
CTLineEnumerateCaretOffsets(CTLineRef line,
CoreText.Block_CTLineEnumerateCaretOffsets block)
[@function] CTLineEnumerateCaretOffsets
|
static CGRect |
CTLineGetBoundsWithOptions(CTLineRef line,
long options)
[@function] CTLineGetBoundsWithOptions
|
static long |
CTLineGetGlyphCount(CTLineRef line)
[@function] CTLineGetGlyphCount
|
static CFArrayRef |
CTLineGetGlyphRuns(CTLineRef line)
[@function] CTLineGetGlyphRuns
|
static CGRect |
CTLineGetImageBounds(CTLineRef line,
CGContextRef context)
[@function] CTLineGetImageBounds
|
static double |
CTLineGetOffsetForStringIndex(CTLineRef line,
long charIndex,
org.moe.natj.general.ptr.NFloatPtr secondaryOffset)
[@function] CTLineGetOffsetForStringIndex
|
static double |
CTLineGetPenOffsetForFlush(CTLineRef line,
double flushFactor,
double flushWidth)
[@function] CTLineGetPenOffsetForFlush
|
static long |
CTLineGetStringIndexForPosition(CTLineRef line,
CGPoint position)
[@function] CTLineGetStringIndexForPosition
|
static CFRange |
CTLineGetStringRange(CTLineRef line)
[@function] CTLineGetStringRange
|
static double |
CTLineGetTrailingWhitespaceWidth(CTLineRef line)
[@function] CTLineGetTrailingWhitespaceWidth
|
static long |
CTLineGetTypeID()
[@function] CTLineGetTypeID
|
static double |
CTLineGetTypographicBounds(CTLineRef line,
org.moe.natj.general.ptr.NFloatPtr ascent,
org.moe.natj.general.ptr.NFloatPtr descent,
org.moe.natj.general.ptr.NFloatPtr leading)
[@function] CTLineGetTypographicBounds
|
static CTParagraphStyleRef |
CTParagraphStyleCreate(CTParagraphStyleSetting settings,
long settingCount)
[@function] CTParagraphStyleCreate
|
static CTParagraphStyleRef |
CTParagraphStyleCreateCopy(CTParagraphStyleRef paragraphStyle)
[@function] CTParagraphStyleCreateCopy
|
static long |
CTParagraphStyleGetTypeID()
[@function] CTParagraphStyleGetTypeID
|
static boolean |
CTParagraphStyleGetValueForSpecifier(CTParagraphStyleRef paragraphStyle,
int spec,
long valueBufferSize,
org.moe.natj.general.ptr.VoidPtr valueBuffer)
[@function] CTParagraphStyleGetValueForSpecifier
|
static CTRubyAnnotationRef |
CTRubyAnnotationCreateCopy(CTRubyAnnotationRef rubyAnnotation)
[@function] CTRubyAnnotationCreateCopy
|
static CTRubyAnnotationRef |
CTRubyAnnotationCreateWithAttributes(byte alignment,
byte overhang,
byte position,
CFStringRef string,
CFDictionaryRef attributes)
[@function] CTRubyAnnotationCreateWithAttributes
|
static byte |
CTRubyAnnotationGetAlignment(CTRubyAnnotationRef rubyAnnotation)
[@function] CTRubyAnnotationGetAlignment
|
static byte |
CTRubyAnnotationGetOverhang(CTRubyAnnotationRef rubyAnnotation)
[@function] CTRubyAnnotationGetOverhang
|
static double |
CTRubyAnnotationGetSizeFactor(CTRubyAnnotationRef rubyAnnotation)
[@function] CTRubyAnnotationGetSizeFactor
|
static CFStringRef |
CTRubyAnnotationGetTextForPosition(CTRubyAnnotationRef rubyAnnotation,
byte position)
[@function] CTRubyAnnotationGetTextForPosition
|
static long |
CTRubyAnnotationGetTypeID()
[@function] CTRubyAnnotationGetTypeID
|
static CTRunDelegateRef |
CTRunDelegateCreate(CTRunDelegateCallbacks callbacks,
org.moe.natj.general.ptr.VoidPtr refCon)
[@function] CTRunDelegateCreate
|
static org.moe.natj.general.ptr.VoidPtr |
CTRunDelegateGetRefCon(CTRunDelegateRef runDelegate)
[@function] CTRunDelegateGetRefCon
|
static long |
CTRunDelegateGetTypeID()
[@function] CTRunDelegateGetTypeID
|
static void |
CTRunDraw(CTRunRef run,
CGContextRef context,
CFRange range)
[@function] CTRunDraw
|
static void |
CTRunGetAdvances(CTRunRef run,
CFRange range,
CGSize buffer)
[@function] CTRunGetAdvances
|
static CGSize |
CTRunGetAdvancesPtr(CTRunRef run)
[@function] CTRunGetAdvancesPtr
|
static CFDictionaryRef |
CTRunGetAttributes(CTRunRef run)
[@function] CTRunGetAttributes
|
static void |
CTRunGetBaseAdvancesAndOrigins(CTRunRef runRef,
CFRange range,
CGSize advancesBuffer,
CGPoint originsBuffer)
[@function] CTRunGetBaseAdvancesAndOrigins
|
static long |
CTRunGetGlyphCount(CTRunRef run)
[@function] CTRunGetGlyphCount
|
static void |
CTRunGetGlyphs(CTRunRef run,
CFRange range,
org.moe.natj.general.ptr.CharPtr buffer)
[@function] CTRunGetGlyphs
|
static org.moe.natj.general.ptr.ConstCharPtr |
CTRunGetGlyphsPtr(CTRunRef run)
[@function] CTRunGetGlyphsPtr
|
static CGRect |
CTRunGetImageBounds(CTRunRef run,
CGContextRef context,
CFRange range)
[@function] CTRunGetImageBounds
|
static void |
CTRunGetPositions(CTRunRef run,
CFRange range,
CGPoint buffer)
[@function] CTRunGetPositions
|
static CGPoint |
CTRunGetPositionsPtr(CTRunRef run)
[@function] CTRunGetPositionsPtr
|
static int |
CTRunGetStatus(CTRunRef run)
[@function] CTRunGetStatus
|
static void |
CTRunGetStringIndices(CTRunRef run,
CFRange range,
org.moe.natj.general.ptr.NIntPtr buffer)
[@function] CTRunGetStringIndices
|
static org.moe.natj.general.ptr.ConstNIntPtr |
CTRunGetStringIndicesPtr(CTRunRef run)
[@function] CTRunGetStringIndicesPtr
|
static CFRange |
CTRunGetStringRange(CTRunRef run)
[@function] CTRunGetStringRange
|
static CGAffineTransform |
CTRunGetTextMatrix(CTRunRef run)
[@function] CTRunGetTextMatrix
|
static long |
CTRunGetTypeID()
[@function] CTRunGetTypeID
|
static double |
CTRunGetTypographicBounds(CTRunRef run,
CFRange range,
org.moe.natj.general.ptr.NFloatPtr ascent,
org.moe.natj.general.ptr.NFloatPtr descent,
org.moe.natj.general.ptr.NFloatPtr leading)
[@function] CTRunGetTypographicBounds
|
static CTTextTabRef |
CTTextTabCreate(byte alignment,
double location,
CFDictionaryRef options)
[@function] CTTextTabCreate
|
static byte |
CTTextTabGetAlignment(CTTextTabRef tab)
[@function] CTTextTabGetAlignment
|
static double |
CTTextTabGetLocation(CTTextTabRef tab)
[@function] CTTextTabGetLocation
|
static CFDictionaryRef |
CTTextTabGetOptions(CTTextTabRef tab)
[@function] CTTextTabGetOptions
|
static long |
CTTextTabGetTypeID()
[@function] CTTypesetterGetTypeID
|
static CTLineRef |
CTTypesetterCreateLine(CTTypesetterRef typesetter,
CFRange stringRange)
[@function] CTTypesetterCreateLine
|
static CTLineRef |
CTTypesetterCreateLineWithOffset(CTTypesetterRef typesetter,
CFRange stringRange,
double offset)
[@function] CTTypesetterCreateLineWithOffset
|
static CTTypesetterRef |
CTTypesetterCreateWithAttributedString(CFAttributedStringRef string)
[@function] CTTypesetterCreateWithAttributedString
|
static CTTypesetterRef |
CTTypesetterCreateWithAttributedStringAndOptions(CFAttributedStringRef string,
CFDictionaryRef options)
[@function] CTTypesetterCreateWithAttributedStringAndOptions
|
static long |
CTTypesetterGetTypeID()
[@function] CTTypesetterGetTypeID
|
static long |
CTTypesetterSuggestClusterBreak(CTTypesetterRef typesetter,
long startIndex,
double width)
[@function] CTTypesetterSuggestClusterBreak
|
static long |
CTTypesetterSuggestClusterBreakWithOffset(CTTypesetterRef typesetter,
long startIndex,
double width,
double offset)
[@function] CTTypesetterSuggestClusterBreakWithOffset
|
static long |
CTTypesetterSuggestLineBreak(CTTypesetterRef typesetter,
long startIndex,
double width)
[@function] CTTypesetterSuggestLineBreak
|
static long |
CTTypesetterSuggestLineBreakWithOffset(CTTypesetterRef typesetter,
long startIndex,
double width,
double offset)
[@function] CTTypesetterSuggestLineBreakWithOffset
|
static CFStringRef |
kCTBackgroundColorAttributeName()
[@const] kCTBackgroundColorAttributeName
|
static CFStringRef |
kCTBaselineClassAttributeName()
[@const] kCTBaselineClassAttributeName
|
static CFStringRef |
kCTBaselineClassHanging()
[@defined] kCTBaselineClassHanging
|
static CFStringRef |
kCTBaselineClassIdeographicCentered()
[@defined] kCTBaselineClassIdeographicCentered
|
static CFStringRef |
kCTBaselineClassIdeographicHigh()
[@defined] kCTBaselineClassIdeographicHigh
|
static CFStringRef |
kCTBaselineClassIdeographicLow()
[@defined] kCTBaselineClassIdeographicLow
|
static CFStringRef |
kCTBaselineClassMath()
[@defined] kCTBaselineClassMath
|
static CFStringRef |
kCTBaselineClassRoman()
[@defined] kCTBaselineClassRoman
|
static CFStringRef |
kCTBaselineInfoAttributeName()
[@const] kCTBaselineInfoAttributeName
|
static CFStringRef |
kCTBaselineOffsetAttributeName()
[@const] kCTBaselineOffsetAttributeName
|
static CFStringRef |
kCTBaselineOriginalFont()
[@defined] kCTBaselineOriginalFont
|
static CFStringRef |
kCTBaselineReferenceFont()
[@defined] kCTBaselineReferenceFont
|
static CFStringRef |
kCTBaselineReferenceInfoAttributeName()
[@const] kCTBaselineReferenceInfoAttributeName
|
static CFStringRef |
kCTCharacterShapeAttributeName()
Deprecated.
|
static CFStringRef |
kCTFontAttributeName()
[@const] kCTFontAttributeName
|
static CFStringRef |
kCTFontBaselineAdjustAttribute()
[@defined] kCTFontBaselineAdjustAttribute
|
static CFStringRef |
kCTFontCascadeListAttribute()
[@defined] kCTFontCascadeListAttribute
|
static CFStringRef |
kCTFontCharacterSetAttribute()
[@defined] kCTFontCharacterSetAttribute
|
static CFStringRef |
kCTFontCollectionRemoveDuplicatesOption()
[@defined] kCTFontCollectionRemoveDuplicatesOption
|
static CFStringRef |
kCTFontCopyrightNameKey()
Name specifier constants
[@defined] kCTFontCopyrightNameKey
|
static CFStringRef |
kCTFontDescriptionNameKey()
[@defined] kCTFontDescriptionNameKey
|
static CFStringRef |
kCTFontDescriptorMatchingCurrentAssetSize()
CFNumber; Byte size to download for the current descriptor.
|
static CFStringRef |
kCTFontDescriptorMatchingDescriptors()
CFArray; Array of descriptors to be queried.
|
static CFStringRef |
kCTFontDescriptorMatchingError()
CFError; Valid when state kCTFontDescriptorMatchingDidFailWithError.
|
static CFStringRef |
kCTFontDescriptorMatchingPercentage()
CFNumber; Download progress in 0 - 100.
|
static CFStringRef |
kCTFontDescriptorMatchingResult()
CFArray; Array of matched font descriptors.
|
static CFStringRef |
kCTFontDescriptorMatchingSourceDescriptor()
CTFontDescriptorRef; The current font descriptor.
|
static CFStringRef |
kCTFontDescriptorMatchingTotalAssetSize()
CFNumber; Total byte size to download.
|
static CFStringRef |
kCTFontDescriptorMatchingTotalDownloadedSize()
CFNumber; Total downloaded byte size.
|
static CFStringRef |
kCTFontDesignerNameKey()
[@defined] kCTFontDesignerNameKey
|
static CFStringRef |
kCTFontDesignerURLNameKey()
[@defined] kCTFontDesignerURLNameKey
|
static CFStringRef |
kCTFontDisplayNameAttribute()
[@defined] kCTFontDisplayNameAttribute
|
static CFStringRef |
kCTFontDownloadableAttribute()
[@defined] kCTFontDownloadableAttribute
|
static CFStringRef |
kCTFontDownloadedAttribute()
[@defined] kCTFontDownloadedAttribute
|
static CFStringRef |
kCTFontEnabledAttribute()
[@defined] kCTFontEnabledAttribute
|
static CFStringRef |
kCTFontFamilyNameAttribute()
[@defined] kCTFontFamilyNameAttribute
|
static CFStringRef |
kCTFontFamilyNameKey()
[@defined] kCTFontFamilyNameKey
|
static CFStringRef |
kCTFontFeatureSampleTextKey()
[@defined] kCTFontFeatureSampleTextKey
|
static CFStringRef |
kCTFontFeaturesAttribute()
[@defined] kCTFontFeaturesAttribute
|
static CFStringRef |
kCTFontFeatureSelectorDefaultKey()
[@defined] kCTFontFeatureSelectorDefaultKey
|
static CFStringRef |
kCTFontFeatureSelectorIdentifierKey()
[@defined] kCTFontFeatureSelectorIdentifierKey
|
static CFStringRef |
kCTFontFeatureSelectorNameKey()
[@defined] kCTFontFeatureSelectorNameKey
|
static CFStringRef |
kCTFontFeatureSelectorSettingKey()
[@defined] kCTFontFeatureSelectorSettingKey
|
static CFStringRef |
kCTFontFeatureSettingsAttribute()
[@defined] kCTFontFeatureSettingsAttribute
|
static CFStringRef |
kCTFontFeatureTooltipTextKey()
[@defined] kCTFontFeatureTooltipTextKey
|
static CFStringRef |
kCTFontFeatureTypeExclusiveKey()
[@defined] kCTFontFeatureTypeExclusiveKey
|
static CFStringRef |
kCTFontFeatureTypeIdentifierKey()
[@defined] kCTFontFeatureTypeIdentifierKey
|
static CFStringRef |
kCTFontFeatureTypeNameKey()
[@defined] kCTFontFeatureTypeNameKey
|
static CFStringRef |
kCTFontFeatureTypeSelectorsKey()
[@defined] kCTFontFeatureTypeSelectorsKey
|
static CFStringRef |
kCTFontFixedAdvanceAttribute()
[@defined] kCTFontFixedAdvanceAttribute
|
static CFStringRef |
kCTFontFormatAttribute()
[@defined] kCTFontFormatAttribute
|
static CFStringRef |
kCTFontFullNameKey()
[@defined] kCTFontFullNameKey
|
static CFStringRef |
kCTFontLanguagesAttribute()
[@defined] kCTFontLanguagesAttribute
|
static CFStringRef |
kCTFontLicenseNameKey()
[@defined] kCTFontLicenseNameKey
|
static CFStringRef |
kCTFontLicenseURLNameKey()
[@defined] kCTFontLicenseURLNameKey
|
static CFStringRef |
kCTFontMacintoshEncodingsAttribute()
[@defined] kCTFontMacintoshEncodingsAttribute
|
static CFStringRef |
kCTFontManagerErrorDomain()
[@const] kCTFontManagerErrorDomain
|
static CFStringRef |
kCTFontManagerErrorFontAssetNameKey()
[@constant] kCTFontManagerErrorFontAssetNameKey
|
static CFStringRef |
kCTFontManagerErrorFontDescriptorsKey()
[@constant] kCTFontManagerErrorFontDescriptorsKey
|
static CFStringRef |
kCTFontManagerErrorFontURLsKey()
[@constant] kCTFontManagerErrorFontURLsKey
|
static CFStringRef |
kCTFontManagerRegisteredFontsChangedNotification()
[@constant] kCTFontManagerRegisteredFontsChangedNotification
|
static CFStringRef |
kCTFontManufacturerNameKey()
[@defined] kCTFontManufacturerNameKey
|
static CFStringRef |
kCTFontMatrixAttribute()
[@defined] kCTFontMatrixAttribute
|
static CFStringRef |
kCTFontNameAttribute()
[@defined] kCTFontNameAttribute
|
static CFStringRef |
kCTFontOpenTypeFeatureTag()
[@defined] kCTFontOpenTypeFeatureTag
|
static CFStringRef |
kCTFontOpenTypeFeatureValue()
[@defined] kCTFontOpenTypeFeatureValue
|
static CFStringRef |
kCTFontOpticalSizeAttribute()
[@defined] kCTFontOpticalSizeAttribute
|
static CFStringRef |
kCTFontOrientationAttribute()
[@defined] kCTFontOrientationAttribute
|
static CFStringRef |
kCTFontPostScriptCIDNameKey()
[@defined] kCTFontPostScriptCIDNameKey
|
static CFStringRef |
kCTFontPostScriptNameKey()
[@defined] kCTFontPostScriptNameKey
|
static CFStringRef |
kCTFontPriorityAttribute()
[@defined] kCTFontPriorityAttribute
|
static CFStringRef |
kCTFontRegistrationScopeAttribute()
[@defined] kCTFontRegistrationScopeAttribute
|
static CFStringRef |
kCTFontRegistrationUserInfoAttribute()
[@defined] kCTFontRegistrationUserInfoAttribute
|
static CFStringRef |
kCTFontSampleTextNameKey()
[@defined] kCTFontSampleTextNameKey
|
static CFStringRef |
kCTFontSizeAttribute()
[@defined] kCTFontSizeAttribute
|
static CFStringRef |
kCTFontSlantTrait()
[@defined] kCTFontSlantTrait
|
static CFStringRef |
kCTFontStyleNameAttribute()
[@defined] kCTFontStyleNameAttribute
|
static CFStringRef |
kCTFontStyleNameKey()
[@defined] kCTFontStyleNameKey
|
static CFStringRef |
kCTFontSubFamilyNameKey()
[@defined] kCTFontSubFamilyNameKey
|
static CFStringRef |
kCTFontSymbolicTrait()
[@defined] kCTFontSymbolicTrait
|
static CFStringRef |
kCTFontTrademarkNameKey()
[@defined] kCTFontTrademarkNameKey
|
static CFStringRef |
kCTFontTraitsAttribute()
[@defined] kCTFontTraitsAttribute
|
static CFStringRef |
kCTFontUniqueNameKey()
[@defined] kCTFontUniqueNameKey
|
static CFStringRef |
kCTFontURLAttribute()
[@defined] kCTFontURLAttribute
|
static CFStringRef |
kCTFontVariationAttribute()
[@defined] kCTFontVariationAttribute
|
static CFStringRef |
kCTFontVariationAxesAttribute()
[@defined] kCTFontVariationAxesAttribute
|
static CFStringRef |
kCTFontVariationAxisDefaultValueKey()
[@defined] kCTFontVariationAxisDefaultValueKey
|
static CFStringRef |
kCTFontVariationAxisHiddenKey()
[@defined] kCTFontVariationAxisHiddenKey
|
static CFStringRef |
kCTFontVariationAxisIdentifierKey()
[@defined] kCTFontVariationAxisIdentifierKey
|
static CFStringRef |
kCTFontVariationAxisMaximumValueKey()
[@defined] kCTFontVariationAxisMaximumValueKey
|
static CFStringRef |
kCTFontVariationAxisMinimumValueKey()
[@defined] kCTFontVariationAxisMinimumValueKey
|
static CFStringRef |
kCTFontVariationAxisNameKey()
[@defined] kCTFontVariationAxisNameKey
|
static CFStringRef |
kCTFontVendorURLNameKey()
[@defined] kCTFontVendorURLNameKey
|
static CFStringRef |
kCTFontVersionNameKey()
[@defined] kCTFontVersionNameKey
|
static CFStringRef |
kCTFontWeightTrait()
[@defined] kCTFontWeightTrait
|
static CFStringRef |
kCTFontWidthTrait()
[@defined] kCTFontWidthTrait
|
static CFStringRef |
kCTForegroundColorAttributeName()
[@const] kCTForegroundColorAttributeName
|
static CFStringRef |
kCTForegroundColorFromContextAttributeName()
[@const] kCTForegroundColorFromContextAttributeName
|
static CFStringRef |
kCTFrameClippingPathsAttributeName()
[@const] kCTFrameClippingPathsAttributeName
|
static CFStringRef |
kCTFramePathClippingPathAttributeName()
[@const] kCTFramePathClippingPathAttributeName
|
static CFStringRef |
kCTFramePathFillRuleAttributeName()
[@const] kCTFramePathFillRuleAttributeName
|
static CFStringRef |
kCTFramePathWidthAttributeName()
[@const] kCTFramePathWidthAttributeName
|
static CFStringRef |
kCTFrameProgressionAttributeName()
[@const] kCTFrameProgressionAttributeName
|
static CFStringRef |
kCTGlyphInfoAttributeName()
[@const] kCTGlyphInfoAttributeName
|
static CFStringRef |
kCTHorizontalInVerticalFormsAttributeName()
[@const] kCTHorizontalInVerticalFormsAttributeName
|
static CFStringRef |
kCTKernAttributeName()
[@const] kCTKernAttributeName
|
static CFStringRef |
kCTLanguageAttributeName()
[@const] kCTLanguageAttributeName
|
static CFStringRef |
kCTLigatureAttributeName()
[@const] kCTLigatureAttributeName
|
static CFStringRef |
kCTParagraphStyleAttributeName()
[@const] kCTParagraphStyleAttributeName
|
static CFStringRef |
kCTRubyAnnotationAttributeName()
[@const] kCTRubyAnnotationAttributeName
|
static CFStringRef |
kCTRubyAnnotationScaleToFitAttributeName()
[@const] kCTRubyAnnotationScaleToFitAttributeName
|
static CFStringRef |
kCTRubyAnnotationSizeFactorAttributeName()
[@const] kCTRubyAnnotationSizeFactorAttributeName
|
static CFStringRef |
kCTRunDelegateAttributeName()
[@const] kCTRunDelegateAttributeName
|
static CFStringRef |
kCTStrokeColorAttributeName()
[@const] kCTStrokeColorAttributeName
|
static CFStringRef |
kCTStrokeWidthAttributeName()
[@const] kCTStrokeWidthAttributeName
|
static CFStringRef |
kCTSuperscriptAttributeName()
[@const] kCTSuperscriptAttributeName
|
static CFStringRef |
kCTTabColumnTerminatorsAttributeName()
[@const] kCTTabColumnTerminatorsAttributeName
|
static CFStringRef |
kCTTrackingAttributeName()
[@const] kCTTrackingAttributeName
|
static CFStringRef |
kCTTypesetterOptionAllowUnboundedLayout()
[@const] kCTTypesetterOptionAllowUnboundedLayout
|
static CFStringRef |
kCTTypesetterOptionDisableBidiProcessing()
Deprecated.
|
static CFStringRef |
kCTTypesetterOptionForcedEmbeddingLevel()
[@const] kCTTypesetterOptionForcedEmbeddingLevel
|
static CFStringRef |
kCTUnderlineColorAttributeName()
[@const] kCTUnderlineColorAttributeName
|
static CFStringRef |
kCTUnderlineStyleAttributeName()
[@const] kCTUnderlineStyleAttributeName
|
static CFStringRef |
kCTVerticalFormsAttributeName()
[@const] kCTVerticalFormsAttributeName
|
static CFStringRef |
kCTWritingDirectionAttributeName()
[@const] kCTWritingDirectionAttributeName
|
public static long CTParagraphStyleGetTypeID()
Returns the CFType of the paragraph style object
public static CTParagraphStyleRef CTParagraphStyleCreate(CTParagraphStyleSetting settings, long settingCount)
Creates an immutable paragraph style.
Using this function is the easiest and most efficient way to create a paragraph style. Paragraph styles should be kept immutable for totally lock-free operation.
If an invalid paragraph style setting specifier is passed into the "settings" parameter, nothing bad will happen but just don't expect to be able to query for this value. This is to allow backwards compatibility with style setting specifiers that may be introduced in future versions.
settings - The settings that you wish to pre-load the paragraph style
with. If you wish to specify the default set of settings,
then this parameter may be set to NULL.settingCount - The number of settings that you have specified in the
"settings" parameter. This must be greater than or equal
to zero.public static CTParagraphStyleRef CTParagraphStyleCreateCopy(CTParagraphStyleRef paragraphStyle)
Creates an immutable copy of a paragraph style.
paragraphStyle - The style that you wish to copy.public static boolean CTParagraphStyleGetValueForSpecifier(CTParagraphStyleRef paragraphStyle, int spec, long valueBufferSize, org.moe.natj.general.ptr.VoidPtr valueBuffer)
Obtains the current value for a single setting specifier.
This function will return the current value of the specifier whether or not the user had actually set it. If the user has not set it, this function will return the default value.
If an invalid paragraph style setting specifier is passed into the "spec" parameter, nothing bad will happen and the buffer value will simply be zeroed out. This is to allow backwards compatibility with style setting specifier that may be introduced in future versions.
paragraphStyle - The paragraph style that you wish to get the value from.spec - The setting specifier that you want to get the value for.valueBufferSize - The size of the buffer pointed to by the "valueBuffer" parameter.
This value must be at least as large as the size the required by
the CTParagraphSpecifier value set in the "spec" parameter.valueBuffer - The buffer where the requested setting value will be written
upon successful completion. The buffer's size needs to be at least
as large as the value passed into "valueBufferSize".public static long CTFontDescriptorGetTypeID()
Returns the type identifier for Core Text font descriptor references.
public static CTFontDescriptorRef CTFontDescriptorCreateWithNameAndSize(CFStringRef name, double size)
Creates a new font descriptor with the provided PostScript name and size.
If you are trying to create a system UI font descriptor (with name beginning with a "."), you should create a font with CTFontCreateUIFontForLanguage() or appropriate AppKit/UIKit APIs instead, then use CTFontCopyFontDescriptor() to get its font descriptor.
name - The PostScript name to be used for the font descriptor as a CFStringRef. Any font name beginning with a "." is reserved for the system and should not be used here.size - The point size. If 0.0, the kCTFontSizeAttribute will be omitted from the font descriptor.public static CTFontDescriptorRef CTFontDescriptorCreateWithAttributes(CFDictionaryRef attributes)
Creates a new font descriptor reference from a dictionary of attributes.
attributes - A CFDictionaryRef of arbitrary attributes.public static CTFontDescriptorRef CTFontDescriptorCreateCopyWithAttributes(CTFontDescriptorRef original, CFDictionaryRef attributes)
Creates a copy of the original font descriptor with new attributes.
original - The original font descriptor reference.attributes - A CFDictionaryRef of arbitrary attributes.Starting with macOS 10.12 and iOS 10.0, setting the value of kCTFontFeatureSettingsAttribute to kCFNull will clear the feature settings of the original font descriptor. Setting the value of any individual feature settings pair in the kCTFontFeatureSettingsAttribute value array to kCFNull will clear that feature setting alone. For example, an element like @{ (id)kCTFontFeatureTypeIdentifierKey: @(kLigaturesType), (id)kCTFontFeatureSelectorIdentifierKey: (id)kCFNull } means clear the kLigatureType feature set in the original font descriptor. An element like @[ @"liga", (id)kCFNull ] will have the same effect.
public static CTFontDescriptorRef CTFontDescriptorCreateCopyWithFamily(CTFontDescriptorRef original, CFStringRef family)
Returns a new font descriptor in the specified family based on the traits of the original descriptor.
original - The original font descriptor reference.family - The name of the desired family.public static CTFontDescriptorRef CTFontDescriptorCreateCopyWithSymbolicTraits(CTFontDescriptorRef original, int symTraitValue, int symTraitMask)
Returns a new font descriptor based on the original descriptor having the specified symbolic traits.
original - The original font descriptor reference.symTraitValue - The value of the symbolic traits. This bitfield is used to indicate the desired value for the traits specified by the symTraitMask parameter. Used in conjunction, they can allow for trait removal as well as addition.symTraitMask - The mask bits of the symbolic traits. This bitfield is used to indicate the traits that should be changed.public static CTFontDescriptorRef CTFontDescriptorCreateCopyWithVariation(CTFontDescriptorRef original, CFNumberRef variationIdentifier, double variationValue)
Creates a copy of the original font descriptor with a new variation instance.
original - The original font descriptor reference.variationIdentifier - The variation axis identifier. This is the four character code of the variation axis as a CFNumberRef.variationValue - The value corresponding with the variation instance.public static CTFontDescriptorRef CTFontDescriptorCreateCopyWithFeature(CTFontDescriptorRef original, CFNumberRef featureTypeIdentifier, CFNumberRef featureSelectorIdentifier)
Copies a font descriptor with new feature setting.
This is a convenience method to more easily toggle the state of individual features.
original - The original font descriptor reference.featureTypeIdentifier - The feature type identifier.featureSelectorIdentifier - The feature selector identifier.public static CFArrayRef CTFontDescriptorCreateMatchingFontDescriptors(CTFontDescriptorRef descriptor, CFSetRef mandatoryAttributes)
Returns an array of font normalized font descriptors matching the provided descriptor.
descriptor - The font descriptor reference.mandatoryAttributes - A set of attribute keys which are required to be identically matched in any returned font descriptors. Optional.public static CTFontDescriptorRef CTFontDescriptorCreateMatchingFontDescriptor(CTFontDescriptorRef descriptor, CFSetRef mandatoryAttributes)
Returns an the single preferred matching font descriptor based on the original descriptor and system precedence.
descriptor - The font descriptor reference.mandatoryAttributes - A set of attribute keys which are required to be identically matched in any returned font descriptors. Optional.public static boolean CTFontDescriptorMatchFontDescriptorsWithProgressHandler(CFArrayRef descriptors, CFSetRef mandatoryAttributes, CoreText.Block_CTFontDescriptorMatchFontDescriptorsWithProgressHandler progressBlock)
descriptors - An array of descriptors to process.mandatoryAttributes - progressBlock - Callback block to indicate the progress.
Return true to continue, and return false to cancel the process.
This block is called on a private serial queue on OS X 10.15, iOS 13, and later.public static CFDictionaryRef CTFontDescriptorCopyAttributes(CTFontDescriptorRef descriptor)
Returns the attributes dictionary of the font descriptor.
descriptor - The font descriptor reference.public static org.moe.natj.general.ptr.ConstVoidPtr CTFontDescriptorCopyAttribute(CTFontDescriptorRef descriptor, CFStringRef attribute)
Returns the value associated with an arbitrary attribute.
descriptor - The font descriptor.attribute - The requested attribute.public static org.moe.natj.general.ptr.ConstVoidPtr CTFontDescriptorCopyLocalizedAttribute(CTFontDescriptorRef descriptor, CFStringRef attribute, org.moe.natj.general.ptr.Ptr<CFStringRef> language)
Returns a localized value for the requested attribute if available.
This function returns a localized attribute based on the global language list. If localization is not possible for the attribute the behavior matches CTFontDescriptorCopyAttribute(). Generally, localization of attributes is only applicable to name attributes of a normalized font descriptor.
descriptor - The font descriptor reference.attribute - The requested font attribute.language - If non-NULL, this will be receive a retained reference to the matched language. The language identifier will conform to UTS #35.
If CoreText can supply its own localized string where the font cannot, this value will be NULL.public static long CTFontGetTypeID()
Returns the type identifier for Core Text font references.
public static CTFontRef CTFontCreateWithName(CFStringRef name, double size, CGAffineTransform matrix)
Returns a new font reference for the given name.
This function uses font descriptor matching so only registered fonts can be returned; see CTFontManager.h for more information. If you are trying to create a system UI font (with name beginning with a "."), you should use CTFontCreateUIFontForLanguage() or appropriate AppKit/UIKit APIs instead.
name - The font name for which you wish to create a new font reference. A valid PostScript name is preferred, although other font name types will be matched in a fallback manner. Any font name beginning with a "." is reserved for the system and should not be used here.size - The point size for the font reference. If 0.0 is specified, the default font size of 12.0 will be used.matrix - The transformation matrix for the font. If unspecified, the identity matrix will be used. Optional.public static CTFontRef CTFontCreateWithFontDescriptor(CTFontDescriptorRef descriptor, double size, CGAffineTransform matrix)
Returns a new font reference that best matches the font descriptor.
descriptor - A font descriptor containing attributes that specify the requested font.size - The point size for the font reference. If 0.0 is specified, the default font size of 12.0 will be used.matrix - The transformation matrix for the font. If unspecified, the identity matrix will be used. Optional.public static CTFontRef CTFontCreateWithNameAndOptions(CFStringRef name, double size, CGAffineTransform matrix, long options)
Returns a new font reference for the given name.
This function uses font descriptor matching so only registered fonts can be returned; see CTFontManager.h for more information. If you are trying to create a system UI font (with name beginning with a "."), you should use CTFontCreateUIFontForLanguage() or appropriate AppKit/UIKit APIs instead.
name - The font name for which you wish to create a new font reference. A valid PostScript name is preferred, although other font name types will be matched in a fallback manner. Any font name beginning with a "." is reserved for the system and should not be used here.size - The point size for the font reference. If 0.0 is specified, the default font size of 12.0 will be used.matrix - The transformation matrix for the font. If unspecified, the identity matrix will be used. Optional.options - Options flags.public static CTFontRef CTFontCreateWithFontDescriptorAndOptions(CTFontDescriptorRef descriptor, double size, CGAffineTransform matrix, long options)
Returns a new font reference that best matches the font descriptor.
descriptor - A font descriptor containing attributes that specify the requested font.size - The point size for the font reference. If 0.0 is specified, the default font size of 12.0 will be used.matrix - The transformation matrix for the font. If unspecified, the identity matrix will be used. Optional.options - Options flags.public static CTFontRef CTFontCreateUIFontForLanguage(int uiType, double size, CFStringRef language)
Returns the special UI font for the given language and UI type.
uiType - A uiType constant specifying the intended UI use for the requested font reference.size - The point size for the font reference. If 0.0 is specified, the default size for the requested uiType is used.language - Language identifier to select a font for a particular localization. If unspecified, the current system language is used. The format of the language identifier should conform to UTS #35.public static CTFontRef CTFontCreateCopyWithAttributes(CTFontRef font, double size, CGAffineTransform matrix, CTFontDescriptorRef attributes)
Returns a new font with additional attributes based on the original font.
This function provides a mechanism to quickly change attributes on a given font reference in response to user actions. For instance, the size can be changed in response to a user manipulating a size slider.
font - Original font reference to base new font on.size - The point size for the font reference. If 0.0 is specified, the original font's size will be preserved.matrix - The transformation matrix for the font. If unspecified, the original font matrix will be preserved. Optional.attributes - A font descriptor containing additional attributes that the new font should contain.public static CTFontRef CTFontCreateCopyWithSymbolicTraits(CTFontRef font, double size, CGAffineTransform matrix, int symTraitValue, int symTraitMask)
Returns a new font based on the original font with the specified symbolic traits.
font - Original font reference on which to base the new font.size - The point size for the font reference. If 0.0 is specified, the original font's size will be preserved.matrix - The transformation matrix for the font. If unspecified, the original font matrix will be preserved. Optional.symTraitValue - The value of the symbolic traits. This bitfield is used to indicate the desired value for the traits specified by the symTraitMask parameter. Used in conjunction, they can allow for trait removal as well as addition.symTraitMask - The mask bits of the symbolic traits. This bitfield is used to indicate the traits that should be changed.public static CTFontRef CTFontCreateCopyWithFamily(CTFontRef font, double size, CGAffineTransform matrix, CFStringRef family)
Returns a new font in the specified family based on the traits of the original font.
font - Original font reference to base new font on.size - The point size for the font reference. If 0.0 is specified, the original font's size will be preserved.matrix - The transformation matrix for the font. If unspecified, the original font matrix will be preserved. Optional.family - The name of the desired family.public static CTFontRef CTFontCreateForString(CTFontRef currentFont, CFStringRef string, CFRange range)
Returns a new font reference that can best map the given string range based on the current font.
This function is to be used when the current font does not cover the given range of the string. The current font itself will not be returned, but preference is given to fonts in its cascade list.
currentFont - The current font that contains a valid cascade list.string - A unicode string containing characters that cannot be encoded by the current font.range - A CFRange specifying the range of the string that needs to be mapped.CTFontCopyCharacterSet,
CTFontGetGlyphsForCharacters,
kCTFontCascadeListAttributepublic static CTFontDescriptorRef CTFontCopyFontDescriptor(CTFontRef font)
Returns the normalized font descriptors for the given font reference.
font - The font reference.public static org.moe.natj.general.ptr.ConstVoidPtr CTFontCopyAttribute(CTFontRef font, CFStringRef attribute)
Returns the value associated with an arbitrary attribute.
font - The font reference.attribute - The requested attribute.public static double CTFontGetSize(CTFontRef font)
Returns the point size of the font reference.
font - The font reference.public static CGAffineTransform CTFontGetMatrix(CTFontRef font)
Returns the transformation matrix of the font.
font - The font reference.public static int CTFontGetSymbolicTraits(CTFontRef font)
Returns the symbolic font traits.
font - The font reference.public static CFDictionaryRef CTFontCopyTraits(CTFontRef font)
Returns the font traits dictionary.
font - The font reference.public static CFStringRef CTFontCopyPostScriptName(CTFontRef font)
Returns the PostScript name.
font - The font reference.public static CFStringRef CTFontCopyFamilyName(CTFontRef font)
Returns the family name.
font - The font reference.public static CFStringRef CTFontCopyFullName(CTFontRef font)
Returns the display name.
font - The font reference.public static CFStringRef CTFontCopyDisplayName(CTFontRef font)
Returns the display name.
font - The font reference.public static CFStringRef CTFontCopyName(CTFontRef font, CFStringRef nameKey)
Returns a reference to the requested name.
font - The font reference.nameKey - The name specifier. See name specifier constants.public static CFStringRef CTFontCopyLocalizedName(CTFontRef font, CFStringRef nameKey, org.moe.natj.general.ptr.Ptr<CFStringRef> actualLanguage)
Returns a reference to a localized font name.
font - The font reference.nameKey - The name specifier. See name specifier constants.actualLanguage - Pointer to a CFStringRef to receive the language identifier of the returned name string. The format of the language identifier will conform to UTS #35.
If CoreText can supply its own localized string where the font cannot, this value will be NULL.public static CFCharacterSetRef CTFontCopyCharacterSet(CTFontRef font)
Returns the Unicode character set of the font.
font - The font reference.public static int CTFontGetStringEncoding(CTFontRef font)
Returns the best string encoding for legacy format support.
font - The font reference.public static CFArrayRef CTFontCopySupportedLanguages(CTFontRef font)
Returns an array of languages supported by the font.
font - The font reference.public static boolean CTFontGetGlyphsForCharacters(CTFontRef font, org.moe.natj.general.ptr.ConstCharPtr characters, org.moe.natj.general.ptr.CharPtr glyphs, long count)
Performs basic character-to-glyph mapping.
This function only provides the nominal mapping as specified by the font's Unicode cmap (or equivalent); such mapping does not constitute proper Unicode layout: it is the caller's responsibility to handle the Unicode properties of the characters.
font - The font reference.characters - An array of characters (UTF-16 code units). Non-BMP characters must be encoded as surrogate pairs.glyphs - A pointer to a buffer to receive the glyphs. Glyphs for non-BMP characters are sparse: the first glyph corresponds to the full character and the second glyph will be 0.count - The capacity of both the characters and glyphs arrays.CTFontCopyCharacterSetpublic static double CTFontGetAscent(CTFontRef font)
Returns the scaled font ascent metric.
font - The font reference.public static double CTFontGetDescent(CTFontRef font)
Returns the scaled font descent metric.
font - The font reference.public static double CTFontGetLeading(CTFontRef font)
Returns the scaled font leading metric.
font - The font reference.public static int CTFontGetUnitsPerEm(CTFontRef font)
Returns the units per em metric.
font - The font reference.public static long CTFontGetGlyphCount(CTFontRef font)
Returns the number of glyphs.
font - The font reference.public static CGRect CTFontGetBoundingBox(CTFontRef font)
Returns the scaled bounding box.
font - The font reference.public static double CTFontGetUnderlinePosition(CTFontRef font)
Returns the scaled underline position.
font - The font reference.public static double CTFontGetUnderlineThickness(CTFontRef font)
Returns the scaled underline thickness metric.
font - The font reference.public static double CTFontGetSlantAngle(CTFontRef font)
Returns the slant angle of the font.
font - The font reference.public static double CTFontGetCapHeight(CTFontRef font)
Returns the cap height metric.
font - The font reference.public static double CTFontGetXHeight(CTFontRef font)
Returns the X height metric.
font - The font reference.public static char CTFontGetGlyphWithName(CTFontRef font, CFStringRef glyphName)
Returns the CGGlyph for the specified glyph name.
font - The font reference.glyphName - The glyph name as a CFString.public static CGRect CTFontGetBoundingRectsForGlyphs(CTFontRef font, int orientation, org.moe.natj.general.ptr.ConstCharPtr glyphs, CGRect boundingRects, long count)
Calculates the bounding rects for an array of glyphs and returns the overall bounding rect for the run.
font - The font reference.orientation - The intended drawing orientation of the glyphs. Used to determined which glyph metrics to return.glyphs - An array of count number of glyphs.boundingRects - An array of count number of CGRects to receive the computed glyph rects. Can be NULL, in which case only the overall bounding rect is calculated.count - The capacity of the glyphs and boundingRects buffers.public static CGRect CTFontGetOpticalBoundsForGlyphs(CTFontRef font, org.moe.natj.general.ptr.ConstCharPtr glyphs, CGRect boundingRects, long count, long options)
Calculates the optical bounding rects for an array of glyphs and returns the overall optical bounding rect for the run.
Fonts may specify the optical edges of glyphs that can be used to make the edges of lines of text line up in a more visually pleasing way. This function returns bounding rects corresponding to this information if present in a font, otherwise it returns typographic bounding rects (composed of the font's ascent and descent and a glyph's advance width).
font - The font reference.glyphs - An array of count number of glyphs.boundingRects - An array of count number of CGRects to receive the computed glyph rects. Can be NULL, in which case only the overall bounding rect is calculated.count - The capacity of the glyphs and boundingRects buffers.options - Reserved, set to zero.public static double CTFontGetAdvancesForGlyphs(CTFontRef font, int orientation, org.moe.natj.general.ptr.ConstCharPtr glyphs, CGSize advances, long count)
Calculates the advances for an array of glyphs and returns the summed advance.
font - The font reference.orientation - The intended drawing orientation of the glyphs. Used to determined which glyph metrics to return.glyphs - An array of count number of glyphs.advances - An array of count number of CGSize to receive the computed glyph advances. Can be NULL, in which case only the overall advance is calculated.count - The capacity of the glyphs and advances buffers.public static void CTFontGetVerticalTranslationsForGlyphs(CTFontRef font, org.moe.natj.general.ptr.ConstCharPtr glyphs, CGSize translations, long count)
Calculates the offset from the default (horizontal) origin to the vertical origin for an array of glyphs.
font - The font reference.glyphs - An array of count number of glyphs.translations - An array of count number of CGSize to receive the computed origin offsets.count - The capacity of the glyphs and translations buffers.public static CGPathRef CTFontCreatePathForGlyph(CTFontRef font, char glyph, CGAffineTransform matrix)
Creates a path for the specified glyph.
Creates a path from the outlines of the glyph for the specified font. The path will reflect the font point size, matrix, and transform parameter, in that order. The transform parameter will most commonly be used to provide a translation to the desired glyph origin.
font - The font reference.glyph - The glyph.matrix - An affine transform applied to the path. Can be NULL, in which case CGAffineTransformIdentity will be used.public static CFArrayRef CTFontCopyVariationAxes(CTFontRef font)
Returns an array of variation axis dictionaries.
font - The font reference.public static CFDictionaryRef CTFontCopyVariation(CTFontRef font)
Returns a variation dictionary.
This function describes the current configuration of a variation font: a dictionary of number values with variation identifier number keys. As of macOS 10.12 and iOS 10.0, only non-default values (as determined by the variation axis) are returned.
font - The font reference.kCTFontVariationAxisIdentifierKey,
kCTFontVariationAxisDefaultValueKeypublic static CFArrayRef CTFontCopyFeatures(CTFontRef font)
Returns an array of font features
font - The font reference.public static CFArrayRef CTFontCopyFeatureSettings(CTFontRef font)
Returns an array of font feature setting tuples
A setting tuple is a dictionary of a kCTFontFeatureTypeIdentifierKey key-value pair and a kCTFontFeatureSelectorIdentifierKey key-value pair. Each tuple corresponds to an enabled non-default setting. It is the caller's responsibility to handle exclusive and non-exclusive settings as necessary.
font - The font reference.public static CGFontRef CTFontCopyGraphicsFont(CTFontRef font, org.moe.natj.general.ptr.Ptr<CTFontDescriptorRef> attributes)
Returns a CGFontRef and attributes.
font - The font reference.attributes - A pointer to a CTFontDescriptorRef to receive a font descriptor containing additional attributes. Can be NULL. Must be released by caller.public static CTFontRef CTFontCreateWithGraphicsFont(CGFontRef graphicsFont, double size, CGAffineTransform matrix, CTFontDescriptorRef attributes)
Creates a new font reference from a CGFontRef.
graphicsFont - A valid CGFontRef.size - The point size for the font reference. If 0.0 is specified, the default font size of 12.0 will be used.matrix - The transformation matrix for the font. If unspecified, the identity matrix will be used. Optional.attributes - A CTFontDescriptorRef containing additional attributes that should be matched. Optional.public static CFArrayRef CTFontCopyAvailableTables(CTFontRef font, int options)
Returns an array of font table tags.
font - The font reference.options - The options used when copying font tables.CTFontTableTag tag = (CTFontTableTag)(uintptr_t)CFArrayGetValueAtIndex(tags, index);public static CFDataRef CTFontCopyTable(CTFontRef font, int table, int options)
Returns a reference to the font table data.
font - The font reference.table - The font table identifier as a CTFontTableTag.options - The options used when copying font table.public static void CTFontDrawGlyphs(CTFontRef font, org.moe.natj.general.ptr.ConstCharPtr glyphs, CGPoint positions, long count, CGContextRef context)
Renders the given glyphs from the CTFont at the given positions in the CGContext.
This function will modify the CGContext's font, text size, and text matrix if specified in the CTFont. These attributes will not be restored. The given glyphs should be the result of proper Unicode text layout operations (such as CTLine). Results from CTFontGetGlyphsForCharacters (or similar APIs) do not perform any Unicode text layout.
font - The font to render glyphs from. If the font has a size or matrix attribute, the CGContext will be set with these values.glyphs - The glyphs to be rendered. See above discussion of how the glyphs should be derived.positions - The positions (origins) for each glyph. The positions are in user space. The number of positions passed in must be equivalent to the number of glyphs.count - The number of glyphs to be rendered from the glyphs array.context - CGContext used to render the glyphs.public static long CTFontGetLigatureCaretPositions(CTFontRef font, char glyph, org.moe.natj.general.ptr.NFloatPtr positions, long maxPositions)
Returns caret positions within a glyph.
This function is used to obtain caret positions for a specific glyph. The return value is the max number of positions possible, and the function will populate the caller's positions buffer with available positions if possible. This function may not be able to produce positions if the font does not have the appropriate data, in which case it will return 0.
font - The font reference.glyph - The glyph.positions - A buffer of at least maxPositions to receive the ligature caret positions for
the glyph.maxPositions - The maximum number of positions to return.public static CFArrayRef CTFontCopyDefaultCascadeListForLanguages(CTFontRef font, CFArrayRef languagePrefList)
Return an ordered list of CTFontDescriptorRef's for font fallback derived from the system default fallback region according to the given language preferences. The style of the given is also matched as well as the weight and width of the font is not one of the system UI font, otherwise the UI font fallback is applied.
font - The font reference.languagePrefList - The language preference list - ordered array of CFStringRef's of ISO language codes.public static long CTFontCollectionGetTypeID()
Returns the type identifier for Core Text font collection references.
public static CTFontCollectionRef CTFontCollectionCreateFromAvailableFonts(CFDictionaryRef options)
Returns a new font collection matching all available fonts.
options - The options dictionary. See constant option keys.public static CTFontCollectionRef CTFontCollectionCreateWithFontDescriptors(CFArrayRef queryDescriptors, CFDictionaryRef options)
Returns a new collection based on the array of font descriptors.
queryDescriptors - An array of font descriptors to use for matching. May be NULL, in which case the matching descriptors will be NULL.options - The options dictionary. See constant option keys.public static CTFontCollectionRef CTFontCollectionCreateCopyWithFontDescriptors(CTFontCollectionRef original, CFArrayRef queryDescriptors, CFDictionaryRef options)
Returns a copy of the original collection augmented with the new font descriptors.
original - The original font collection reference.queryDescriptors - An array of font descriptors to augment those of the original collection.options - The options dictionary. See constant option keys.public static CFArrayRef CTFontCollectionCreateMatchingFontDescriptors(CTFontCollectionRef collection)
Returns an array of font descriptors matching the collection.
collection - The font collection reference.public static CFArrayRef CTFontCollectionCreateMatchingFontDescriptorsSortedWithCallback(CTFontCollectionRef collection, CoreText.Function_CTFontCollectionCreateMatchingFontDescriptorsSortedWithCallback sortCallback, org.moe.natj.general.ptr.VoidPtr refCon)
Returns the array of matching font descriptors sorted with the callback function.
collection - The collection reference.sortCallback - The sorting callback function that defines the sort order.refCon - Pointer to client data define context for the callback.public static CFArrayRef CTFontManagerCopyAvailablePostScriptNames()
Returns an array of unique PostScript font names.
public static CFArrayRef CTFontManagerCopyAvailableFontFamilyNames()
Returns an array of visible font family names sorted for UI display.
public static CFArrayRef CTFontManagerCreateFontDescriptorsFromURL(CFURLRef fileURL)
Returns an array of font descriptors representing each of the fonts in the specified URL. Note: these font descriptors are not available through font descriptor matching.
fileURL - A file system URL referencing a valid font file.public static CTFontDescriptorRef CTFontManagerCreateFontDescriptorFromData(CFDataRef data)
Returns a font descriptor representing the font in the supplied data. Note: the font descriptor is not available through font descriptor matching.
If the data contains a font collection (TTC or OTC), only the first font in the collection will be returned.
data - A CFData containing font data.public static boolean CTFontManagerRegisterFontsForURL(CFURLRef fontURL, int scope, org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
Registers fonts from the specified font URL with the font manager. Registered fonts participate in font descriptor matching.
fontURL - A file URL for the font or collection (TTC or OTC) to be registered. Once fonts have been registered from a file, it shouldn't be moved or renamed.scope - Scope constant defining the availability and lifetime of the registration. See scope constants for more details.error - Pointer to receive CFError in the case of failed registration.public static boolean CTFontManagerUnregisterFontsForURL(CFURLRef fontURL, int scope, org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
Unregisters fonts from the specified font URL with the font manager. Unregistered fonts do not participate in font descriptor matching. iOS note: only fonts registered with CTFontManagerRegisterFontsForURL or CTFontManagerRegisterFontsForURLs can be unregistered with this API.
fontURL - Font URL.scope - Scope constant defining the availability and lifetime of the registration. Should match the scope the fonts are registered in. See scope constants for more details.error - Pointer to receive CFError in the case of failed unregistration.public static boolean CTFontManagerRegisterGraphicsFont(CGFontRef font, org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
Registers the specified graphics font with the font manager. Registered fonts participate in font descriptor matching. Attempts to register a font that is either already registered or contains the same PostScript name of an already registered font will fail. This functionality is useful for fonts that may be embedded in documents or present/constructed in memory. A graphics font is obtained by calling CGFontCreateWithDataProvider. Fonts that are backed by files should be registered using CTFontManagerRegisterFontsForURL.
font - Graphics font to be registered.error - Pointer to receive CFError in the case of failed registration.public static boolean CTFontManagerUnregisterGraphicsFont(CGFontRef font, org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
Unregisters the specified graphics font with the font manager. Unregistered fonts do not participate in font descriptor matching.
font - Graphics font to be unregistered.error - Pointer to receive CFError in the case of failed unregistration.public static boolean CTFontManagerRegisterFontsForURLs(CFArrayRef fontURLs, int scope, org.moe.natj.general.ptr.Ptr<CFArrayRef> errors)
Registers fonts from the specified font URLs with the font manager. Registered fonts are discoverable through font descriptor matching.
fontURLs - An array of file URLs for the fonts or collections (TTC or OTC) to be registered. Once fonts have been registered from a file, it shouldn't be moved or renamed.scope - Scope constant defining the availability and lifetime of the registration. See scope constants for more details.errors - Pointer to CFArrayRef to receive array of CFError references. Each error will contain a CFArray of font URLs corresponding to kCTFontManagerErrorFontURLsKey. These URLs represent the font files that caused the error, and were not successfully registered. Must be released by caller. Can be NULL.public static boolean CTFontManagerUnregisterFontsForURLs(CFArrayRef fontURLs, int scope, org.moe.natj.general.ptr.Ptr<CFArrayRef> errors)
Unregisters fonts from the specified font URLs with the font manager. Unregistered fonts do not participate in font descriptor matching. iOS note: only fonts registered with CTFontManagerRegisterFontsForURL or CTFontManagerRegisterFontsForURLs can be unregistered with this API.
fontURLs - Array of font URLs.scope - Scope constant defining the availability and lifetime of the registration. Should match the scope the fonts are registered in. See scope constants for more details.errors - Pointer to CFArrayRef to receive array of CFError references. Each error will contain a CFArray of font URLs corresponding to kCTFontManagerErrorFontURLsKey. These URLs represent the font files that caused the error, and were not successfully unregistered. Must be released by caller. Can be NULL.public static long CTFrameGetTypeID()
Returns the CFType of the frame object
public static CFRange CTFrameGetStringRange(CTFrameRef frame)
Returns the range of characters that were originally requested to fill the frame.
frame - The frame that you want to get the character range from.public static CFRange CTFrameGetVisibleStringRange(CTFrameRef frame)
Returns the range of characters that actually fit in the frame.
This can be used to chain frames, as it returns the range of characters that can be seen in the frame. The next frame would start where this frame ends.
frame - The frame that you want to get the visible character range
from.public static CGPathRef CTFrameGetPath(CTFrameRef frame)
Returns the path used to create the frame.
frame - The frame that you want to obtain the path from.public static CFDictionaryRef CTFrameGetFrameAttributes(CTFrameRef frame)
Returns the frame attributes used to create the frame.
It is possible to create a frame with an attributes dictionary in order to control various aspects of the framing process. These attributes are different from the ones that are used to create an attributed string.
frame - The frame that you want to obtain the frame attributes from.public static CFArrayRef CTFrameGetLines(CTFrameRef frame)
Returns an array of lines that make up the frame.
This function will return an array of CTLine objects that are stored in the frame. These line objects can be accessed and manipulated in any way that normal line objects can be. It is possible that an empty frame exists. That is, a frame in which no lines exist. In this case, the returned array will have 0 entries.
frame - The frame that you want to obtain the line array from.public static void CTFrameGetLineOrigins(CTFrameRef frame, CFRange range, CGPoint origins)
Copies a range of line origins for a frame.
This function will copy a range of CGPoint structures. Each CGPoint is the origin of the corresponding line in the array of lines returned by CTFrameGetLines, relative to the origin of the frame's path. The maximum number of line origins returned by this function is the count of the array of lines.
frame - The frame that you want to obtain the line origin array from.range - The range of line origins you wish to copy. If the length of the
range is set to 0, then the copy operation will continue from
the range's start index to the last line origin.origins - The buffer to which the origins will be copied. The buffer must
have at least as many elements as specified by range's length.
When using the origins to calculate measurements for a frame's
contents, remember that line origins do not always correspond to
line metrics; paragraph style settings can affect line origins,
for one. The overall typographic bounds of a frame may generally
be calculated as the difference between the top of the frame and
the descent of the last line. This will obviously exclude any
spacing following the last line, but such spacing has no effect
on framesetting in the first place.public static void CTFrameDraw(CTFrameRef frame, CGContextRef context)
Draws an entire frame to a context.
This function will draw an entire frame to the context. Note that this call may leave the context in any state and does not flush it after the draw operation.
If both the frame and the context are valid, the frame will be drawn in the context.
frame - The frame that you want to draw.context - The context to draw the frame to.public static long CTLineGetTypeID()
Returns the CFType of the line object
public static CTLineRef CTLineCreateWithAttributedString(CFAttributedStringRef attrString)
Creates a single immutable line object directly from an attributed string.
This will allow clients who need very simple line generation to create a line without needing to create a typesetter object. The typesetting will be done under the hood. Without a typesetter object, the line cannot be properly broken. However, for simple things like text labels and other things, this is not an issue.
attrString - The attributed string which the line will be created for.public static CTLineRef CTLineCreateTruncatedLine(CTLineRef line, double width, int truncationType, CTLineRef truncationToken)
Creates a truncated line from an existing line.
line - The line that you want to create a truncated line for.width - The width at which truncation will begin. The line will be
truncated if its width is greater than the width passed in this.truncationType - The type of truncation to perform if needed.truncationToken - This token will be added to the point where truncation took place
to indicate that the line was truncated. Usually, the truncation
token is the ellipsis character (U+2026). If this parameter is
set to NULL, then no truncation token is used, and the line is
simply cut off. The line specified in truncationToken should have
a width less than the width specified by the width parameter. If
the width of the line specified in truncationToken is greater,
this function will return NULL if truncation is needed.public static CTLineRef CTLineCreateJustifiedLine(CTLineRef line, double justificationFactor, double justificationWidth)
Creates a justified line from an existing line.
line - The line that you want to create a justified line for.justificationFactor - Allows for full or partial justification. When set to 1.0 or
greater indicates, full justification will be performed. If less
than 1.0, varying degrees of partial justification will be
performed. If set to 0 or less, then no justification will be
performed.justificationWidth - The width to which the resultant line will be justified. If
justificationWidth is less than the actual width of the line,
then negative justification will be performed ("text squishing").public static long CTLineGetGlyphCount(CTLineRef line)
Returns the total glyph count for the line object.
The total glyph count is equal to the sum of all of the glyphs in the glyph runs forming the line.
line - The line that you want to obtain the glyph count for.public static CFArrayRef CTLineGetGlyphRuns(CTLineRef line)
Returns the array of glyph runs that make up the line object.
line - The line that you want to obtain the glyph run array for.public static CFRange CTLineGetStringRange(CTLineRef line)
Gets the range of characters that originally spawned the glyphs in the line.
line - The line that you want to obtain the string range from.public static double CTLineGetPenOffsetForFlush(CTLineRef line, double flushFactor, double flushWidth)
Gets the pen offset required to draw flush text.
line - The line that you want to obtain a flush position from.flushFactor - Specifies what kind of flushness you want. A flushFactor of 0 or
less indicates left flush. A flushFactor of 1.0 or more indicates
right flush. Flush factors between 0 and 1.0 indicate varying
degrees of center flush, with a value of 0.5 being totally center
flush.flushWidth - Specifies the width that the flushness operation should apply to.public static void CTLineDraw(CTLineRef line, CGContextRef context)
Draws a line.
This is a convenience call, since the line could be drawn run-by-run by getting the glyph runs and accessing the glyphs out of them. This call may leave the graphics context in any state and does not flush the context after drawing. This call also expects a text matrix with `y` values increasing from bottom to top; a flipped text matrix may result in misplaced diacritics.
line - The line that you want to draw.context - The context to which the line will be drawn.public static double CTLineGetTypographicBounds(CTLineRef line, org.moe.natj.general.ptr.NFloatPtr ascent, org.moe.natj.general.ptr.NFloatPtr descent, org.moe.natj.general.ptr.NFloatPtr leading)
Calculates the typographic bounds for a line.
A line's typographic width is the distance to the rightmost glyph advance width edge. Note that this distance includes trailing whitespace glyphs.
line - The line that you want to calculate the typographic bounds for.ascent - Upon return, this parameter will contain the ascent of the line.
This may be set to NULL if not needed.descent - Upon return, this parameter will contain the descent of the line.
This may be set to NULL if not needed.leading - Upon return, this parameter will contain the leading of the line.
This may be set to NULL if not needed.CTLineGetTrailingWhitespaceWidthpublic static CGRect CTLineGetBoundsWithOptions(CTLineRef line, long options)
Calculates the bounds for a line.
line - The line that you want to calculate the bounds for.options - Desired options or 0 if none.public static double CTLineGetTrailingWhitespaceWidth(CTLineRef line)
Calculates the trailing whitespace width for a line.
line - The line that you want to calculate the trailing whitespace width
for. Creating a line for a width can result in a line that is
actually longer than the desired width due to trailing
whitespace. Normally this is not an issue due to whitespace being
invisible, but this function may be used to determine what amount
of a line's width is due to trailing whitespace.public static CGRect CTLineGetImageBounds(CTLineRef line, CGContextRef context)
Calculates the image bounds for a line.
The image bounds for a line is the union of all non-empty glyph bounding rects, each positioned as it would be if drawn using CTLineDraw using the current context. Note that the result is ideal and does not account for raster coverage due to rendering. This function is purely a convenience for using glyphs as an image and should not be used for typographic purposes.
line - The line that you want to calculate the image bounds for.context - The context which the image bounds will be calculated for or NULL,
in which case the bounds are relative to CGPointZero.CTLineGetTypographicBounds,
CTLineGetBoundsWithOptions,
CTLineGetPenOffsetForFlushpublic static long CTLineGetStringIndexForPosition(CTLineRef line, CGPoint position)
Performs hit testing.
This function can be used to determine the string index for a mouse click or other event. This string index corresponds to the character before which the next character should be inserted. This determination is made by analyzing the string from which a typesetter was created and the corresponding glyphs as embodied by a particular line.
line - The line being examined.position - The location of the mouse click relative to the line's origin.public static double CTLineGetOffsetForStringIndex(CTLineRef line, long charIndex, org.moe.natj.general.ptr.NFloatPtr secondaryOffset)
Determines the graphical offset(s) for a string index.
This function returns the graphical offset(s) corresponding to a string index, suitable for movement between adjacent lines or for drawing a custom caret. For the former, the primary offset may be adjusted for any relative indentation of the two lines; a CGPoint constructed with the adjusted offset for its x value and 0.0 for its y value is suitable for passing to CTLineGetStringIndexForPosition. In either case, the primary offset corresponds to the portion of the caret that represents the visual insertion location for a character whose direction matches the line's writing direction.
line - The line from which the offset is requested.charIndex - The string index corresponding to the desired position.secondaryOffset - An output parameter that will be set to the secondary offset
along the baseline for charIndex. When a single caret is
sufficient for a string index, this value will be the same as
the primary offset, which is the return value of this function.
This parameter may be NULL.public static void CTLineEnumerateCaretOffsets(CTLineRef line, CoreText.Block_CTLineEnumerateCaretOffsets block)
Enumerates caret offsets for characters in a line.
The provided block is invoked once for each logical caret edge in the line, in left-to-right visual order.
block - The offset parameter is relative to the line origin. The leadingEdge parameter of this block refers to logical order.public static long CTTypesetterGetTypeID()
Returns the CFType of the typesetter object
public static CTTypesetterRef CTTypesetterCreateWithAttributedString(CFAttributedStringRef string)
Creates an immutable typesetter object using an attributed string.
The resultant typesetter can be used to create lines, perform line breaking, and do other contextual analysis based on the characters in the string.
string - The CFAttributedStringRef that you want to typeset. This
parameter must be filled in with a valid CFAttributedString.public static CTTypesetterRef CTTypesetterCreateWithAttributedStringAndOptions(CFAttributedStringRef string, CFDictionaryRef options)
Creates an immutable typesetter object using an attributed string and a dictionary of options.
The resultant typesetter can be used to create lines, perform line breaking, and do other contextual analysis based on the characters in the string.
string - The CFAttributedStringRef that you want to typeset. This
parameter must be filled in with a valid CFAttributedString.options - A CFDictionary of typesetter options, or NULL if there are none.kCTTypesetterOptionAllowUnboundedLayoutpublic static CTLineRef CTTypesetterCreateLineWithOffset(CTTypesetterRef typesetter, CFRange stringRange, double offset)
Creates an immutable line from the typesetter.
The resultant line will consist of glyphs in the correct visual order, ready to draw.
typesetter - The typesetter which the line will come from.stringRange - The string range which the line will be based on. If the length
portion of range is set to 0, then the typesetter will continue
to add glyphs to the line until it runs out of characters in the
string. The location and length of the range must be within the
bounds of the string, otherwise the call will fail.offset - The line position offset.public static CTLineRef CTTypesetterCreateLine(CTTypesetterRef typesetter, CFRange stringRange)
Equivalent to CTTypesetterCreateLineWithOffset with offset = 0.0.
public static long CTTypesetterSuggestLineBreakWithOffset(CTTypesetterRef typesetter, long startIndex, double width, double offset)
Suggests a contextual line break point based on the width provided.
The line break can be triggered either by a hard break character in the stream or by filling the specified width with characters.
typesetter - The typesetter which the line will come from.startIndex - The starting point for the line break calculations. The break
calculations will include the character starting at startIndex.width - The requested line break width.offset - The line position offset.public static long CTTypesetterSuggestLineBreak(CTTypesetterRef typesetter, long startIndex, double width)
Equivalent to CTTypesetterSuggestLineBreakWithOffset with offset = 0.0.
public static long CTTypesetterSuggestClusterBreakWithOffset(CTTypesetterRef typesetter, long startIndex, double width, double offset)
Suggests a cluster line break point based on the width provided.
Suggests a typographic cluster line break point based on the width provided. This cluster break is similar to a character break, except that it will not break apart linguistic clusters. No other contextual analysis will be done. This can be used by the caller to implement a different line breaking scheme, such as hyphenation. Note that a typographic cluster break can also be triggered by a hard break character in the stream.
typesetter - The typesetter which the line will come from.startIndex - The starting point for the typographic cluster break
calculations. The break calculations will include the character
starting at startIndex.width - The requested typographic cluster break width.offset - The line position offset.public static long CTTypesetterSuggestClusterBreak(CTTypesetterRef typesetter, long startIndex, double width)
Equivalent to CTTypesetterSuggestClusterBreakWithOffset with offset = 0.0.
public static long CTFramesetterGetTypeID()
Returns the CFType of the framesetter object
public static CTFramesetterRef CTFramesetterCreateWithAttributedString(CFAttributedStringRef attrString)
Creates an immutable framesetter object from an attributed string.
The resultant framesetter object can be used to create and fill text frames with the CTFramesetterCreateFrame call.
attrString - The attributed string to construct the framesetter with.public static CTFrameRef CTFramesetterCreateFrame(CTFramesetterRef framesetter, CFRange stringRange, CGPathRef path, CFDictionaryRef frameAttributes)
Creates an immutable frame from a framesetter.
This call will create a frame full of glyphs in the shape of the path provided by the "path" parameter. The framesetter will continue to fill the frame until it either runs out of text or it finds that text no longer fits.
framesetter - The framesetter that will be used to create the frame.stringRange - The string range which the new frame will be based on. The
string range is a range over the string that was used to
create the framesetter. If the length portion of the range
is set to 0, then the framesetter will continue to add lines
until it runs out of text or space.path - A CGPath object that specifies the shape which the frame will
take on.frameAttributes - Additional attributes that control the frame filling process
can be specified here, or NULL if there are no such attributes.
See CTFrame.h for available attributes.public static CTTypesetterRef CTFramesetterGetTypesetter(CTFramesetterRef framesetter)
Returns the typesetter object being used by the framesetter.
Each framesetter uses a typesetter internally to perform line breaking and other contextual analysis based on the characters in a string; this function returns the typesetter being used by a particular framesetter if the caller would like to perform other operations on that typesetter.
framesetter - The framesetter from which a typesetter is being requested.public static CGSize CTFramesetterSuggestFrameSizeWithConstraints(CTFramesetterRef framesetter, CFRange stringRange, CFDictionaryRef frameAttributes, CGSize constraints, CFRange fitRange)
Determines the frame size needed for a string range.
This function may be used to determine how much space is needed to display a string, optionally by constraining the space along either dimension.
framesetter - The framesetter that will be used for measuring the frame size.stringRange - The string range to which the frame size will apply. The
string range is a range over the string that was used to
create the framesetter. If the length portion of the range
is set to 0, then the framesetter will continue to add lines
until it runs out of text or space.frameAttributes - Additional attributes that control the frame filling process
can be specified here, or NULL if there are no such attributes.constraints - The width and height to which the frame size will be constrained,
A value of CGFLOAT_MAX for either dimension indicates that it
should be treated as unconstrained.fitRange - The range of the string that actually fit in the constrained size.public static long CTGlyphInfoGetTypeID()
Returns the CFType of the glyph info object
public static CTGlyphInfoRef CTGlyphInfoCreateWithGlyphName(CFStringRef glyphName, CTFontRef font, CFStringRef baseString)
Creates an immutable glyph info object.
This function creates an immutable glyph info object for a glyph name such as "copyright" and a specified font.
glyphName - The name of the glyph.font - The font to be associated with the returned CTGlyphInfo object.baseString - The part of the string the returned object is intended
to override.public static CTGlyphInfoRef CTGlyphInfoCreateWithGlyph(char glyph, CTFontRef font, CFStringRef baseString)
Creates an immutable glyph info object.
This function creates an immutable glyph info object for a glyph index and a specified font.
glyph - The glyph identifier.font - The font to be associated with the returned CTGlyphInfo object.baseString - The part of the string the returned object is intended
to override.public static CTGlyphInfoRef CTGlyphInfoCreateWithCharacterIdentifier(char cid, short collection, CFStringRef baseString)
Creates an immutable glyph info object.
This function creates an immutable glyph info object for a character identifier and a character collection.
cid - A character identifier.collection - A character collection identifier.baseString - The part of the string the returned object is intended
to override.public static CFStringRef CTGlyphInfoGetGlyphName(CTGlyphInfoRef glyphInfo)
Gets the glyph name for a glyph info, if applicable.
This function will return the glyph name.
glyphInfo - The glyph info for which you would like the glyph name.public static char CTGlyphInfoGetCharacterIdentifier(CTGlyphInfoRef glyphInfo)
Gets the character identifier for a glyph info.
This function will return the character identifier.
glyphInfo - The glyph info for which you would like the character identifier.public static short CTGlyphInfoGetCharacterCollection(CTGlyphInfoRef glyphInfo)
Gets the character collection for a glyph info.
This function will return the character collection. If the glyph info object was created with a glyph name or a glyph index, its character collection will be kCTIdentityMappingCharacterCollection.
glyphInfo - The glyph info for which you would like the character collection.public static long CTRubyAnnotationGetTypeID()
Returns the CFType of the ruby annotation object
public static CTRubyAnnotationRef CTRubyAnnotationCreateWithAttributes(byte alignment, byte overhang, byte position, CFStringRef string, CFDictionaryRef attributes)
Creates an immutable ruby annotation object.
Using this function to create a ruby annotation object with more precise control of the annotation text.
alignment - Specifies how the ruby text and the base text should be aligned relative to each other.overhang - Specifies how the ruby text can overhang adjacent characters.position - The position of the annotation text.string - A string without any formatting, its format will be derived from the attrs specified below.attributes - A attribute dictionary to combine with the string specified above. If you don't specify
kCTFontAttributeName, the font used by the Ruby annotation will be deduced from the base
text, with a size factor specified by a CFNumberRef value keyed by
kCTRubyAnnotationSizeFactorAttributeName.public static CTRubyAnnotationRef CTRubyAnnotationCreateCopy(CTRubyAnnotationRef rubyAnnotation)
Creates an immutable copy of a ruby annotation object.
rubyAnnotation - The ruby annotation that you wish to copy.public static byte CTRubyAnnotationGetAlignment(CTRubyAnnotationRef rubyAnnotation)
Get the alignment value of a ruby annotation object.
rubyAnnotation - The ruby annotation object.public static byte CTRubyAnnotationGetOverhang(CTRubyAnnotationRef rubyAnnotation)
Get the overhang value of a ruby annotation object.
rubyAnnotation - The ruby annotation object.public static double CTRubyAnnotationGetSizeFactor(CTRubyAnnotationRef rubyAnnotation)
Get the size factor of a ruby annotation object.
rubyAnnotation - The ruby annotation object.public static CFStringRef CTRubyAnnotationGetTextForPosition(CTRubyAnnotationRef rubyAnnotation, byte position)
Get the ruby text for a particular position in a ruby annotation.
rubyAnnotation - The ruby annotation object.position - The position for which you want to get the ruby text.public static long CTRunGetTypeID()
Returns the CFType of the run object
public static long CTRunGetGlyphCount(CTRunRef run)
Gets the glyph count for the run.
run - The run whose glyph count you wish to access.public static CFDictionaryRef CTRunGetAttributes(CTRunRef run)
Returns the attribute dictionary that was used to create the glyph run.
This dictionary returned is either the same exact one that was set as an attribute dictionary on the original attributed string or a dictionary that has been manufactured by the layout engine. Attribute dictionaries can be manufactured in the case of font substitution or if they are missing critical attributes.
run - The run whose attributes you wish to access.public static int CTRunGetStatus(CTRunRef run)
Returns the run's status.
In addition to attributes, runs also have status that can be used to expedite certain operations. Knowing the direction and ordering of a run's glyphs can aid in string index analysis, whereas knowing whether the positions reference the identity text matrix can avoid expensive comparisons. Note that this status is provided as a convenience, since this information is not strictly necessary but can certainly be helpful.
run - The run whose status you wish to access.public static org.moe.natj.general.ptr.ConstCharPtr CTRunGetGlyphsPtr(CTRunRef run)
Returns a direct pointer for the glyph array stored in the run.
The glyph array will have a length equal to the value returned by CTRunGetGlyphCount. The caller should be prepared for this function to return NULL even if there are glyphs in the stream. Should this function return NULL, the caller will need to allocate their own buffer and call CTRunGetGlyphs to fetch the glyphs.
run - The run whose glyphs you wish to access.public static void CTRunGetGlyphs(CTRunRef run, CFRange range, org.moe.natj.general.ptr.CharPtr buffer)
Copies a range of glyphs into user-provided buffer.
run - The run whose glyphs you wish to copy.range - The range of glyphs to be copied, with the entire range having a
location of 0 and a length of CTRunGetGlyphCount. If the length
of the range is set to 0, then the operation will continue from
the range's start index to the end of the run.buffer - The buffer where the glyphs will be copied to. The buffer must be
allocated to at least the value specified by the range's length.public static CGPoint CTRunGetPositionsPtr(CTRunRef run)
Returns a direct pointer for the glyph position array stored in the run.
The glyph positions in a run are relative to the origin of the line containing the run. The position array will have a length equal to the value returned by CTRunGetGlyphCount. The caller should be prepared for this function to return NULL even if there are glyphs in the stream. Should this function return NULL, the caller will need to allocate their own buffer and call CTRunGetPositions to fetch the positions.
run - The run whose positions you wish to access.public static void CTRunGetPositions(CTRunRef run, CFRange range, CGPoint buffer)
Copies a range of glyph positions into a user-provided buffer.
The glyph positions in a run are relative to the origin of the line containing the run.
run - The run whose positions you wish to copy.range - The range of glyph positions to be copied, with the entire range
having a location of 0 and a length of CTRunGetGlyphCount. If the
length of the range is set to 0, then the operation will continue
from the range's start index to the end of the run.buffer - The buffer where the glyph positions will be copied to. The buffer
must be allocated to at least the value specified by the range's
length.public static CGSize CTRunGetAdvancesPtr(CTRunRef run)
Returns a direct pointer for the glyph advance array stored in the run.
The advance array will have a length equal to the value returned by CTRunGetGlyphCount. The caller should be prepared for this function to return NULL even if there are glyphs in the stream. Should this function return NULL, the caller will need to allocate their own buffer and call CTRunGetAdvances to fetch the advances. Note that advances alone are not sufficient for correctly positioning glyphs in a line, as a run may have a non-identity matrix or the initial glyph in a line may have a non-zero origin; callers should consider using positions instead.
run - The run whose advances you wish to access.public static void CTRunGetAdvances(CTRunRef run, CFRange range, CGSize buffer)
Copies a range of glyph advances into a user-provided buffer.
run - The run whose advances you wish to copy.range - The range of glyph advances to be copied, with the entire range
having a location of 0 and a length of CTRunGetGlyphCount. If the
length of the range is set to 0, then the operation will continue
from the range's start index to the end of the run.buffer - The buffer where the glyph advances will be copied to. The buffer
must be allocated to at least the value specified by the range's
length.public static org.moe.natj.general.ptr.ConstNIntPtr CTRunGetStringIndicesPtr(CTRunRef run)
Returns a direct pointer for the string indices stored in the run.
The indices are the character indices that originally spawned the glyphs that make up the run. They can be used to map the glyphs in the run back to the characters in the backing store. The string indices array will have a length equal to the value returned by CTRunGetGlyphCount. The caller should be prepared for this function to return NULL even if there are glyphs in the stream. Should this function return NULL, the caller will need to allocate their own buffer and call CTRunGetStringIndices to fetch the indices.
run - The run whose string indices you wish to access.public static void CTRunGetStringIndices(CTRunRef run, CFRange range, org.moe.natj.general.ptr.NIntPtr buffer)
Copies a range of string indices into a user-provided buffer.
The indices are the character indices that originally spawned the glyphs that make up the run. They can be used to map the glyphs in the run back to the characters in the backing store.
run - The run whose string indices you wish to copy.range - The range of string indices to be copied, with the entire range
having a location of 0 and a length of CTRunGetGlyphCount. If the
length of the range is set to 0, then the operation will continue
from the range's start index to the end of the run.buffer - The buffer where the string indices will be copied to. The buffer
must be allocated to at least the value specified by the range's
length.public static CFRange CTRunGetStringRange(CTRunRef run)
Gets the range of characters that originally spawned the glyphs in the run.
run - The run whose string range you wish to access.public static double CTRunGetTypographicBounds(CTRunRef run, CFRange range, org.moe.natj.general.ptr.NFloatPtr ascent, org.moe.natj.general.ptr.NFloatPtr descent, org.moe.natj.general.ptr.NFloatPtr leading)
Gets the typographic bounds of the run.
run - The run that you want to calculate the typographic bounds for.range - The range of glyphs to be measured, with the entire range having
a location of 0 and a length of CTRunGetGlyphCount. If the length
of the range is set to 0, then the operation will continue from
the range's start index to the end of the run.ascent - Upon return, this parameter will contain the ascent of the run.
This may be set to NULL if not needed.descent - Upon return, this parameter will contain the descent of the run.
This may be set to NULL if not needed.leading - Upon return, this parameter will contain the leading of the run.
This may be set to NULL if not needed.public static CGRect CTRunGetImageBounds(CTRunRef run, CGContextRef context, CFRange range)
Calculates the image bounds for a glyph range.
The image bounds for a run is the union of all non-empty glyph bounding rects, each positioned as it would be if drawn using CTRunDraw using the current context (for clients linked against macOS High Sierra or iOS 11 and later) or the text position of the supplied context (for all others). Note that the result is ideal and does not account for raster coverage due to rendering. This function is purely a convenience for using glyphs as an image and should not be used for typographic purposes.
run - The run that you want to calculate the image bounds for.context - The context which the image bounds will be calculated for or NULL,
in which case the bounds are relative to CGPointZero.range - The range of glyphs to be measured, with the entire range having
a location of 0 and a length of CTRunGetGlyphCount. If the length
of the range is set to 0, then the operation will continue from
the range's start index to the end of the run.CTRunGetTypographicBoundspublic static CGAffineTransform CTRunGetTextMatrix(CTRunRef run)
Returns the text matrix needed to draw this run.
To properly draw the glyphs in a run, the fields 'tx' and 'ty' of the CGAffineTransform returned by this function should be set to the current text position.
run - The run object from which to get the text matrix.public static void CTRunDraw(CTRunRef run, CGContextRef context, CFRange range)
Draws a complete run or part of one.
This is a convenience call, since the run could also be drawn by accessing its glyphs, positions, and text matrix. Unlike when drawing the entire line containing the run with CTLineDraw, the run's underline (if any) will not be drawn, since the underline's appearance may depend on other runs in the line. This call may leave the graphics context in any state and does not flush the context after drawing. This call also expects a text matrix with `y` values increasing from bottom to top; a flipped text matrix may result in misplaced diacritics.
run - The run that you want to draw.context - The context to draw the run to.range - The range of glyphs to be drawn, with the entire range having a
location of 0 and a length of CTRunGetGlyphCount. If the length
of the range is set to 0, then the operation will continue from
the range's start index to the end of the run.public static long CTRunDelegateGetTypeID()
Returns the CFType of CTRunDelegate objects.
public static CTRunDelegateRef CTRunDelegateCreate(CTRunDelegateCallbacks callbacks, org.moe.natj.general.ptr.VoidPtr refCon)
Creates an immutable instance of a run delegate.
This function creates an immutable instance of a run delegate that can be used for reserving space in a line or for eliding the glyphs for a range of text altogether.
callbacks - The callbacks for this run delegate.public static org.moe.natj.general.ptr.VoidPtr CTRunDelegateGetRefCon(CTRunDelegateRef runDelegate)
Returns a run delegate's refCon value.
This function returns the refCon value that a run delegate was created with.
runDelegate - The run delegate to be queried.public static long CTTextTabGetTypeID()
Returns the CFType of the text tab object
public static CTTextTabRef CTTextTabCreate(byte alignment, double location, CFDictionaryRef options)
Creates and initializes a new text tab.
alignment - The tab's alignment. This is used to determine the position of
text inside the tab column. This parameter must be set to a valid
CTTextAlignment value or this function will return NULL.location - The tab's ruler location, relative to the back margin.options - Options to pass in when the tab is created. Currently, the only
option available is kCTTabColumnTerminatorsAttributeName. This
parameter is optional and can be set to NULL if not needed.public static byte CTTextTabGetAlignment(CTTextTabRef tab)
Returns the text alignment of the tab.
tab - The tab whose text alignment you wish to access.public static double CTTextTabGetLocation(CTTextTabRef tab)
Returns the tab's ruler location.
tab - The tab whose location you wish to access.public static CFDictionaryRef CTTextTabGetOptions(CTTextTabRef tab)
Returns the dictionary of attributes associated with the tab.
tab - The tab whose attributes you wish to access.public static int CTGetCoreTextVersion()
Returns the version of the CoreText framework.
This function returns a number indicating the version of the CoreText framework. Note that framework version is not always an accurate indicator of feature availability. The recommended way to use this function is first to check that the function pointer is non-NULL, followed by calling it and comparing its result to a defined constant (or constants). For example, to determine whether the CoreText API is available: if (&CTGetCoreTextVersion != NULL && CTGetCoreTextVersion() >= kCTVersionNumber10_5) { // CoreText API is available }
public static CFStringRef kCTFontSymbolicTrait()
Dictionary key to access the symbolic traits value.
Use this key to access the symbolic traits value from the font traits dictionary. The value is returned as a CFNumberRef.
public static CFStringRef kCTFontWeightTrait()
Dictionary key to access the weight trait value.
Use this key to access the normalized weight trait from the font traits dictionary. The value returned is a CFNumberRef representing a float value between -1.0 and 1.0 for normalized weight. The value of 0.0 corresponds to the regular or medium font weight.
public static CFStringRef kCTFontWidthTrait()
Dictionary key to access the width (condense/expand) trait value.
Use this key to access the normalized proportion trait from the font traits dictionary. This value corresponds to the relative inter-glyph spacing for a given font. The value returned is a CFNumberRef representing a float between -1.0 and 1.0. The value of 0.0 corresponds to regular glyph spacing while negative values represent condensed glyph spacing.
public static CFStringRef kCTFontSlantTrait()
Dictionary key to access the slant trait value.
Use this key to access the normalized slant angle from the font traits dictionary. The value returned is a CFNumberRef representing a float value between -1.0 and 1.0 for normalized slant angle. The value or 0.0 corresponds to 0 degree clockwise rotation from the vertical and 1.0 corresponds to 30 degrees clockwise rotation.
public static CFStringRef kCTFontURLAttribute()
The font URL.
This is the key for accessing the font URL from the font descriptor. The value associated with this key is a CFURLRef.
public static CFStringRef kCTFontNameAttribute()
The PostScript name.
This is the key for retrieving the PostScript name from the font descriptor. When matching, this is treated more generically: the system first tries to find fonts with this PostScript name. If none is found, the system tries to find fonts with this family name, and, finally, if still nothing, tries to find fonts with this display name. The value associated with this key is a CFStringRef. If unspecified, defaults to "Helvetica", if unavailable falls back to global font cascade list.
public static CFStringRef kCTFontDisplayNameAttribute()
The display name.
This is the key for accessing the name used to display the font. Most commonly this is the full name. The value associated with this key is a CFStringRef.
public static CFStringRef kCTFontFamilyNameAttribute()
The family name.
This is the key for accessing the family name from the font descriptor. The value associated with this key is a CFStringRef.
public static CFStringRef kCTFontStyleNameAttribute()
The style name.
This is the key for accessing the style name of the font. This name represents the designer's description of the font's style. The value associated with this key is a CFStringRef.
public static CFStringRef kCTFontTraitsAttribute()
The font traits dictionary.
This is the key for accessing the dictionary of font traits for stylistic information. See CTFontTraits.h for the list of font traits. The value associated with this key is a CFDictionaryRef.
public static CFStringRef kCTFontVariationAttribute()
The font variation dictionary.
This key is used to obtain the font variation instance as a CFDictionaryRef. If specified in a font descriptor, fonts with the specified axes will be primary match candidates, if no such fonts exist, this attribute will be ignored.
public static CFStringRef kCTFontSizeAttribute()
The font point size.
This key is used to obtain or specify the font point size. Creating a font with this unspecified will default to a point size of 12.0. The value for this key is represented as a CFNumberRef.
public static CFStringRef kCTFontMatrixAttribute()
The font transformation matrix.
This key is used to specify the font transformation matrix when creating a font. The default value is CGAffineTransformIdentity. The value for this key is a CFDataRef containing a CGAffineTransform, of which only the a, b, c, and d fields are used.
public static CFStringRef kCTFontCascadeListAttribute()
The font cascade list.
This key is used to specify or obtain the cascade list used for a font reference. The cascade list is a CFArrayRef containing CTFontDescriptorRefs. If unspecified, the global cascade list is used. This list is not consulted for private-use characters on OS X 10.10, iOS 8, or earlier.
public static CFStringRef kCTFontCharacterSetAttribute()
The font Unicode character coverage set.
The value for this key is a CFCharacterSetRef. Creating a font with this attribute will restrict the font to a subset of its actual character set.
public static CFStringRef kCTFontLanguagesAttribute()
The list of supported languages.
The value for this key is a CFArrayRef of CFStringRef language identifiers conforming to UTS #35. It can be requested from any font. If present in a descriptor used for matching, only fonts supporting the specified languages will be returned.
public static CFStringRef kCTFontBaselineAdjustAttribute()
The baseline adjustment to apply to font metrics.
The value for this key is a floating-point CFNumberRef. This is primarily used when defining font descriptors for a cascade list to keep the baseline of all fonts even.
public static CFStringRef kCTFontMacintoshEncodingsAttribute()
The Macintosh encodings (legacy script codes).
The value associated with this key is a CFNumberRef containing a bitfield of the script codes in
public static CFStringRef kCTFontFeaturesAttribute()
The array of font features.
This key is used to specify or obtain the font features for a font reference. The value associated with this key is a CFArrayRef of font feature dictionaries. This features list contains the feature information from the 'feat' table of the font. See the CTFontCopyFeatures() API in CTFont.h.
public static CFStringRef kCTFontFeatureSettingsAttribute()
The array of typographic feature settings.
This key is used to specify an array of zero or more feature settings. Each setting dictionary indicates which setting should be applied. In the case of duplicate or conflicting settings the last setting in the list will take precedence. In the case of AAT settings, it is the caller's responsibility to handle exclusive and non-exclusive settings as necessary. An AAT setting dictionary contains a tuple of a kCTFontFeatureTypeIdentifierKey key-value pair and a kCTFontFeatureSelectorIdentifierKey key-value pair. An OpenType setting dictionary contains a tuple of a kCTFontOpenTypeFeatureTag key-value pair and a kCTFontOpenTypeFeatureValue key-value pair.
Starting with OS X 10.10 and iOS 8.0, settings are also accepted (but not returned) in the following simplified forms: An OpenType setting can be either an array pair of tag string and value number, or a tag string on its own. For example: @[ @"c2sc", @1 ] or simply @"c2sc". An unspecified value enables the feature and a value of zero disables it. An AAT setting can be specified as an array pair of type and selector numbers. For example: @[ @(kUpperCaseType), @(kUpperCaseSmallCapsSelector) ].
public static CFStringRef kCTFontFixedAdvanceAttribute()
Specifies advance width.
This key is used to specify a constant advance width, which affects the glyph metrics of any font instance created with this key; it overrides font values and the font transformation matrix, if any. The value associated with this key must be a CFNumberRef.
Starting with macOS 10.14 and iOS 12.0, this only affects glyph advances that have non-zero width when this attribute is not present.
public static CFStringRef kCTFontOrientationAttribute()
The orientation attribute.
This key is used to specify a particular orientation for the glyphs of the font. The value associated with this key is a int as a CFNumberRef. If you want to receive vertical metrics from a font for vertical rendering, specify kCTFontVerticalOrientation. If unspecified, the font will use its native orientation.
public static CFStringRef kCTFontFormatAttribute()
Specifies the recognized format of the font.
The attribute is used to specify or obtain the format of the font. The returned value is a CFNumber containing one of the constants defined below.
public static CFStringRef kCTFontRegistrationScopeAttribute()
Specifies the font descriptor's registration scope.
The attribute is used to specify or obtain the font registration scope. The value returned is a CFNumberRef containing one of the CTFontManagerScope enumerated values. A value of NULL can be returned for font descriptors that are not registered.
public static CFStringRef kCTFontPriorityAttribute()
The font descriptors priority when resolving duplicates and sorting match results.
This key is used to obtain or specify the font priority. The value returned is a CFNumberRef containing an integer value as defined below. The higher the value, the higher the priority of the font. Only registered fonts will have a priority. Unregistered font descriptors will return NULL.
public static CFStringRef kCTFontEnabledAttribute()
The font enabled state.
The value associated with this key is a CFBoolean. Unregistered font descriptors will return NULL, which is equivalent to false.
public static CFStringRef kCTFontDownloadableAttribute()
The font downloadable state.
The value associated with this key is a CFBoolean. If it is true, CoreText attempts to download a font if necessary when matching a descriptor.
public static CFStringRef kCTFontDownloadedAttribute()
The download state.
The value associated with this key is a CFBoolean. If it is true, corresponding FontAsset has been downloaded. (but still it may be necessary to call appropriate API in order to use the font in the FontAsset.)
public static CFStringRef kCTFontDescriptorMatchingSourceDescriptor()
public static CFStringRef kCTFontDescriptorMatchingDescriptors()
public static CFStringRef kCTFontDescriptorMatchingResult()
public static CFStringRef kCTFontDescriptorMatchingPercentage()
public static CFStringRef kCTFontDescriptorMatchingCurrentAssetSize()
public static CFStringRef kCTFontDescriptorMatchingTotalDownloadedSize()
public static CFStringRef kCTFontDescriptorMatchingTotalAssetSize()
public static CFStringRef kCTFontDescriptorMatchingError()
public static CFStringRef kCTFontCopyrightNameKey()
The name specifier for the copyright name.
public static CFStringRef kCTFontFamilyNameKey()
The name specifier for the family name.
public static CFStringRef kCTFontSubFamilyNameKey()
The name specifier for the subfamily name.
public static CFStringRef kCTFontStyleNameKey()
The name specifier for the style name.
public static CFStringRef kCTFontUniqueNameKey()
The name specifier for the unique name.
Note that this name is often not unique and should not be assumed to be truly unique.
public static CFStringRef kCTFontFullNameKey()
The name specifier for the full name.
public static CFStringRef kCTFontVersionNameKey()
The name specifier for the version name.
public static CFStringRef kCTFontPostScriptNameKey()
The name specifier for the PostScript name.
public static CFStringRef kCTFontTrademarkNameKey()
The name specifier for the trademark name.
public static CFStringRef kCTFontManufacturerNameKey()
The name specifier for the manufacturer name.
public static CFStringRef kCTFontDesignerNameKey()
The name specifier for the designer name.
public static CFStringRef kCTFontDescriptionNameKey()
The name specifier for the description name.
public static CFStringRef kCTFontVendorURLNameKey()
The name specifier for the vendor url name.
public static CFStringRef kCTFontDesignerURLNameKey()
The name specifier for the designer url name.
public static CFStringRef kCTFontLicenseNameKey()
The name specifier for the license name.
public static CFStringRef kCTFontLicenseURLNameKey()
The name specifier for the license url name.
public static CFStringRef kCTFontSampleTextNameKey()
The name specifier for the sample text name string.
public static CFStringRef kCTFontPostScriptCIDNameKey()
The name specifier for the PostScript CID name.
public static CFStringRef kCTFontVariationAxisIdentifierKey()
Key to get the variation axis identifier.
This key is used with a variation axis dictionary to get the axis identifier value as a CFNumberRef.
public static CFStringRef kCTFontVariationAxisMinimumValueKey()
Key to get the variation axis minimum value.
This key is used with a variation axis dictionary to get the minimum axis value as a CFNumberRef.
public static CFStringRef kCTFontVariationAxisMaximumValueKey()
Key to get the variation axis maximum value.
This key is used with a variation axis dictionary to get the maximum axis value as a CFNumberRef.
public static CFStringRef kCTFontVariationAxisDefaultValueKey()
Key to get the variation axis default value.
This key is used with a variation axis dictionary to get the default axis value as a CFNumberRef.
public static CFStringRef kCTFontVariationAxisNameKey()
Key to get the variation axis name string.
This key is used with a variation axis dictionary to get the localized variation axis name.
public static CFStringRef kCTFontOpenTypeFeatureTag()
Key to get the OpenType feature tag.
This key can be used with a font feature dictionary to get the tag as a CFStringRef.
public static CFStringRef kCTFontOpenTypeFeatureValue()
Key to get the OpenType feature value.
This key can be used with a font feature dictionary to get the value as a CFNumberRef.
public static CFStringRef kCTFontFeatureTypeIdentifierKey()
Key to get the font feature type value.
This key can be used with a font feature dictionary to get the type identifier as a CFNumberRef.
public static CFStringRef kCTFontFeatureTypeNameKey()
Key to get the font feature name.
This key can be used with a font feature dictionary to get the localized type name string as a CFString.
public static CFStringRef kCTFontFeatureTypeExclusiveKey()
Key to get the font feature exclusive setting.
This key can be used with a font feature dictionary to get the the exclusive setting of the feature as a CFBoolean. The value associated with this key indicates whether the feature selectors associated with this type should be mutually exclusive.
public static CFStringRef kCTFontFeatureTypeSelectorsKey()
Key to get the font feature selectors.
This key can be used with a font feature dictionary to get the array of font feature selectors as a CFArrayRef. This is an array of selector dictionaries that contain the values for the following selector keys.
public static CFStringRef kCTFontFeatureSelectorIdentifierKey()
Key to get the font feature selector identifier.
This key can be used with a selector dictionary corresponding to a feature type to obtain the selector identifier value as a CFNumberRef.
public static CFStringRef kCTFontFeatureSelectorNameKey()
Key to get the font feature selector name.
This key is used with a selector dictionary to get the localized name string for the selector as a CFStringRef.
public static CFStringRef kCTFontFeatureSelectorDefaultKey()
Key to get the font feature selector default setting value.
This key is used with a selector dictionary to get the default indicator for the selector. This value is a CFBooleanRef which if present and true indicates that this selector is the default setting for the current feature type.
public static CFStringRef kCTFontFeatureSelectorSettingKey()
Key to get or specify the current feature setting.
This key is used with a selector dictionary to get or specify the current setting for the selector. This value is a CFBooleanRef to indicate whether this selector is on or off. If this key is not present, the default setting is used.
public static CFStringRef kCTBaselineClassRoman()
Key to reference the Roman baseline class.
This key can be used with a baseline info dictionary to offset to the Roman baseline as a CFNumberRef float. It can also be used as the value for kCTBaselineClassAttributeName.
public static CFStringRef kCTBaselineClassIdeographicCentered()
Key to reference the Ideographic Centered baseline class.
This key can be used with a baseline info dictionary to offset to the Ideographic Centered baseline as a CFNumberRef float. It can also be used as the value for kCTBaselineClassAttributeName.
public static CFStringRef kCTBaselineClassIdeographicLow()
Key to reference the Ideographic Low baseline class.
This key can be used with a baseline info dictionary to offset to the Ideographic Low baseline as a CFNumberRef float. It can also be used as the value for kCTBaselineClassAttributeName.
public static CFStringRef kCTBaselineClassIdeographicHigh()
Key to reference the Ideographic High baseline class.
This key can be used with a baseline info dictionary to offset to the Ideographic High baseline as a CFNumberRef float. It can also be used as the value for kCTBaselineClassAttributeName.
public static CFStringRef kCTBaselineClassHanging()
Key to reference the Hanging baseline class.
This key can be used with a baseline info dictionary to offset to the Hanging baseline as a CFNumberRef float. It can also be used as the value for kCTBaselineClassAttributeName.
public static CFStringRef kCTBaselineClassMath()
Key to reference the Math baseline class.
This key can be used with a baseline info dictionary to offset to the Math baseline as a CFNumberRef float. It can also be used as the value for kCTBaselineClassAttributeName.
public static CFStringRef kCTBaselineReferenceFont()
Key to reference a font for the reference baseline.
This key can be used to specify a font for the reference baseline. The value is a CTFontRef or the kCTBaselineOriginalFont constant.
public static CFStringRef kCTBaselineOriginalFont()
Use the original font for setting the reference baseline.
This constant can be used as the value for kCTBaselineReferenceFont to specify that the original font should be used for the reference baseline.
public static CFStringRef kCTFontCollectionRemoveDuplicatesOption()
Option key to specify filtering of duplicates.
Specify this option key in the options dictionary with a non- zero value to enable automatic filtering of duplicate font descriptors.
public static CFStringRef kCTFontManagerErrorDomain()
CFError domain for CTFontManager errors
CFErrors with this domain will have error codes corresponding to one of the CTFontManagerErrors above.
public static CFStringRef kCTFontManagerErrorFontURLsKey()
User info key to be used with CFError references returned from registration functions.
The value associated with this key in the user info dictionary of a CFError is a CFArray of font URLs that failed with given error.
public static CFStringRef kCTFontManagerRegisteredFontsChangedNotification()
Notification name for font registry changes.
This is the string to use as the notification name when subscribing to CTFontManager notifications. This notification will be posted when fonts are added or removed. OS X clients should register as an observer of the notification with the distributed notification center for changes in session or persistent scopes and with the local notification center for changes in process scope. iOS clients should register as an observer of the notification with the local notification center for all changes.
public static CFStringRef kCTFrameProgressionAttributeName()
Specifies progression for a frame.
Value must be a CFNumberRef containing a CTFrameProgression. Default is kCTFrameProgressionTopToBottom. This value determines the line stacking behavior for a frame and does not affect the appearance of the glyphs within that frame.
CTFramesetterCreateFramepublic static CFStringRef kCTFramePathFillRuleAttributeName()
Specifies fill rule for a frame if this attribute is used at top level of frameAttributes dictionary, or specify fill rule for a clipping path if used in a dictionary contained in an array specified by kCTFrameClippingPathsAttributeName.
Value must be a CFNumberRef containing kCTFramePathFillEvenOdd or kCTFramePathFillWindingNumber. Default is kCTFramePathFillEvenOdd.
CTFramesetterCreateFramepublic static CFStringRef kCTFramePathWidthAttributeName()
Specifies frame width if this attribute is used at top level of frameAttributes dictionary, or specify clipping path width if used in a dictionary contained in an array specified by kCTFrameClippingPathsAttributeName.
Value must be a CFNumberRef specifying frame width. Default is zero.
CTFramesetterCreateFramepublic static CFStringRef kCTFrameClippingPathsAttributeName()
Specifies array of paths to clip frame.
Value must be a CFArrayRef containing CFDictionaryRefs or CGPathRef. (CGPathRef is allowed on 10.8 or later.) Each dictionary should have a kCTFramePathClippingPathAttributeName key-value pair, and can have a kCTFramePathFillRuleAttributeName key-value pair and kCTFramePathFillRuleAttributeName key-value pair as optional parameters. In case of CGPathRef, default fill rule (kCTFramePathFillEvenOdd) and width (0.0) are used.
CTFramesetterCreateFramepublic static CFStringRef kCTFramePathClippingPathAttributeName()
Specifies clipping path. This attribute is valid in a dictionary contained in an array specified by kCTFrameClippingPathsAttributeName. On 10.8 or later, This attribute is also valid in frameAttributes dictionary passed to CTFramesetterCreateFrame.
Value must be a CGPathRef specifying a clipping path.
kCTFrameClippingPathsAttributeName@Deprecated public static CFStringRef kCTTypesetterOptionDisableBidiProcessing()
Disables bidi processing.
Value must be a CFBooleanRef. Default is false. Normally, typesetting applies the Unicode Bidirectional Algorithm as described in UAX #9. If a typesetter is created with this option set to true, no directional reordering is performed and any directional control characters are ignored.
public static CFStringRef kCTTypesetterOptionForcedEmbeddingLevel()
Specifies the embedding level.
Value must be a CFNumberRef. Default is unset. Normally, typesetting applies the Unicode Bidirectional Algorithm as described in UAX #9. If present, this specifies the embedding level and any directional control characters are ignored.
public static CFStringRef kCTRubyAnnotationSizeFactorAttributeName()
Specifies the size of the annotation text as a percent of the size of the base text.
Value must be a CFNumberRef.
public static CFStringRef kCTRubyAnnotationScaleToFitAttributeName()
Treat the size specified in kCTRubyAnnotationSizeFactorAttributeName as the maximum scale factor, when the base text size is smaller than annotation text size, we will try to scale the annotation font size down so that it will fit the base text without overhang or adding extra padding between base text.
Value must be a CFBooleanRef. Default is false.
public static CFStringRef kCTFontAttributeName()
The font.
Value must be a CTFontRef. Default is Helvetica 12.
public static CFStringRef kCTForegroundColorFromContextAttributeName()
Never set a foreground color in the CGContext; use what is set as the context's fill color.
Value must be a CFBooleanRef. Default is false. The reason why this exists is because an NSAttributedString defaults to a black color if no color attribute is set. This forces CoreText to set the color in the context. This will allow developers to sidestep this, making CoreText set nothing but font information in the CGContext. If set, this attribute also determines the color used by kCTUnderlineStyleAttributeName, in which case it overrides the foreground color.
public static CFStringRef kCTKernAttributeName()
A kerning adjustment.
Value must be a CFNumberRef float. Default is standard kerning. The kerning attribute indicate how many points the following character should be shifted from its default offset as defined by the current character's font in points; a positive kern indicates a shift farther along and a negative kern indicates a shift closer to the current character. If this attribute is not present, standard kerning will be used. If this attribute is set to 0.0, no kerning will be done at all.
public static CFStringRef kCTLigatureAttributeName()
Controls ligature formation.
Value must be a CFNumberRef. Default is int value 1. The ligature attribute determines what kinds of ligatures should be used when displaying the string. A value of 0 indicates that only ligatures essential for proper rendering of text should be used, 1 indicates that standard ligatures should be used, and 2 indicates that all available ligatures should be used. Which ligatures are standard depends on the script and possibly the font. Arabic text, for example, requires ligatures for many character sequences, but has a rich set of additional ligatures that combine characters. English text has no essential ligatures, and typically has only two standard ligatures, those for "fi" and "fl" -- all others being considered more advanced or fancy.
On iOS releases prior to 6.0 essential ligatures are applied if the font contains glyphs for any of U+FB00 through U+FB04 and the font lacks AAT or OpenType shaping tables, but as of 6.0 shaping tables (or the lack thereof) are treated as definitive.
public static CFStringRef kCTForegroundColorAttributeName()
The foreground color.
Value must be a CGColorRef. Default value is black.
public static CFStringRef kCTBackgroundColorAttributeName()
The background color.
Value must be a CGColorRef. Default is no background color.
public static CFStringRef kCTParagraphStyleAttributeName()
A CTParagraphStyle object which is used to specify things like line alignment, tab rulers, writing direction, etc.
Value must be a CTParagraphStyleRef. Default is an empty CTParagraphStyle object: see CTParagraphStyle.h for more information. The value of this attribute must be uniform over the range of any paragraphs to which it is applied.
CFStringGetParagraphBoundspublic static CFStringRef kCTStrokeWidthAttributeName()
The stroke width.
Value must be a CFNumberRef. Default value is 0.0, or no stroke. This attribute, interpreted as a percentage of font point size, controls the text drawing mode: positive values effect drawing with stroke only; negative values are for stroke and fill. A typical value for outlined text is 3.0.
public static CFStringRef kCTStrokeColorAttributeName()
The stroke color.
Value must be a CGColorRef. Default is the foreground color.
public static CFStringRef kCTUnderlineStyleAttributeName()
Allows the setting of an underline to be applied at render time.
Value must be a CFNumberRef. Default is kCTUnderlineStyleNone. Set a value of something other than kCTUnderlineStyleNone to draw an underline. In addition, the CTUnderlineStyleModifiers can be used to modify the look of the underline. The underline color will be determined by the text's foreground color unless otherwise specified by kCTUnderlineColorAttributeName.
public static CFStringRef kCTSuperscriptAttributeName()
Controls vertical text positioning.
Value must be a CFNumberRef. Default is int value 0. If supported by the specified font, a value of 1 enables superscripting and a value of -1 enables subscripting.
public static CFStringRef kCTUnderlineColorAttributeName()
The underline color.
Value must be a CGColorRef. Default is the foreground color.
public static CFStringRef kCTVerticalFormsAttributeName()
Controls glyph orientation.
Value must be a CFBooleanRef. Default is false. A value of false indicates that horizontal glyph forms are to be used, true indicates that vertical glyph forms are to be used.
public static CFStringRef kCTHorizontalInVerticalFormsAttributeName()
Setting text in tate-chu-yoko form (horizontal numerals in vertical text).
Value must be a CFNumberRef. Default is int value 0. A value of 1 to 4 indicates the number of digits or letters to set in horizontal form. This is to apply the correct feature settings for the text. This attribute only works when kCTVerticalFormsAttributeName is set to true.
public static CFStringRef kCTGlyphInfoAttributeName()
Allows the use of unencoded glyphs.
Value must be a CTGlyphInfoRef. The glyph specified by this CTGlyphInfo object is assigned to the entire attribute range, provided that its contents match the specified base string and that the specified glyph is available in the font specified by kCTFontAttributeName. See CTGlyphInfo.h for more information.
@Deprecated public static CFStringRef kCTCharacterShapeAttributeName()
Controls glyph selection.
Value must be a CFNumberRef. Default is value is 0 (disabled). A non-zero value is interpreted as an SFNT kCharacterShapeType selector + 1; see SFNTLayoutTypes.h for selectors. For example, an attribute value of 1 corresponds to kTraditionalCharactersSelector.
public static CFStringRef kCTLanguageAttributeName()
Specifies text language.
Value must be a CFStringRef containing a locale identifier. Default is unset. When this attribute is set to a valid identifier, it will be used to select localized glyphs (if supported by the font) and locale-specific line breaking rules.
public static CFStringRef kCTRunDelegateAttributeName()
Allows customization of certain aspects of a range of text's appearance.
Value must be a CTRunDelegateRef. The values returned by the embedded object for an attribute range apply to each glyph resulting from the text in that range. Because an embedded object is only a display-time modification, care should be taken to avoid applying this attribute to a range of text with complex behavior, such as a change of writing direction, combining marks, etc. Consequently, it is recommended that this attribute be applied to a range containing the single character U+FFFC. See CTRunDelegate.h for more information.
public static CFStringRef kCTBaselineClassAttributeName()
Key to reference a baseline class override.
Value must be one of the kCTBaselineClass constants. Normally, glyphs on the line will be assigned baseline classes according to the 'bsln' or 'BASE' table in the font. This attribute may be used to change this assignment.
kCTBaselineClassRoman,
kCTBaselineClassIdeographicCentered,
kCTBaselineClassIdeographicLow,
kCTBaselineClassIdeographicHigh,
kCTBaselineClassHanging,
kCTBaselineClassMathpublic static CFStringRef kCTBaselineInfoAttributeName()
Key to reference a baseline info dictionary.
Value must be a CFDictionaryRef. Normally, baseline offsets will be assigned based on the 'bsln' or 'BASE' table in the font. This attribute may be used to assign different offsets. Each key in the dictionary is one of the kCTBaselineClass constants and the value is a CFNumberRef of the baseline offset in points. You only need to specify the offsets you wish to change.
kCTBaselineClassRoman,
kCTBaselineClassIdeographicCentered,
kCTBaselineClassIdeographicLow,
kCTBaselineClassIdeographicHigh,
kCTBaselineClassHanging,
kCTBaselineClassMathpublic static CFStringRef kCTBaselineReferenceInfoAttributeName()
Key to reference a baseline info dictionary for the reference baseline.
Value must be a CFDictionaryRef. All glyphs in a run are assigned a baseline class and then aligned to the offset for that class in the reference baseline baseline info. See the discussion of kCTBaselineInfoAttributeName for information about the contents of the dictionary. You can also use the kCTBaselineReferenceFont key to specify that the baseline offsets of a particular CTFontRef should be used as the reference offsets.
kCTBaselineClassRoman,
kCTBaselineClassIdeographicCentered,
kCTBaselineClassIdeographicLow,
kCTBaselineClassIdeographicHigh,
kCTBaselineClassHanging,
kCTBaselineClassMath,
kCTBaselineReferenceFontpublic static CFStringRef kCTWritingDirectionAttributeName()
Specifies a bidirectional override or embedding.
Value must be a CFArray of CFNumberRefs, each of which should have a value of either kCTWritingDirectionLeftToRight or kCTWritingDirectionRightToLeft, plus one of kCTWritingDirectionEmbedding or kCTWritingDirectionOverride. This array represents a sequence of nested bidirectional embeddings or overrides, in order from outermost to innermost, with (kCTWritingDirectionLeftToRight | kCTWritingDirectionEmbedding) corresponding to a LRE/PDF pair in plain text or in HTML, (kCTWritingDirectionRightToLeft | kCTWritingDirectionEmbedding) corresponding to a RLE/PDF pair in plain text or a in HTML, (kCTWritingDirectionLeftToRight | kCTWritingDirectionOverride) corresponding to a LRO/PDF pair in plain text or in HTML, and (kCTWritingDirectionRightToLeft | kCTWritingDirectionOverride) corresponding to a RLO/PDF pair in plain text or in HTML.
kCTWritingDirectionLeftToRight,
kCTWritingDirectionRightToLeft,
kCTWritingDirectionEmbedding,
kCTWritingDirectionOverridepublic static CFStringRef kCTRubyAnnotationAttributeName()
Key to reference a CTRubyAnnotation.
Value must be a CTRubyAnnotationRef. See CTRubyAnnotation.h for more information.
public static CFStringRef kCTTabColumnTerminatorsAttributeName()
Used to specify the terminating character for a tab column
The value associated with this attribute is a CFCharacterSet. The character set is used to determine the terminating character for a tab column. The tab and newline characters are implied even if they don't exist in the character set. This attribute can be used to implement decimal tabs, for instance. This attribute is optional.
public static CFStringRef kCTFontVariationAxisHiddenKey()
Key to get the hidden axis flag.
This key contains a CFBoolean value that is true when the font designer recommends the axis not be exposed directly to end users in application interfaces.
public static CFStringRef kCTBaselineOffsetAttributeName()
Controls vertical text positioning.
Value must be a CFNumberRef float. Default is standard positioning. The baseline attribute indicates how many points the characters should be shifted perpendicular to their baseline. A positive baseline value indicates a shift above (or to the right for vertical text) the text baseline and a negative baseline value indicates a shift below (or to the left for vertical text) the text baseline. If this value is set to 0.0, no baseline shift will be performed.
NSBaselineOffsetAttributeNamepublic static CTFontRef CTFontCreateForStringWithLanguage(CTFontRef currentFont, CFStringRef string, CFRange range, CFStringRef language)
Returns a new font reference that can best map the given string range based on the current font and language specified.
The current font itself can be returned if it covers the string provided.
currentFont - The current font that contains a valid cascade list.string - A unicode string containing characters that cannot be encoded by the current font.range - A CFRange specifying the range of the string that needs to be mapped.language - Language identifier to select a font for a particular localization. If unspecified, the current system language is used. The format of the language identifier should conform to UTS #35.CTFontCopyCharacterSet,
CTFontGetGlyphsForCharacters,
kCTFontCascadeListAttributepublic static CFArrayRef CTFontCollectionCreateMatchingFontDescriptorsWithOptions(CTFontCollectionRef collection, CFDictionaryRef options)
Returns an array of font descriptors matching the collection.
collection - The font collection reference.options - The options dictionary. See constant option keys. May be NULL, in which case this call returns the same results as CTFontCollectionCreateMatchingFontDescriptors, using the options passed in when the collection was created.public static CFArrayRef CTFontManagerCreateFontDescriptorsFromData(CFDataRef data)
Returns an array of font descriptors for the fonts in the supplied data. Note: the font descriptors are not available through font descriptor matching.
data - A CFData containing font data.public static void CTFontManagerRegisterFontURLs(CFArrayRef fontURLs, int scope, boolean enabled, CoreText.Block_CTFontManagerRegisterFontURLs registrationHandler)
Registers fonts from the specified font URLs with the font manager. Registered fonts are discoverable through font descriptor matching in the calling process
In iOS, fonts registered with the persistent scope are not automatically available to other processes. Other process may call CTFontManagerRequestFonts to get access to these fonts.
fontURLs - A file URL for the fonts or collections (TTC or OTC) to be registered. Once fonts have been registered from a file, it shouldn't be moved or renamed.scope - Scope constant defining the availability and lifetime of the registration. See scope constants for more details.enabled - Boolean value indicating whether the font derived from the URL should be enabled for font descriptor matching and/or discoverable via CTFontManagerRequestFonts.registrationHandler - Block called as errors are discovered or upon completion. The errors parameter contains an array of CFError references. An empty array indicates no errors. Each error reference will contain a CFArray of font URLs corresponding to kCTFontManagerErrorFontURLsKey. These URLs represent the font files that caused the error, and were not successfully registered. Note, the handler may be called multiple times during the registration process. The done parameter will be set to true when the registration process has completed. The handler should return false if the operation is to be stopped. This may be desirable after receiving an error.public static void CTFontManagerUnregisterFontURLs(CFArrayRef fontURLs, int scope, CoreText.Block_CTFontManagerUnregisterFontURLs registrationHandler)
Unregisters fonts from the specified font URLs with the font manager. Unregistered fonts do not participate in font descriptor matching. iOS note: only fonts registered with CTFontManagerRegisterFontsForURL or CTFontManagerRegisterFontsForURLs can be unregistered with this API.
fontURLs - Array of font URLs.scope - Scope constant defining the availability and lifetime of the registration. Should match the scope the fonts are registered in. See scope constants for more details.registrationHandler - Block called as errors are discovered or upon completion. The errors parameter will be an empty array if all files are unregistered. Otherwise, it will contain an array of CFError references. Each error reference will contain a CFArray of font URLs corresponding to kCTFontManagerErrorFontURLsKey. These URLs represent the font files that caused the error, and were not successfully unregistered. Note, the handler may be called multiple times during the unregistration process. The done parameter will be set to true when the unregistration process has completed. The handler should return false if the operation is to be stopped. This may be desirable after receiving an error.public static void CTFontManagerRegisterFontDescriptors(CFArrayRef fontDescriptors, int scope, boolean enabled, CoreText.Block_CTFontManagerRegisterFontDescriptors registrationHandler)
Registers font descriptors with the font manager. Registered fonts are discoverable through font descriptor matching in the calling process.
Fonts descriptors registered in disabled state are not immediately available for descriptor matching but the font manager will know the descriptors could be made available if necessary. These decriptors can be enabled by making this called again with the enabled parameter set to true. This operation may fail if there is another font registered and enabled with the same Postscript name. In iOS, fonts registered with the persistent scope are not automatically available to other processes. Other process may call CTFontManagerRequestFonts to get access to these fonts.
fontDescriptors - Array of font descriptors to register. Font descriptor keys used for registration are: kCTFontURLAttribute, kCTFontNameAttribute, kCTFontFamilyNameAttribute, or kCTFontRegistrationUserInfoAttribute.scope - Scope constant defining the availability and lifetime of the registration. See scope constants for more details.enabled - Boolean value indicating whether the font descriptors should be enabled for font descriptor matching and/or discoverable via CTFontManagerRequestFonts.registrationHandler - Block called as errors are discovered or upon completion. The errors parameter contains an array of CFError references. An empty array indicates no errors. Each error reference will contain a CFArray of font descriptors corresponding to kCTFontManagerErrorFontDescriptorsKey. These represent the font descriptors that caused the error, and were not successfully registered. Note, the handler may be called multiple times during the registration process. The done parameter will be set to true when the registration process has completed. The handler should return false if the operation is to be stopped. This may be desirable after receiving an error.public static void CTFontManagerUnregisterFontDescriptors(CFArrayRef fontDescriptors, int scope, CoreText.Block_CTFontManagerUnregisterFontDescriptors registrationHandler)
Unregisters font descriptors with the font manager. Unregistered fonts do not participate in font descriptor matching.
fontDescriptors - Array of font descriptors to unregister.scope - Scope constant defining the availability and lifetime of the registration. See scope constants for more details.registrationHandler - Block called as errors are discovered or upon completion. The errors parameter will be an empty array if all font descriptors are unregistered. Otherwise, it will contain an array of CFError references. Each error reference will contain a CFArray of font descriptors corresponding to kCTFontManagerErrorFontDescriptorsKey. These represent the font descriptors that caused the error, and were not successfully unregistered. Note, the handler may be called multiple times during the unregistration process. The done parameter will be set to true when the unregistration process has completed. The handler should return false if the operation is to be stopped. This may be desirable after receiving an error.public static void CTFontManagerRegisterFontsWithAssetNames(CFArrayRef fontAssetNames, CFBundleRef bundle, int scope, boolean enabled, CoreText.Block_CTFontManagerRegisterFontsWithAssetNames registrationHandler)
Registers named font assets in the specified bundle with the font manager. Registered fonts are discoverable through font descriptor matching in the calling process.
Font assets are extracted from the asset catalog and registered. This call must be made after the completion handler of either NSBundleResourceRequest beginAccessingResourcesWithCompletionHandler: or conditionallyBeginAccessingResourcesWithCompletionHandler: is called successfully. Name the assets using Postscript names for individual faces, or family names for variable/collection fonts. The same names can be used to unregister the fonts with CTFontManagerUnregisterFontDescriptors. In iOS, fonts registered with the persistent scope are not automatically available to other processes. Other process may call CTFontManagerRequestFonts to get access to these fonts.
fontAssetNames - Array of font name assets in asset catalog.bundle - Bundle containing asset catalog. A null value resolves to the main bundle.scope - Scope constant defining the availability and lifetime of the registration. kCTFontManagerScopePersistent is the only supported scope for iOS.enabled - Boolean value indicating whether the font assets should be enabled for font descriptor matching and/or discoverable via CTFontManagerRequestFonts.registrationHandler - Block called as errors are discovered, or upon completion. The errors parameter contains an array of CFError references. An empty array indicates no errors. Each error reference will contain a CFArray of font asset names corresponding to kCTFontManagerErrorFontAssetNameKey. These represent the font asset names that were not successfully registered. Note, the handler may be called multiple times during the registration process. The done parameter will be set to true when the registration process has completed. The handler should return false if the operation is to be stopped. This may be desirable after receiving an error.public static CFArrayRef CTFontManagerCopyRegisteredFontDescriptors(int scope, boolean enabled)
Returns the font descriptors that were registered with the font manager.
In the case the persistent scope is specified, only macOS can return fonts registered by any process. Other platforms can only return font descriptors registered by the application's process.
scope - Scope constant defining the availability and lifetime of the registration. See scope constants for more details.enabled - Boolean value indicating if the caller is interested in registered font descriptors that are enabled or disabled.public static void CTFontManagerRequestFonts(CFArrayRef fontDescriptors, CoreText.Block_CTFontManagerRequestFonts completionHandler)
Resolves font descriptors specified on input. On iOS only, if the font descriptors cannot be found, the user is presented with a dialog indicating fonts that could not be resolved. The user may optionally be provided with a way to resolve the missing fonts if the font manager has a way to enable them.
On iOS, fonts registered by font provider applications in the persistent scope are not automatically available to other applications. Client applications must call this function to make the requested fonts available for font descriptor matching.
fontDescriptors - Array of font descriptors to make available to the process. Keys used to describe the fonts may be a combination of: kCTFontNameAttribute, kCTFontFamilyNameAttribute, or kCTFontRegistrationUserInfoAttribute.completionHandler - Block called after request operation completes. Block takes a single parameter containing an array of those descriptors that could not be resolved/found. The array can be empty if all descriptors were resolved.public static CTFramesetterRef CTFramesetterCreateWithTypesetter(CTTypesetterRef typesetter)
Creates a framesetter directly from a typesetter.
Each framesetter uses a typesetter internally to perform line breaking and other contextual analysis based on the characters in a string. This function allows use of a typesetter that was constructed using specific options.
typesetter - The typesetter to be used by the newly-created framesetter.CTTypesetterCreateWithAttributedStringAndOptionspublic static char CTGlyphInfoGetGlyph(CTGlyphInfoRef glyphInfo)
Gets the glyph for a glyph info, if applicable.
This function will return the glyph.
glyphInfo - The glyph info from which you would like the glyph.public static void CTRunGetBaseAdvancesAndOrigins(CTRunRef runRef, CFRange range, CGSize advancesBuffer, CGPoint originsBuffer)
Copies a range of base advances and/or origins into user-provided buffers.
A run's base advances and origins determine the positions of its glyphs but require additional processing before being used for drawing. Similar to the advances returned by CTRunGetAdvances, base advances are the displacement from the origin of a glyph to the origin of the next glyph, except base advances do not include any positioning the font layout tables may have done relative to another glyph (such as a mark relative to its base). The actual position of the current glyph is determined by the displacement of its origin from the starting position, and the position of the next glyph by the displacement of the current glyph's base advance from the starting position.
runRef - The run whose base advances and/or origins you wish to copy.range - The range of values to be copied. If the length of the
range is set to 0, then the copy operation will continue from the
range's start index to the end of the run.advancesBuffer - The buffer where the base advances will be copied to, or NULL.
If not NULL, the buffer must allow for at least as many elements
as specified by the range's length.originsBuffer - The buffer where the origins will be copied to, or NULL. If not
NULL, the buffer must allow for at least as many elements as
specified by the range's length.public static CFStringRef kCTFontFeatureSampleTextKey()
Key to get the font feature sample text.
This key can be used with a font feature dictionary to get the localized sample text as a CFStringRef.
public static CFStringRef kCTFontFeatureTooltipTextKey()
Key to get the font feature tooltip text.
This key can be used with a font feature dictionary to get the localized tooltip text as a CFStringRef.
public static CFStringRef kCTFontManagerErrorFontDescriptorsKey()
User info key to be used with CFError references returned from registration functions.
The value associated with this key in the user info dictionary of a CFError is a CFArray of font descriptors that failed with given error.
public static CFStringRef kCTFontManagerErrorFontAssetNameKey()
User info key to be used with CFError references returned from registration functions.
The value associated with this key in the user info dictionary of a CFError is a CFArray of font asset name strings that failed with given error.
public static CFStringRef kCTFontRegistrationUserInfoAttribute()
Optional user defined information that can be attached to an entry in the Font Manager registration catalog.
This is the key for accessing font registration user information for the font descriptor. This information can be used in descriptor matching to disambiguate between two fonts with equivalent Postscript names. The value associated with this key is a CFStringRef.
public static CFStringRef kCTTypesetterOptionAllowUnboundedLayout()
Allows layout requiring a potentially unbounded amount of work.
Value must be a CFBooleanRef. Default is false for clients linked on or after macOS 10.14 or iOS 12. Proper Unicode layout of some text requires unreasonable effort; unless this option is set to kCFBooleanTrue such inputs will result in CTTypesetterCreateWithAttributedStringAndOptions returning NULL.
public static CFStringRef kCTTrackingAttributeName()
Applies tracking (letterspacing).
Value must be a CFNumber. Default is zero (no tracking). The tracking attribute indicates how much additional space, in points, should be added to each character cluster after layout. The effect of this attribute is similar to kCTKernAttributeName but differs in that the added tracking is treated as trailing whitespace and a non-zero amount disables non-essential ligatures unless overridden by kCTLigatureAttributeName being present. If both kCTKernAttributeName and kCTTrackingAttributeName are present kCTKernAttributeName will be ignored unless zero; kCTTrackingAttributeName will still be honored.
kCTKernAttributeName,
kCTLigatureAttributeNamepublic static CFStringRef CTFontCopyNameForGlyph(CTFontRef font, char glyph)
Returns the name for the specified glyph.
font - The font reference.glyph - The glyph.CTFontGetGlyphWithNamepublic static CFStringRef kCTFontVariationAxesAttribute()
An array of variation axis dictionaries or null if the font does not support variations. Each variation axis dictionary contains the five kCTFontVariationAxis* keys.
public static CFStringRef kCTFontOpticalSizeAttribute()
The point size at which this font is intended to be used.
The value is a CFNumber used to activate size-specific (not linearly scaled) metrics. Starting with macOS 10.14 and iOS 12.0, the CFString "auto" can be used instead to request an optical size matching the point size. Starting with macOS 10.15 and iOS 13.0, the CFString "none" can be used instead to explicitly disable automatic optical sizing enabled by the font.
public static CFArrayRef CTFontCollectionCopyFontAttribute(CTFontCollectionRef collection, CFStringRef attributeName, int options)
Returns an array of font descriptor attribute values.
collection - The font collection reference.attributeName - The attribute to retrieve for each descriptor in the collection.options - Options to alter the return value.public static CFArrayRef CTFontCollectionCopyFontAttributes(CTFontCollectionRef collection, CFSetRef attributeNames, int options)
Returns an array of dictionaries containing font descriptor attribute values.
collection - The font collection reference.attributeNames - The attributes to retrieve for each descriptor in the collection.options - Options to alter the return value.