Class CoreText


  • public final class CoreText
    extends java.lang.Object
    • Method Detail

      • CTParagraphStyleGetTypeID

        public static long CTParagraphStyleGetTypeID()
        [@function] CTParagraphStyleGetTypeID Returns the CFType of the paragraph style object
      • CTParagraphStyleCreate

        public static CTParagraphStyleRef CTParagraphStyleCreate​(CTParagraphStyleSetting settings,
                                                                 long settingCount)
        [@function] CTParagraphStyleCreate 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.
        Parameters:
        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.
        Returns:
        If the paragraph style creation was successful, this function will return a valid reference to an immutable CTParagraphStyle object. Otherwise, this function will return NULL.
      • CTParagraphStyleCreateCopy

        public static CTParagraphStyleRef CTParagraphStyleCreateCopy​(CTParagraphStyleRef paragraphStyle)
        [@function] CTParagraphStyleCreateCopy Creates an immutable copy of a paragraph style.
        Parameters:
        paragraphStyle - The style that you wish to copy.
        Returns:
        If the "paragraphStyle" reference is valid, then this function will return valid reference to an immutable CTParagraphStyle object that is a copy of the one passed into "paragraphStyle".
      • CTParagraphStyleGetValueForSpecifier

        public static boolean CTParagraphStyleGetValueForSpecifier​(CTParagraphStyleRef paragraphStyle,
                                                                   int spec,
                                                                   long valueBufferSize,
                                                                   org.moe.natj.general.ptr.VoidPtr valueBuffer)
        [@function] CTParagraphStyleGetValueForSpecifier 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.
        Parameters:
        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".
        Returns:
        This function will return "true" if the valueBuffer had been successfully filled. Otherwise, this function will return false, indicating that one or more of the parameters is not valid.
      • CTFontDescriptorGetTypeID

        public static long CTFontDescriptorGetTypeID()
        [@function] CTFontDescriptorGetTypeID Returns the type identifier for Core Text font descriptor references.
        Returns:
        The identifier for the opaque type CTFontDescriptorRef.
      • CTFontDescriptorCreateWithNameAndSize

        public static CTFontDescriptorRef CTFontDescriptorCreateWithNameAndSize​(CFStringRef name,
                                                                                double size)
        [@function] CTFontDescriptorCreateWithNameAndSize 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.
        Parameters:
        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.
        Returns:
        This function creates a new font descriptor reference with the given PostScript name and point size.
      • CTFontDescriptorCreateWithAttributes

        public static CTFontDescriptorRef CTFontDescriptorCreateWithAttributes​(CFDictionaryRef attributes)
        [@function] CTFontDescriptorCreateWithAttributes Creates a new font descriptor reference from a dictionary of attributes.
        Parameters:
        attributes - A CFDictionaryRef of arbitrary attributes.
        Returns:
        This function creates a new font descriptor with the attributes specified. This dictionary can contain arbitrary attributes that will be preserved, however unrecognized attributes will be ignored on font creation and and may not be preserved over the round trip (descriptor -> font -> descriptor).
      • CTFontDescriptorCreateCopyWithAttributes

        public static CTFontDescriptorRef CTFontDescriptorCreateCopyWithAttributes​(CTFontDescriptorRef original,
                                                                                   CFDictionaryRef attributes)
        [@function] CTFontDescriptorCreateCopyWithAttributes Creates a copy of the original font descriptor with new attributes.
        Parameters:
        original - The original font descriptor reference.
        attributes - A CFDictionaryRef of arbitrary attributes.
        Returns:
        This function creates a new copy of the original font descriptor with attributes augmented by those specified. If there are conflicts between attributes, the new attributes will replace existing ones, except for kCTFontVariationAttribute and kCTFontFeatureSettingsAttribute which will be merged. 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.
      • CTFontDescriptorCreateCopyWithFamily

        public static CTFontDescriptorRef CTFontDescriptorCreateCopyWithFamily​(CTFontDescriptorRef original,
                                                                               CFStringRef family)
        [@function] CTFontCreateCopyWithFamily Returns a new font descriptor in the specified family based on the traits of the original descriptor.
        Parameters:
        original - The original font descriptor reference.
        family - The name of the desired family.
        Returns:
        Returns a new font reference with the original traits in the given family, or NULL if none found in the system.
      • CTFontDescriptorCreateCopyWithSymbolicTraits

        public static CTFontDescriptorRef CTFontDescriptorCreateCopyWithSymbolicTraits​(CTFontDescriptorRef original,
                                                                                       int symTraitValue,
                                                                                       int symTraitMask)
        [@function] CTFontDescriptorCreateCopyWithSymbolicTraits Returns a new font descriptor based on the original descriptor having the specified symbolic traits.
        Parameters:
        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.
        Returns:
        Returns a new font descriptor reference in the same family with the given symbolic traits, or NULL if none found in the system.
      • CTFontDescriptorCreateCopyWithVariation

        public static CTFontDescriptorRef CTFontDescriptorCreateCopyWithVariation​(CTFontDescriptorRef original,
                                                                                  CFNumberRef variationIdentifier,
                                                                                  double variationValue)
        [@function] CTFontDescriptorCreateCopyWithVariation Creates a copy of the original font descriptor with a new variation instance.
        Parameters:
        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.
        Returns:
        This function returns a copy of the original font descriptor with a new variation instance. This is a convenience method for easily creating new variation font instances.
      • CTFontDescriptorCreateCopyWithFeature

        public static CTFontDescriptorRef CTFontDescriptorCreateCopyWithFeature​(CTFontDescriptorRef original,
                                                                                CFNumberRef featureTypeIdentifier,
                                                                                CFNumberRef featureSelectorIdentifier)
        [@function] CTFontDescriptorCreateCopyWithFeature Copies a font descriptor with new feature setting. This is a convenience method to more easily toggle the state of individual features.
        Parameters:
        original - The original font descriptor reference.
        featureTypeIdentifier - The feature type identifier.
        featureSelectorIdentifier - The feature selector identifier.
        Returns:
        A copy of the original font descriptor modified with the given feature settings.
      • CTFontDescriptorCreateMatchingFontDescriptors

        public static CFArrayRef CTFontDescriptorCreateMatchingFontDescriptors​(CTFontDescriptorRef descriptor,
                                                                               CFSetRef mandatoryAttributes)
        [@function] CTFontDescriptorCreateMatchingFontDescriptors Returns an array of font normalized font descriptors matching the provided descriptor.
        Parameters:
        descriptor - The font descriptor reference.
        mandatoryAttributes - A set of attribute keys which are required to be identically matched in any returned font descriptors. Optional.
        Returns:
        This function returns a retained array of normalized font descriptors matching the attributes present in descriptor. If descriptor itself is normalized then the array will contain only one item, the original descriptor.
      • CTFontDescriptorCreateMatchingFontDescriptor

        public static CTFontDescriptorRef CTFontDescriptorCreateMatchingFontDescriptor​(CTFontDescriptorRef descriptor,
                                                                                       CFSetRef mandatoryAttributes)
        [@function] CTFontDescriptorCreateMatchingFontDescriptor Returns an the single preferred matching font descriptor based on the original descriptor and system precedence.
        Parameters:
        descriptor - The font descriptor reference.
        mandatoryAttributes - A set of attribute keys which are required to be identically matched in any returned font descriptors. Optional.
        Returns:
        This function returns a retained normalized font descriptor matching the attributes present in descriptor. The original descriptor may be returned in normalized form.
      • CTFontDescriptorMatchFontDescriptorsWithProgressHandler

        public 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. The progress is notified via progressBlock.
        Parameters:
        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.
        Returns:
        false if it couldn't start the work.
      • CTFontDescriptorCopyAttributes

        public static CFDictionaryRef CTFontDescriptorCopyAttributes​(CTFontDescriptorRef descriptor)
        [@function] CTFontDescriptorCopyAttributes Returns the attributes dictionary of the font descriptor.
        Parameters:
        descriptor - The font descriptor reference.
        Returns:
        A retained reference to the font descriptor attributes dictionary. This dictionary will contain the minimum number of attributes to fully specify this particular font descriptor.
      • CTFontDescriptorCopyAttribute

        public static org.moe.natj.general.ptr.ConstVoidPtr CTFontDescriptorCopyAttribute​(CTFontDescriptorRef descriptor,
                                                                                          CFStringRef attribute)
        [@function] CTFontDescriptorCopyAttribute Returns the value associated with an arbitrary attribute.
        Parameters:
        descriptor - The font descriptor.
        attribute - The requested attribute.
        Returns:
        A retained reference to the requested attribute, or NULL if the requested attribute is not present. Refer to the attribute definitions for documentation as to how each attribute is packaged as a CFType.
      • CTFontDescriptorCopyLocalizedAttribute

        public static org.moe.natj.general.ptr.ConstVoidPtr CTFontDescriptorCopyLocalizedAttribute​(CTFontDescriptorRef descriptor,
                                                                                                   CFStringRef attribute,
                                                                                                   org.moe.natj.general.ptr.Ptr<CFStringRef> language)
        function CTFontDescriptorCopyLocalizedAttribute 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.
        Parameters:
        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.
        Returns:
        A retained reference to the requested attribute, or NULL if the requested attribute is not present. Refer to the attribute definitions for documentation as to how each attribute is packaged as a CFType.
      • CTFontGetTypeID

        public static long CTFontGetTypeID()
        [@function] CTFontGetTypeID Returns the type identifier for Core Text font references.
        Returns:
        The identifier for the opaque type CTFontRef.
      • CTFontCreateWithName

        public static CTFontRef CTFontCreateWithName​(CFStringRef name,
                                                     double size,
                                                     CGAffineTransform matrix)
        [@function] CTFontCreateWithName 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.
        Parameters:
        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.
        Returns:
        This function will return a CTFontRef that best matches the name provided with size and matrix attributes. The name parameter is the only required parameters, and default values will be used for unspecified parameters. A best match will be found if all parameters cannot be matched identically.
      • CTFontCreateWithFontDescriptor

        public static CTFontRef CTFontCreateWithFontDescriptor​(CTFontDescriptorRef descriptor,
                                                               double size,
                                                               CGAffineTransform matrix)
        [@function] CTFontCreateWithFontDescriptor Returns a new font reference that best matches the font descriptor.
        Parameters:
        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.
        Returns:
        This function will return a CTFontRef that best matches the attributes provided with the font descriptor. The size and matrix parameters will override any specified in the font descriptor, unless they are unspecified. A best match font will always be returned, and default values will be used for any unspecified.
      • CTFontCreateWithNameAndOptions

        public static CTFontRef CTFontCreateWithNameAndOptions​(CFStringRef name,
                                                               double size,
                                                               CGAffineTransform matrix,
                                                               long options)
        [@function] CTFontCreateWithNameAndOptions 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.
        Parameters:
        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.
        Returns:
        This function will return a CTFontRef that best matches the name provided with size and matrix attributes. The name parameter is the only required parameters, and default values will be used for unspecified parameters. A best match will be found if all parameters cannot be matched identically.
      • CTFontCreateWithFontDescriptorAndOptions

        public static CTFontRef CTFontCreateWithFontDescriptorAndOptions​(CTFontDescriptorRef descriptor,
                                                                         double size,
                                                                         CGAffineTransform matrix,
                                                                         long options)
        [@function] CTFontCreateWithFontDescriptorAndOptions Returns a new font reference that best matches the font descriptor.
        Parameters:
        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.
        Returns:
        This function will return a CTFontRef that best matches the attributes provided with the font descriptor. The size and matrix parameters will override any specified in the font descriptor, unless they are unspecified. A best match font will always be returned, and default values will be used for any unspecified.
      • CTFontCreateUIFontForLanguage

        public static CTFontRef CTFontCreateUIFontForLanguage​(int uiType,
                                                              double size,
                                                              CFStringRef language)
        [@function] CTFontCreateUIFontForLanguage Returns the special UI font for the given language and UI type.
        Parameters:
        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.
        Returns:
        This function returns the correct font for various UI uses. The only required parameter is the uiType selector, unspecified optional parameters will use default values.
      • CTFontCreateCopyWithAttributes

        public static CTFontRef CTFontCreateCopyWithAttributes​(CTFontRef font,
                                                               double size,
                                                               CGAffineTransform matrix,
                                                               CTFontDescriptorRef attributes)
        [@function] CTFontCreateCopyWithAttributes 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.
        Parameters:
        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.
        Returns:
        Returns a new font reference converted from the original with the specified attributes.
      • CTFontCreateCopyWithSymbolicTraits

        public static CTFontRef CTFontCreateCopyWithSymbolicTraits​(CTFontRef font,
                                                                   double size,
                                                                   CGAffineTransform matrix,
                                                                   int symTraitValue,
                                                                   int symTraitMask)
        [@function] CTFontCreateCopyWithSymbolicTraits Returns a new font based on the original font with the specified symbolic traits.
        Parameters:
        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.
        Returns:
        Returns a new font reference in the same family with the given symbolic traits, or NULL if none found in the system.
      • CTFontCreateCopyWithFamily

        public static CTFontRef CTFontCreateCopyWithFamily​(CTFontRef font,
                                                           double size,
                                                           CGAffineTransform matrix,
                                                           CFStringRef family)
        [@function] CTFontCreateCopyWithFamily Returns a new font in the specified family based on the traits of the original font.
        Parameters:
        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.
        Returns:
        Returns a new font reference with the original traits in the given family. NULL if non found in the system.
      • CTFontCopyFontDescriptor

        public static CTFontDescriptorRef CTFontCopyFontDescriptor​(CTFontRef font)
        [@function] CTFontCopyFontDescriptor Returns the normalized font descriptors for the given font reference.
        Parameters:
        font - The font reference.
        Returns:
        This function returns a normalized font descriptor for a font. The font descriptor contains enough information to recreate this font at a later time.
      • CTFontCopyAttribute

        public static org.moe.natj.general.ptr.ConstVoidPtr CTFontCopyAttribute​(CTFontRef font,
                                                                                CFStringRef attribute)
        [@function] CTFontCopyAttribute Returns the value associated with an arbitrary attribute.
        Parameters:
        font - The font reference.
        attribute - The requested attribute.
        Returns:
        This function returns a retained reference to an arbitrary attribute. If the requested attribute is not present, NULL is returned. Refer to the attribute definitions for documentation as to how each attribute is packaged as a CFType.
      • CTFontGetSize

        public static double CTFontGetSize​(CTFontRef font)
        [@function] CTFontGetSize Returns the point size of the font reference.
        Parameters:
        font - The font reference.
        Returns:
        This function returns the point size of the given font reference. This is the point size provided when the font was created.
      • CTFontGetMatrix

        public static CGAffineTransform CTFontGetMatrix​(CTFontRef font)
        [@function] CTFontGetMatrix Returns the transformation matrix of the font.
        Parameters:
        font - The font reference.
        Returns:
        This function returns the transformation matrix for this given font reference. This is the matrix that was provided when the font was created.
      • CTFontGetSymbolicTraits

        public static int CTFontGetSymbolicTraits​(CTFontRef font)
        [@function] CTFontGetSymbolicTraits Returns the symbolic font traits.
        Parameters:
        font - The font reference.
        Returns:
        This function returns the symbolic traits of the font. This is equivalent to the kCTFontSymbolicTrait of traits dictionary. See CTFontTraits.h for a definition of the font traits.
      • CTFontCopyTraits

        public static CFDictionaryRef CTFontCopyTraits​(CTFontRef font)
        [@function] CTFontCopyTraits Returns the font traits dictionary.
        Parameters:
        font - The font reference.
        Returns:
        This function returns a retained reference to the font traits dictionary. Individual traits can be accessed with the trait key constants. See CTFontTraits.h for a definition of the font traits.
      • CTFontCopyPostScriptName

        public static CFStringRef CTFontCopyPostScriptName​(CTFontRef font)
        [@function] CTFontCopyPostScriptName Returns the PostScript name.
        Parameters:
        font - The font reference.
        Returns:
        This function returns a retained reference to the PostScript name of the font.
      • CTFontCopyFamilyName

        public static CFStringRef CTFontCopyFamilyName​(CTFontRef font)
        [@function] CTFontCopyFamilyName Returns the family name.
        Parameters:
        font - The font reference.
        Returns:
        This function returns a retained reference to the family name of the font.
      • CTFontCopyFullName

        public static CFStringRef CTFontCopyFullName​(CTFontRef font)
        [@function] CTFontCopyFullName Returns the display name.
        Parameters:
        font - The font reference.
        Returns:
        This function returns a retained reference to the full name of the font.
      • CTFontCopyDisplayName

        public static CFStringRef CTFontCopyDisplayName​(CTFontRef font)
        [@function] CTFontCopyDisplayName Returns the display name.
        Parameters:
        font - The font reference.
        Returns:
        This function returns a retained reference to the localized display name of the font.
      • CTFontCopyName

        public static CFStringRef CTFontCopyName​(CTFontRef font,
                                                 CFStringRef nameKey)
        [@function] CTFontCopyName Returns a reference to the requested name.
        Parameters:
        font - The font reference.
        nameKey - The name specifier. See name specifier constants.
        Returns:
        This function creates the requested name for the font, or NULL if the font does not have an entry for the requested name. The Unicode version of the name will be preferred, otherwise the first available will be used.
      • CTFontCopyLocalizedName

        public static CFStringRef CTFontCopyLocalizedName​(CTFontRef font,
                                                          CFStringRef nameKey,
                                                          org.moe.natj.general.ptr.Ptr<CFStringRef> actualLanguage)
        [@function] CTFontCopyLocalizedName Returns a reference to a localized font name.
        Parameters:
        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.
        Returns:
        This function returns a specific localized name from the font reference. The name is localized based on the user's global language precedence. If the font does not have an entry for the requested name, NULL will be returned. The matched language will be returned in the caller's buffer.
      • CTFontCopyCharacterSet

        public static CFCharacterSetRef CTFontCopyCharacterSet​(CTFontRef font)
        [@function] CTFontCopyCharacterSet Returns the Unicode character set of the font.
        Parameters:
        font - The font reference.
        Returns:
        This function returns a retained reference to the font's character set. This character set covers the nominal referenced by the font's Unicode cmap table (or equivalent).
      • CTFontGetStringEncoding

        public static int CTFontGetStringEncoding​(CTFontRef font)
        [@function] CTFontGetStringEncoding Returns the best string encoding for legacy format support.
        Parameters:
        font - The font reference.
        Returns:
        This function returns the best string encoding for the font.
      • CTFontCopySupportedLanguages

        public static CFArrayRef CTFontCopySupportedLanguages​(CTFontRef font)
        [@function] CTFontCopySupportedLanguages Returns an array of languages supported by the font.
        Parameters:
        font - The font reference.
        Returns:
        This function returns a retained reference to an array of languages supported by the font. The array contains language identifier strings as CFStringRefs. The format of the language identifier will conform to UTS #35.
      • CTFontGetGlyphsForCharacters

        public static boolean CTFontGetGlyphsForCharacters​(CTFontRef font,
                                                           org.moe.natj.general.ptr.ConstCharPtr characters,
                                                           org.moe.natj.general.ptr.CharPtr glyphs,
                                                           long count)
        [@function] CTFontGetGlyphsForCharacters 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.
        Parameters:
        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.
        Returns:
        The return value indicates whether all provided characters were successfully mapped. A return value of true indicates that the font mapped all characters. A return value of false indicates that some or all of the characters were not mapped; glyphs for unmapped characters will be 0 (with the exception of those corresponding non-BMP characters as described above).
        See Also:
        CTFontCopyCharacterSet(apple.coretext.opaque.CTFontRef)
      • CTFontGetAscent

        public static double CTFontGetAscent​(CTFontRef font)
        [@function] CTFontGetAscent Returns the scaled font ascent metric.
        Parameters:
        font - The font reference.
        Returns:
        This function returns the font ascent metric scaled based on the point size and matrix of the font reference.
      • CTFontGetDescent

        public static double CTFontGetDescent​(CTFontRef font)
        [@function] CTFontGetDescent Returns the scaled font descent metric.
        Parameters:
        font - The font reference.
        Returns:
        This function returns the font descent metric scaled based on the point size and matrix of the font reference.
      • CTFontGetLeading

        public static double CTFontGetLeading​(CTFontRef font)
        [@function] CTFontGetLeading Returns the scaled font leading metric.
        Parameters:
        font - The font reference.
        Returns:
        This function returns the font leading metric scaled based on the point size and matrix of the font reference.
      • CTFontGetUnitsPerEm

        public static int CTFontGetUnitsPerEm​(CTFontRef font)
        [@function] CTFontGetUnitsPerEm Returns the units per em metric.
        Parameters:
        font - The font reference.
        Returns:
        This function returns the units per em of the font.
      • CTFontGetGlyphCount

        public static long CTFontGetGlyphCount​(CTFontRef font)
        [@function] CTFontGetGlyphCount Returns the number of glyphs.
        Parameters:
        font - The font reference.
        Returns:
        This function returns the number of glyphs in the font.
      • CTFontGetBoundingBox

        public static CGRect CTFontGetBoundingBox​(CTFontRef font)
        [@function] CTFontGetBoundingBox Returns the scaled bounding box.
        Parameters:
        font - The font reference.
        Returns:
        This will return the design bounding box of the font, which is the rectangle defined by xMin, yMin, xMax, and yMax values for the font.
      • CTFontGetUnderlinePosition

        public static double CTFontGetUnderlinePosition​(CTFontRef font)
        [@function] CTFontGetUnderlinePosition Returns the scaled underline position.
        Parameters:
        font - The font reference.
        Returns:
        This function returns the font underline position metric scaled based on the point size and matrix of the font reference.
      • CTFontGetUnderlineThickness

        public static double CTFontGetUnderlineThickness​(CTFontRef font)
        [@function] CTFontGetUnderlineThickness Returns the scaled underline thickness metric.
        Parameters:
        font - The font reference.
        Returns:
        This function returns the font underline thickness metric scaled based on the point size and matrix of the font reference.
      • CTFontGetSlantAngle

        public static double CTFontGetSlantAngle​(CTFontRef font)
        [@function] CTFontGetSlantAngle Returns the slant angle of the font.
        Parameters:
        font - The font reference.
        Returns:
        This function returns the transformed slant angle of the font. This is equivalent to the italic or caret angle with any skew from the transformation matrix applied.
      • CTFontGetCapHeight

        public static double CTFontGetCapHeight​(CTFontRef font)
        [@function] CTFontGetCapHeight Returns the cap height metric.
        Parameters:
        font - The font reference.
        Returns:
        This function returns the font cap height metric scaled based on the point size and matrix of the font reference.
      • CTFontGetXHeight

        public static double CTFontGetXHeight​(CTFontRef font)
        [@function] CTFontGetXHeight Returns the X height metric.
        Parameters:
        font - The font reference.
        Returns:
        This function returns the font X height metric scaled based on the point size and matrix of the font reference.
      • CTFontGetGlyphWithName

        public static char CTFontGetGlyphWithName​(CTFontRef font,
                                                  CFStringRef glyphName)
        [@function] CTFontGetGlyphWithName Returns the CGGlyph for the specified glyph name.
        Parameters:
        font - The font reference.
        glyphName - The glyph name as a CFString.
        Returns:
        The glyph with the specified name or 0 if the name is not recognized; this glyph can be used with other Core Text glyph data accessors or with Quartz.
      • CTFontGetBoundingRectsForGlyphs

        public static CGRect CTFontGetBoundingRectsForGlyphs​(CTFontRef font,
                                                             int orientation,
                                                             org.moe.natj.general.ptr.ConstCharPtr glyphs,
                                                             CGRect boundingRects,
                                                             long count)
        [@function] CTFontGetBoundingRectsForGlyphs Calculates the bounding rects for an array of glyphs and returns the overall bounding rect for the run.
        Parameters:
        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.
        Returns:
        This function returns the overall bounding rectangle for an array or run of glyphs. The bounding rects of the individual glyphs are returned through the boundingRects parameter. These are the design metrics from the font transformed in font space.
      • CTFontGetOpticalBoundsForGlyphs

        public static CGRect CTFontGetOpticalBoundsForGlyphs​(CTFontRef font,
                                                             org.moe.natj.general.ptr.ConstCharPtr glyphs,
                                                             CGRect boundingRects,
                                                             long count,
                                                             long options)
        [@function] CTFontGetOpticalBoundsForGlyphs 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).
        Parameters:
        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.
        Returns:
        This function returns the overall bounding rectangle for an array or run of glyphs. The bounding rects of the individual glyphs are returned through the boundingRects parameter. These are the design metrics from the font transformed in font space.
      • CTFontGetAdvancesForGlyphs

        public static double CTFontGetAdvancesForGlyphs​(CTFontRef font,
                                                        int orientation,
                                                        org.moe.natj.general.ptr.ConstCharPtr glyphs,
                                                        CGSize advances,
                                                        long count)
        [@function] CTFontGetAdvancesForGlyphs Calculates the advances for an array of glyphs and returns the summed advance.
        Parameters:
        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.
        Returns:
        This function returns the summed glyph advance of an array of glyphs. Individual glyph advances are passed back via the advances parameter. These are the ideal metrics for each glyph scaled and transformed in font space.
      • CTFontGetVerticalTranslationsForGlyphs

        public static void CTFontGetVerticalTranslationsForGlyphs​(CTFontRef font,
                                                                  org.moe.natj.general.ptr.ConstCharPtr glyphs,
                                                                  CGSize translations,
                                                                  long count)
        [@function] CTFontGetVerticalTranslationsForGlyphs Calculates the offset from the default (horizontal) origin to the vertical origin for an array of glyphs.
        Parameters:
        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.
      • CTFontCreatePathForGlyph

        public static CGPathRef CTFontCreatePathForGlyph​(CTFontRef font,
                                                         char glyph,
                                                         CGAffineTransform matrix)
        [@function] CTFontCreatePathForGlyph 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.
        Parameters:
        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.
        Returns:
        A retained CGPath reference containing the glyph outlines or NULL if there is no such glyph or it has no outline.
      • CTFontCopyVariationAxes

        public static CFArrayRef CTFontCopyVariationAxes​(CTFontRef font)
        [@function] CTFontCopyVariationAxes Returns an array of variation axis dictionaries.
        Parameters:
        font - The font reference.
        Returns:
        This function returns an array of variation axis dictionaries or null if the font does not support variations. Each variation axis dictionary contains the five kCTFontVariationAxis* keys above.
      • CTFontCopyVariation

        public static CFDictionaryRef CTFontCopyVariation​(CTFontRef font)
        [@function] CTFontCopyVariation 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.
        Parameters:
        font - The font reference.
        Returns:
        This function returns a variation dictionary or null if the font does not support variations.
        See Also:
        kCTFontVariationAxisIdentifierKey(), kCTFontVariationAxisDefaultValueKey()
      • CTFontCopyFeatures

        public static CFArrayRef CTFontCopyFeatures​(CTFontRef font)
        [@function] CTFontCopyFeatures Returns an array of font features
        Parameters:
        font - The font reference.
        Returns:
        This function returns an array of font feature dictionaries for the font reference.
      • CTFontCopyFeatureSettings

        public static CFArrayRef CTFontCopyFeatureSettings​(CTFontRef font)
        [@function] CTFontCopyFeatureSettings 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.
        Parameters:
        font - The font reference.
        Returns:
        This function returns a normalized array of font feature setting dictionaries. The array will only contain the non-default settings that should be applied to the font, or NULL if the default settings should be used.
      • CTFontCopyGraphicsFont

        public static CGFontRef CTFontCopyGraphicsFont​(CTFontRef font,
                                                       org.moe.natj.general.ptr.Ptr<CTFontDescriptorRef> attributes)
        [@function] CTFontCopyGraphicsFont Returns a CGFontRef and attributes.
        Parameters:
        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.
        Returns:
        This function returns a CGFontRef for the given font reference. Additional attributes from the font will be passed back as a font descriptor via the attributes parameter. The result must be released by the caller.
      • CTFontCreateWithGraphicsFont

        public static CTFontRef CTFontCreateWithGraphicsFont​(CGFontRef graphicsFont,
                                                             double size,
                                                             CGAffineTransform matrix,
                                                             CTFontDescriptorRef attributes)
        [@function] CTFontCreateWithGraphicsFont Creates a new font reference from a CGFontRef.
        Parameters:
        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.
        Returns:
        This function returns a new font reference for an existing CGFontRef with the specified size, matrix, and additional attributes.
      • CTFontCopyAvailableTables

        public static CFArrayRef CTFontCopyAvailableTables​(CTFontRef font,
                                                           int options)
        [@function] CTFontCopyAvailableTables Returns an array of font table tags.
        Parameters:
        font - The font reference.
        options - The options used when copying font tables.
        Returns:
        This function returns an array of CTFontTableTag values for the given font and the supplied options. The returned set will contain unboxed values, which may be extracted like so: CTFontTableTag tag = (CTFontTableTag)(uintptr_t)CFArrayGetValueAtIndex(tags, index);
      • CTFontCopyTable

        public static CFDataRef CTFontCopyTable​(CTFontRef font,
                                                int table,
                                                int options)
        [@function] CTFontCopyTable Returns a reference to the font table data.
        Parameters:
        font - The font reference.
        table - The font table identifier as a CTFontTableTag.
        options - The options used when copying font table.
        Returns:
        This function returns a retained reference to the font table data as CFDataRef or NULL if the table is not present.
      • CTFontDrawGlyphs

        public static void CTFontDrawGlyphs​(CTFontRef font,
                                            org.moe.natj.general.ptr.ConstCharPtr glyphs,
                                            CGPoint positions,
                                            long count,
                                            CGContextRef context)
        [@function] CTFontDrawGlyphs 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.
        Parameters:
        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.
      • CTFontGetLigatureCaretPositions

        public static long CTFontGetLigatureCaretPositions​(CTFontRef font,
                                                           char glyph,
                                                           org.moe.natj.general.ptr.NFloatPtr positions,
                                                           long maxPositions)
        [@function] CTFontGetLigatureCaretPositions 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.
        Parameters:
        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.
        Returns:
        Returns the number of caret positions for the specified glyph.
      • CTFontCopyDefaultCascadeListForLanguages

        public static CFArrayRef CTFontCopyDefaultCascadeListForLanguages​(CTFontRef font,
                                                                          CFArrayRef languagePrefList)
        [@function] CTFontCopyDefaultCascadeListForLanguages 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.
        Parameters:
        font - The font reference.
        languagePrefList - The language preference list - ordered array of CFStringRef's of ISO language codes.
        Returns:
        The ordered list of fallback fonts - ordered array of CTFontDescriptors.
      • CTFontCollectionGetTypeID

        public static long CTFontCollectionGetTypeID()
        [@function] CTFontCollectionGetTypeID Returns the type identifier for Core Text font collection references.
        Returns:
        The identifier for the opaque types CTFontCollectionRef or CTMutableFontCollectionRef.
      • CTFontCollectionCreateFromAvailableFonts

        public static CTFontCollectionRef CTFontCollectionCreateFromAvailableFonts​(CFDictionaryRef options)
        [@function] CTFontCollectionCreateFromAvailableFonts Returns a new font collection matching all available fonts.
        Parameters:
        options - The options dictionary. See constant option keys.
        Returns:
        This function creates a new collection containing all fonts available to the current application.
      • CTFontCollectionCreateWithFontDescriptors

        public static CTFontCollectionRef CTFontCollectionCreateWithFontDescriptors​(CFArrayRef queryDescriptors,
                                                                                    CFDictionaryRef options)
        [@function] CTFontCollectionCreateWithFontDescriptors Returns a new collection based on the array of font descriptors.
        Parameters:
        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.
        Returns:
        This function creates a new collection based on the provided font descriptors. The contents of this collection is defined by matching the provided descriptors against all available font descriptors.
      • CTFontCollectionCreateCopyWithFontDescriptors

        public static CTFontCollectionRef CTFontCollectionCreateCopyWithFontDescriptors​(CTFontCollectionRef original,
                                                                                        CFArrayRef queryDescriptors,
                                                                                        CFDictionaryRef options)
        [@function] CTFontCollectionCreateCopyWithFontDescriptors Returns a copy of the original collection augmented with the new font descriptors.
        Parameters:
        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.
        Returns:
        This function creates a copy of the original font collection augmented by the new font descriptors and options. The new font descriptors are merged with the existing descriptors to create a single set.
      • CTFontCollectionCreateMatchingFontDescriptors

        public static CFArrayRef CTFontCollectionCreateMatchingFontDescriptors​(CTFontCollectionRef collection)
        [@function] CTFontCollectionCreateMatchingFontDescriptors Returns an array of font descriptors matching the collection.
        Parameters:
        collection - The font collection reference.
        Returns:
        An array of CTFontDescriptors matching the collection definition or NULL if there are none.
      • CTFontCollectionCreateMatchingFontDescriptorsSortedWithCallback

        public static CFArrayRef CTFontCollectionCreateMatchingFontDescriptorsSortedWithCallback​(CTFontCollectionRef collection,
                                                                                                 CoreText.Function_CTFontCollectionCreateMatchingFontDescriptorsSortedWithCallback sortCallback,
                                                                                                 org.moe.natj.general.ptr.VoidPtr refCon)
        [@function] CTFontCollectionCreateMatchingFontDescriptorsSortedWithCallback Returns the array of matching font descriptors sorted with the callback function.
        Parameters:
        collection - The collection reference.
        sortCallback - The sorting callback function that defines the sort order.
        refCon - Pointer to client data define context for the callback.
        Returns:
        An array of CTFontDescriptors matching the criteria of the collection, sorted by the results of the sorting callback function, or NULL if there are none.
      • CTFontManagerCopyAvailablePostScriptNames

        public static CFArrayRef CTFontManagerCopyAvailablePostScriptNames()
        [@function] CTFontManagerCopyAvailablePostScriptNames Returns an array of unique PostScript font names.
        Returns:
        An array of CFStrings.
      • CTFontManagerCopyAvailableFontFamilyNames

        public static CFArrayRef CTFontManagerCopyAvailableFontFamilyNames()
        [@function] CTFontManagerCopyAvailableFontFamilyNames Returns an array of visible font family names sorted for UI display.
        Returns:
        An array of CFStrings.
      • CTFontManagerCreateFontDescriptorsFromURL

        public static CFArrayRef CTFontManagerCreateFontDescriptorsFromURL​(CFURLRef fileURL)
        [@function] CTFontManagerCreateFontDescriptorsFromURL 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.
        Parameters:
        fileURL - A file system URL referencing a valid font file.
        Returns:
        An array of CTFontDescriptors or NULL if there are no valid fonts.
      • CTFontManagerCreateFontDescriptorFromData

        public static CTFontDescriptorRef CTFontManagerCreateFontDescriptorFromData​(CFDataRef data)
        [@function] CTFontManagerCreateFontDescriptorFromData 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.
        Parameters:
        data - A CFData containing font data.
        Returns:
        A font descriptor created from the data or NULL if it is not a valid font.
      • CTFontManagerRegisterFontsForURL

        public static boolean CTFontManagerRegisterFontsForURL​(CFURLRef fontURL,
                                                               int scope,
                                                               org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
        [@function] CTFontManagerRegisterFontsForURL Registers fonts from the specified font URL with the font manager. Registered fonts participate in font descriptor matching.
        Parameters:
        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.
        Returns:
        Returns true if registration of the fonts was successful.
      • CTFontManagerUnregisterFontsForURL

        public static boolean CTFontManagerUnregisterFontsForURL​(CFURLRef fontURL,
                                                                 int scope,
                                                                 org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
        [@function] CTFontManagerUnregisterFontsForURL 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.
        Parameters:
        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.
        Returns:
        Returns true if unregistration of the fonts was successful.
      • CTFontManagerRegisterGraphicsFont

        public static boolean CTFontManagerRegisterGraphicsFont​(CGFontRef font,
                                                                org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
        [@function] CTFontManagerRegisterGraphicsFont 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.
        Parameters:
        font - Graphics font to be registered.
        error - Pointer to receive CFError in the case of failed registration.
        Returns:
        Returns true if registration of the fonts was successful.
      • CTFontManagerUnregisterGraphicsFont

        public static boolean CTFontManagerUnregisterGraphicsFont​(CGFontRef font,
                                                                  org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
        [@function] CTFontManagerUnregisterGraphicsFont Unregisters the specified graphics font with the font manager. Unregistered fonts do not participate in font descriptor matching.
        Parameters:
        font - Graphics font to be unregistered.
        error - Pointer to receive CFError in the case of failed unregistration.
        Returns:
        Returns true if unregistration of the font was successful.
      • CTFontManagerRegisterFontsForURLs

        public static boolean CTFontManagerRegisterFontsForURLs​(CFArrayRef fontURLs,
                                                                int scope,
                                                                org.moe.natj.general.ptr.Ptr<CFArrayRef> errors)
        [@function] CTFontManagerRegisterFontsForURLs Registers fonts from the specified font URLs with the font manager. Registered fonts are discoverable through font descriptor matching.
        Parameters:
        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.
        Returns:
        Returns true if registration of all font URLs was successful. Otherwise false.
      • CTFontManagerUnregisterFontsForURLs

        public static boolean CTFontManagerUnregisterFontsForURLs​(CFArrayRef fontURLs,
                                                                  int scope,
                                                                  org.moe.natj.general.ptr.Ptr<CFArrayRef> errors)
        [@function] CTFontManagerUnregisterFontsForURLs 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.
        Parameters:
        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.
        Returns:
        Returns true if unregistration of all font URLs was successful. Otherwise false.
      • CTFrameGetTypeID

        public static long CTFrameGetTypeID()
        [@function] CTFrameGetTypeID Returns the CFType of the frame object
      • CTFrameGetStringRange

        public static CFRange CTFrameGetStringRange​(CTFrameRef frame)
        [@function] CTFrameGetStringRange Returns the range of characters that were originally requested to fill the frame.
        Parameters:
        frame - The frame that you want to get the character range from.
        Returns:
        This function will return a CFRange containing the backing store range of characters that were originally requested to fill the frame. If the function call is not successful, then an empty range will be returned.
      • CTFrameGetVisibleStringRange

        public static CFRange CTFrameGetVisibleStringRange​(CTFrameRef frame)
        [@function] CTFrameGetVisibleStringRange 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.
        Parameters:
        frame - The frame that you want to get the visible character range from.
        Returns:
        This function will return a CFRange containing the backing store range of characters that fit into the frame. If the function call is not successful, or if no characters fit in the frame, then an empty range will be returned.
      • CTFrameGetPath

        public static CGPathRef CTFrameGetPath​(CTFrameRef frame)
        [@function] CTFrameGetPath Returns the path used to create the frame.
        Parameters:
        frame - The frame that you want to obtain the path from.
      • CTFrameGetFrameAttributes

        public static CFDictionaryRef CTFrameGetFrameAttributes​(CTFrameRef frame)
        [@function] CTFrameGetFrameAttributes 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.
        Parameters:
        frame - The frame that you want to obtain the frame attributes from.
        Returns:
        This function will return a CFDictionary containing the frame attributes that were used to create the frame. If the frame was created without any frame attributes, this function will return NULL.
      • CTFrameGetLines

        public static CFArrayRef CTFrameGetLines​(CTFrameRef frame)
        [@function] CTFrameGetLines 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.
        Parameters:
        frame - The frame that you want to obtain the line array from.
        Returns:
        This function will return a CFArray object containing the CTLine objects that make up the frame.
      • CTFrameGetLineOrigins

        public static void CTFrameGetLineOrigins​(CTFrameRef frame,
                                                 CFRange range,
                                                 CGPoint origins)
        [@function] CTFrameGetLineOrigins 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.
        Parameters:
        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.
      • CTFrameDraw

        public static void CTFrameDraw​(CTFrameRef frame,
                                       CGContextRef context)
        [@function] CTFrameDraw 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.
        Parameters:
        frame - The frame that you want to draw.
        context - The context to draw the frame to.
      • CTLineGetTypeID

        public static long CTLineGetTypeID()
        [@function] CTLineGetTypeID Returns the CFType of the line object
      • CTLineCreateWithAttributedString

        public static CTLineRef CTLineCreateWithAttributedString​(CFAttributedStringRef attrString)
        [@function] CTLineCreateWithAttributedString 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.
        Parameters:
        attrString - The attributed string which the line will be created for.
        Returns:
        This function will return a reference to a CTLine object.
      • CTLineCreateTruncatedLine

        public static CTLineRef CTLineCreateTruncatedLine​(CTLineRef line,
                                                          double width,
                                                          int truncationType,
                                                          CTLineRef truncationToken)
        [@function] CTLineCreateTruncatedLine Creates a truncated line from an existing line.
        Parameters:
        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.
        Returns:
        This function will return a reference to a truncated CTLine object if the call was successful. Otherwise, it will return NULL.
      • CTLineCreateJustifiedLine

        public static CTLineRef CTLineCreateJustifiedLine​(CTLineRef line,
                                                          double justificationFactor,
                                                          double justificationWidth)
        [@function] CTLineCreateJustifiedLine Creates a justified line from an existing line.
        Parameters:
        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").
        Returns:
        This function will return a reference to a justified CTLine object if the call was successful. Otherwise, it will return NULL.
      • CTLineGetGlyphCount

        public static long CTLineGetGlyphCount​(CTLineRef line)
        [@function] CTLineGetGlyphCount 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.
        Parameters:
        line - The line that you want to obtain the glyph count for.
        Returns:
        The total glyph count for the line passed in.
      • CTLineGetGlyphRuns

        public static CFArrayRef CTLineGetGlyphRuns​(CTLineRef line)
        [@function] CTLineGetGlyphRuns Returns the array of glyph runs that make up the line object.
        Parameters:
        line - The line that you want to obtain the glyph run array for.
        Returns:
        A CFArrayRef containing the CTRun objects that make up the line.
      • CTLineGetStringRange

        public static CFRange CTLineGetStringRange​(CTLineRef line)
        [@function] CTLineGetStringRange Gets the range of characters that originally spawned the glyphs in the line.
        Parameters:
        line - The line that you want to obtain the string range from.
        Returns:
        A CFRange that contains the range over the backing store string that spawned the glyphs. If the function fails for any reason, an empty range will be returned.
      • CTLineGetPenOffsetForFlush

        public static double CTLineGetPenOffsetForFlush​(CTLineRef line,
                                                        double flushFactor,
                                                        double flushWidth)
        [@function] CTLineGetPenOffsetForFlush Gets the pen offset required to draw flush text.
        Parameters:
        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.
        Returns:
        A value which can be used to offset the current pen position for the flush operation.
      • CTLineDraw

        public static void CTLineDraw​(CTLineRef line,
                                      CGContextRef context)
        [@function] CTLineDraw 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.
        Parameters:
        line - The line that you want to draw.
        context - The context to which the line will be drawn.
      • CTLineGetTypographicBounds

        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)
        [@function] CTLineGetTypographicBounds 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.
        Parameters:
        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.
        Returns:
        The typographic width of the line. If line is invalid, this function will always return zero.
        See Also:
        CTLineGetTrailingWhitespaceWidth(apple.coretext.opaque.CTLineRef)
      • CTLineGetBoundsWithOptions

        public static CGRect CTLineGetBoundsWithOptions​(CTLineRef line,
                                                        long options)
        [@function] CTLineGetBoundsWithOptions Calculates the bounds for a line.
        Parameters:
        line - The line that you want to calculate the bounds for.
        options - Desired options or 0 if none.
        Returns:
        The bounds of the line as specified by the type and options, such that the coordinate origin is coincident with the line origin and the rect origin is at the bottom left. If the line is invalid this function will return CGRectNull.
      • CTLineGetTrailingWhitespaceWidth

        public static double CTLineGetTrailingWhitespaceWidth​(CTLineRef line)
        [@function] CTLineGetTrailingWhitespaceWidth Calculates the trailing whitespace width for a line.
        Parameters:
        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.
        Returns:
        The width of the line's trailing whitespace. If line is invalid, this function will always return zero.
      • CTLineGetStringIndexForPosition

        public static long CTLineGetStringIndexForPosition​(CTLineRef line,
                                                           CGPoint position)
        [@function] CTLineGetStringIndexForPosition 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.
        Parameters:
        line - The line being examined.
        position - The location of the mouse click relative to the line's origin.
        Returns:
        The string index for the position. Relative to the line's string range, this value will be no less than the first string index and no greater than one plus the last string index. In the event of failure, this function will return kCFNotFound.
      • CTLineGetOffsetForStringIndex

        public static double CTLineGetOffsetForStringIndex​(CTLineRef line,
                                                           long charIndex,
                                                           org.moe.natj.general.ptr.NFloatPtr secondaryOffset)
        [@function] CTLineGetOffsetForStringIndex 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.
        Parameters:
        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.
        Returns:
        The primary offset along the baseline for charIndex, or 0.0 in the event of failure.
      • CTLineEnumerateCaretOffsets

        public static void CTLineEnumerateCaretOffsets​(CTLineRef line,
                                                       CoreText.Block_CTLineEnumerateCaretOffsets block)
        [@function] CTLineEnumerateCaretOffsets 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.
        Parameters:
        block - The offset parameter is relative to the line origin. The leadingEdge parameter of this block refers to logical order.
      • CTTypesetterGetTypeID

        public static long CTTypesetterGetTypeID()
        [@function] CTTypesetterGetTypeID Returns the CFType of the typesetter object
      • CTTypesetterCreateWithAttributedString

        public static CTTypesetterRef CTTypesetterCreateWithAttributedString​(CFAttributedStringRef string)
        [@function] CTTypesetterCreateWithAttributedString 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.
        Parameters:
        string - The CFAttributedStringRef that you want to typeset. This parameter must be filled in with a valid CFAttributedString.
        Returns:
        This function will return a reference to a CTTypesetter.
      • CTTypesetterCreateWithAttributedStringAndOptions

        public static CTTypesetterRef CTTypesetterCreateWithAttributedStringAndOptions​(CFAttributedStringRef string,
                                                                                       CFDictionaryRef options)
        [@function] CTTypesetterCreateWithAttributedStringAndOptions 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.
        Parameters:
        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.
        Returns:
        This function will return either a reference to a CTTypesetter or NULL if layout cannot be performed due to an attributed string that would require unreasonable effort.
        See Also:
        kCTTypesetterOptionAllowUnboundedLayout()
      • CTTypesetterCreateLineWithOffset

        public static CTLineRef CTTypesetterCreateLineWithOffset​(CTTypesetterRef typesetter,
                                                                 CFRange stringRange,
                                                                 double offset)
        [@function] CTTypesetterCreateLineWithOffset Creates an immutable line from the typesetter. The resultant line will consist of glyphs in the correct visual order, ready to draw.
        Parameters:
        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.
        Returns:
        This function will return a reference to a CTLine.
      • CTTypesetterCreateLine

        public static CTLineRef CTTypesetterCreateLine​(CTTypesetterRef typesetter,
                                                       CFRange stringRange)
        [@function] CTTypesetterCreateLine Equivalent to CTTypesetterCreateLineWithOffset with offset = 0.0.
      • CTTypesetterSuggestLineBreakWithOffset

        public static long CTTypesetterSuggestLineBreakWithOffset​(CTTypesetterRef typesetter,
                                                                  long startIndex,
                                                                  double width,
                                                                  double offset)
        [@function] CTTypesetterSuggestLineBreakWithOffset 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.
        Parameters:
        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.
        Returns:
        The value returned is a count of the characters from startIndex that would cause the line break. This value returned can be used to construct a character range for CTTypesetterCreateLine.
      • CTTypesetterSuggestLineBreak

        public static long CTTypesetterSuggestLineBreak​(CTTypesetterRef typesetter,
                                                        long startIndex,
                                                        double width)
        [@function] CTTypesetterSuggestLineBreak Equivalent to CTTypesetterSuggestLineBreakWithOffset with offset = 0.0.
      • CTTypesetterSuggestClusterBreakWithOffset

        public static long CTTypesetterSuggestClusterBreakWithOffset​(CTTypesetterRef typesetter,
                                                                     long startIndex,
                                                                     double width,
                                                                     double offset)
        [@function] CTTypesetterSuggestClusterBreakWithOffset 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.
        Parameters:
        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.
        Returns:
        The value returned is a count of the characters from startIndex that would cause the cluster break. This value returned can be used to construct a character range for CTTypesetterCreateLine.
      • CTTypesetterSuggestClusterBreak

        public static long CTTypesetterSuggestClusterBreak​(CTTypesetterRef typesetter,
                                                           long startIndex,
                                                           double width)
        [@function] CTTypesetterSuggestClusterBreak Equivalent to CTTypesetterSuggestClusterBreakWithOffset with offset = 0.0.
      • CTFramesetterGetTypeID

        public static long CTFramesetterGetTypeID()
        [@function] CTFramesetterGetTypeID Returns the CFType of the framesetter object
      • CTFramesetterCreateWithAttributedString

        public static CTFramesetterRef CTFramesetterCreateWithAttributedString​(CFAttributedStringRef attrString)
        [@function] CTFramesetterCreateWithAttributedString 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.
        Parameters:
        attrString - The attributed string to construct the framesetter with.
        Returns:
        This function will return a reference to a CTFramesetter object.
      • CTFramesetterCreateFrame

        public static CTFrameRef CTFramesetterCreateFrame​(CTFramesetterRef framesetter,
                                                          CFRange stringRange,
                                                          CGPathRef path,
                                                          CFDictionaryRef frameAttributes)
        [@function] CTFramesetterCreateFrame 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.
        Parameters:
        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.
        Returns:
        This function will return a reference to a new CTFrame object.
      • CTFramesetterGetTypesetter

        public static CTTypesetterRef CTFramesetterGetTypesetter​(CTFramesetterRef framesetter)
        [@function] CTFramesetterGetTypesetter 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.
        Parameters:
        framesetter - The framesetter from which a typesetter is being requested.
        Returns:
        This function will return a reference to a CTTypesetter object, which should not be released by the caller.
      • CTFramesetterSuggestFrameSizeWithConstraints

        public static CGSize CTFramesetterSuggestFrameSizeWithConstraints​(CTFramesetterRef framesetter,
                                                                          CFRange stringRange,
                                                                          CFDictionaryRef frameAttributes,
                                                                          CGSize constraints,
                                                                          CFRange fitRange)
        [@function] CTFramesetterSuggestFrameSizeWithConstraints 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.
        Parameters:
        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.
        Returns:
        The actual dimensions for the given string range and constraints.
      • CTGlyphInfoGetTypeID

        public static long CTGlyphInfoGetTypeID()
        [@function] CTGlyphInfoGetTypeID Returns the CFType of the glyph info object
      • CTGlyphInfoCreateWithGlyphName

        public static CTGlyphInfoRef CTGlyphInfoCreateWithGlyphName​(CFStringRef glyphName,
                                                                    CTFontRef font,
                                                                    CFStringRef baseString)
        [@function] CTGlyphInfoCreateWithGlyphName 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.
        Parameters:
        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.
        Returns:
        This function will return a reference to a CTGlyphInfo object.
      • CTGlyphInfoCreateWithGlyph

        public static CTGlyphInfoRef CTGlyphInfoCreateWithGlyph​(char glyph,
                                                                CTFontRef font,
                                                                CFStringRef baseString)
        [@function] CTGlyphInfoCreateWithGlyph Creates an immutable glyph info object. This function creates an immutable glyph info object for a glyph index and a specified font.
        Parameters:
        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.
        Returns:
        This function will return a reference to a CTGlyphInfo object.
      • CTGlyphInfoCreateWithCharacterIdentifier

        public static CTGlyphInfoRef CTGlyphInfoCreateWithCharacterIdentifier​(char cid,
                                                                              short collection,
                                                                              CFStringRef baseString)
        [@function] CTGlyphInfoCreateWithCharacterIdentifier Creates an immutable glyph info object. This function creates an immutable glyph info object for a character identifier and a character collection.
        Parameters:
        cid - A character identifier.
        collection - A character collection identifier.
        baseString - The part of the string the returned object is intended to override.
        Returns:
        This function will return a reference to a CTGlyphInfo object.
      • CTGlyphInfoGetGlyphName

        public static CFStringRef CTGlyphInfoGetGlyphName​(CTGlyphInfoRef glyphInfo)
        [@function] CTGlyphInfoGetGlyphName Gets the glyph name for a glyph info, if applicable. This function will return the glyph name.
        Parameters:
        glyphInfo - The glyph info for which you would like the glyph name.
        Returns:
        If the glyph info object was created with a glyph name, it will be returned. Otherwise, this function will return NULL.
      • CTGlyphInfoGetCharacterIdentifier

        public static char CTGlyphInfoGetCharacterIdentifier​(CTGlyphInfoRef glyphInfo)
        [@function] CTGlyphInfoGetCharacterIdentifier Gets the character identifier for a glyph info. This function will return the character identifier.
        Parameters:
        glyphInfo - The glyph info for which you would like the character identifier.
        Returns:
        If the glyph info object was created with a character identifier, it will be returned. Otherwise, this function will return 0.
      • CTGlyphInfoGetCharacterCollection

        public static short CTGlyphInfoGetCharacterCollection​(CTGlyphInfoRef glyphInfo)
        [@function] CTGlyphInfoGetCharacterCollection 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.
        Parameters:
        glyphInfo - The glyph info for which you would like the character collection.
        Returns:
        This function will return the character collection of the given glyph info.
      • CTRubyAnnotationGetTypeID

        public static long CTRubyAnnotationGetTypeID()
        [@function] CTRubyAnnotationGetTypeID Returns the CFType of the ruby annotation object
      • CTRubyAnnotationCreateWithAttributes

        public static CTRubyAnnotationRef CTRubyAnnotationCreateWithAttributes​(byte alignment,
                                                                               byte overhang,
                                                                               byte position,
                                                                               CFStringRef string,
                                                                               CFDictionaryRef attributes)
        [@function] CTRubyAnnotationCreateWithAttributes Creates an immutable ruby annotation object. Using this function to create a ruby annotation object with more precise control of the annotation text.
        Parameters:
        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.
        Returns:
        This function will return a reference to a CTRubyAnnotation object.
      • CTRubyAnnotationCreateCopy

        public static CTRubyAnnotationRef CTRubyAnnotationCreateCopy​(CTRubyAnnotationRef rubyAnnotation)
        [@function] CTRubyAnnotationCreateCopy Creates an immutable copy of a ruby annotation object.
        Parameters:
        rubyAnnotation - The ruby annotation that you wish to copy.
        Returns:
        If the "rubyAnnotation" reference is valid, then this function will return valid reference to an immutable CTRubyAnnotation object that is a copy of the one passed into "rubyAnnotation".
      • CTRubyAnnotationGetAlignment

        public static byte CTRubyAnnotationGetAlignment​(CTRubyAnnotationRef rubyAnnotation)
        [@function] CTRubyAnnotationGetAlignment Get the alignment value of a ruby annotation object.
        Parameters:
        rubyAnnotation - The ruby annotation object.
        Returns:
        If the "rubyAnnotation" reference is valid, then this function will return its alignment. Otherwise it will return kCTRubyAlignmentInvalid.
      • CTRubyAnnotationGetOverhang

        public static byte CTRubyAnnotationGetOverhang​(CTRubyAnnotationRef rubyAnnotation)
        [@function] CTRubyAnnotationGetOverhang Get the overhang value of a ruby annotation object.
        Parameters:
        rubyAnnotation - The ruby annotation object.
        Returns:
        If the "rubyAnnotation" reference is valid, then this function will return its overhang value. Otherwise it will return kCTRubyOverhangInvalid.
      • CTRubyAnnotationGetSizeFactor

        public static double CTRubyAnnotationGetSizeFactor​(CTRubyAnnotationRef rubyAnnotation)
        [@function] CTRubyAnnotationGetSizeFactor Get the size factor of a ruby annotation object.
        Parameters:
        rubyAnnotation - The ruby annotation object.
        Returns:
        If the "rubyAnnotation" reference is valid, then this function will return its sizeFactor. Otherwise it will return 0.
      • CTRubyAnnotationGetTextForPosition

        public static CFStringRef CTRubyAnnotationGetTextForPosition​(CTRubyAnnotationRef rubyAnnotation,
                                                                     byte position)
        [@function] CTRubyAnnotationGetTextForPosition Get the ruby text for a particular position in a ruby annotation.
        Parameters:
        rubyAnnotation - The ruby annotation object.
        position - The position for which you want to get the ruby text.
        Returns:
        If the "rubyAnnotation" reference and the position are valid, then this function will return a CFStringRef for the text. Otherwise it will return NULL.
      • CTRunGetTypeID

        public static long CTRunGetTypeID()
        [@function] CTRunGetTypeID Returns the CFType of the run object
      • CTRunGetGlyphCount

        public static long CTRunGetGlyphCount​(CTRunRef run)
        [@function] CTRunGetGlyphCount Gets the glyph count for the run.
        Parameters:
        run - The run whose glyph count you wish to access.
        Returns:
        The number of glyphs that the run contains. It is totally possible that this function could return a value of zero, indicating that there are no glyphs in this run.
      • CTRunGetAttributes

        public static CFDictionaryRef CTRunGetAttributes​(CTRunRef run)
        [@function] CTRunGetAttributes 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.
        Parameters:
        run - The run whose attributes you wish to access.
        Returns:
        The attribute dictionary.
      • CTRunGetStatus

        public static int CTRunGetStatus​(CTRunRef run)
        [@function] CTRunGetStatus 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.
        Parameters:
        run - The run whose status you wish to access.
        Returns:
        The run's status.
      • CTRunGetGlyphsPtr

        public static org.moe.natj.general.ptr.ConstCharPtr CTRunGetGlyphsPtr​(CTRunRef run)
        [@function] CTRunGetGlyphsPtr 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.
        Parameters:
        run - The run whose glyphs you wish to access.
        Returns:
        A valid pointer to an array of CGGlyph structures or NULL.
      • CTRunGetGlyphs

        public static void CTRunGetGlyphs​(CTRunRef run,
                                          CFRange range,
                                          org.moe.natj.general.ptr.CharPtr buffer)
        [@function] CTRunGetGlyphs Copies a range of glyphs into user-provided buffer.
        Parameters:
        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.
      • CTRunGetPositionsPtr

        public static CGPoint CTRunGetPositionsPtr​(CTRunRef run)
        [@function] CTRunGetPositionsPtr 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.
        Parameters:
        run - The run whose positions you wish to access.
        Returns:
        A valid pointer to an array of CGPoint structures or NULL.
      • CTRunGetPositions

        public static void CTRunGetPositions​(CTRunRef run,
                                             CFRange range,
                                             CGPoint buffer)
        [@function] CTRunGetPositions 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.
        Parameters:
        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.
      • CTRunGetAdvancesPtr

        public static CGSize CTRunGetAdvancesPtr​(CTRunRef run)
        [@function] CTRunGetAdvancesPtr 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.
        Parameters:
        run - The run whose advances you wish to access.
        Returns:
        A valid pointer to an array of CGSize structures or NULL.
      • CTRunGetAdvances

        public static void CTRunGetAdvances​(CTRunRef run,
                                            CFRange range,
                                            CGSize buffer)
        [@function] CTRunGetAdvances Copies a range of glyph advances into a user-provided buffer.
        Parameters:
        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.
      • CTRunGetStringIndicesPtr

        public static org.moe.natj.general.ptr.ConstNIntPtr CTRunGetStringIndicesPtr​(CTRunRef run)
        [@function] CTRunGetStringIndicesPtr 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.
        Parameters:
        run - The run whose string indices you wish to access.
        Returns:
        A valid pointer to an array of CFIndex structures or NULL.
      • CTRunGetStringIndices

        public static void CTRunGetStringIndices​(CTRunRef run,
                                                 CFRange range,
                                                 org.moe.natj.general.ptr.NIntPtr buffer)
        [@function] CTRunGetStringIndices 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.
        Parameters:
        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.
      • CTRunGetStringRange

        public static CFRange CTRunGetStringRange​(CTRunRef run)
        [@function] CTRunGetStringRange Gets the range of characters that originally spawned the glyphs in the run.
        Parameters:
        run - The run whose string range you wish to access.
        Returns:
        Returns the range of characters that originally spawned the glyphs. If run is invalid, this will return an empty range.
      • CTRunGetTypographicBounds

        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)
        [@function] CTRunGetTypographicBounds Gets the typographic bounds of the run.
        Parameters:
        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.
        Returns:
        The typographic width of the run. If run or range is invalid, then this function will always return zero.
      • CTRunGetImageBounds

        public static CGRect CTRunGetImageBounds​(CTRunRef run,
                                                 CGContextRef context,
                                                 CFRange range)
        [@function] CTRunGetImageBounds 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.
        Parameters:
        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.
        Returns:
        A rect that tightly encloses the paths of the run's glyphs. The rect origin will match the drawn position of the requested range; that is, it will be translated by the supplied context's text position and the positions of the individual glyphs. If the run or range is invalid, CGRectNull will be returned.
        See Also:
        CTRunGetTypographicBounds(apple.coretext.opaque.CTRunRef,apple.corefoundation.struct.CFRange,org.moe.natj.general.ptr.NFloatPtr,org.moe.natj.general.ptr.NFloatPtr,org.moe.natj.general.ptr.NFloatPtr)
      • CTRunGetTextMatrix

        public static CGAffineTransform CTRunGetTextMatrix​(CTRunRef run)
        [@function] CTRunGetTextMatrix 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.
        Parameters:
        run - The run object from which to get the text matrix.
        Returns:
        A CGAffineTransform.
      • CTRunDraw

        public static void CTRunDraw​(CTRunRef run,
                                     CGContextRef context,
                                     CFRange range)
        [@function] CTRunDraw 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.
        Parameters:
        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.
      • CTRunDelegateGetTypeID

        public static long CTRunDelegateGetTypeID()
        [@function] CTRunDelegateGetTypeID Returns the CFType of CTRunDelegate objects.
      • CTRunDelegateCreate

        public static CTRunDelegateRef CTRunDelegateCreate​(CTRunDelegateCallbacks callbacks,
                                                           org.moe.natj.general.ptr.VoidPtr refCon)
        [@function] CTRunDelegateCreate 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.
        Parameters:
        callbacks - The callbacks for this run delegate.
        Returns:
        If run delegate creation was successful, this function will return a valid reference to an immutable CTRunDelegate object. Otherwise, this function will return NULL.
      • CTRunDelegateGetRefCon

        public static org.moe.natj.general.ptr.VoidPtr CTRunDelegateGetRefCon​(CTRunDelegateRef runDelegate)
        [@function] CTRunDelegateGetRefCon Returns a run delegate's refCon value. This function returns the refCon value that a run delegate was created with.
        Parameters:
        runDelegate - The run delegate to be queried.
        Returns:
        The refCon value of the supplied run delegate.
      • CTTextTabGetTypeID

        public static long CTTextTabGetTypeID()
        [@function] CTTypesetterGetTypeID Returns the CFType of the text tab object
      • CTTextTabCreate

        public static CTTextTabRef CTTextTabCreate​(byte alignment,
                                                   double location,
                                                   CFDictionaryRef options)
        [@function] CTTextTabCreate Creates and initializes a new text tab.
        Parameters:
        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.
        Returns:
        The new CTTextTab.
      • CTTextTabGetAlignment

        public static byte CTTextTabGetAlignment​(CTTextTabRef tab)
        [@function] CTTextTabGetAlignment Returns the text alignment of the tab.
        Parameters:
        tab - The tab whose text alignment you wish to access.
        Returns:
        The tab's text alignment value.
      • CTTextTabGetLocation

        public static double CTTextTabGetLocation​(CTTextTabRef tab)
        [@function] CTTextTabGetLocation Returns the tab's ruler location.
        Parameters:
        tab - The tab whose location you wish to access.
        Returns:
        The tab's ruler location relative to the back margin.
      • CTTextTabGetOptions

        public static CFDictionaryRef CTTextTabGetOptions​(CTTextTabRef tab)
        [@function] CTTextTabGetOptions Returns the dictionary of attributes associated with the tab.
        Parameters:
        tab - The tab whose attributes you wish to access.
        Returns:
        The dictionary of attributes associated with the tab or NULL if no dictionary is present.
      • CTGetCoreTextVersion

        public static int CTGetCoreTextVersion()
        [@function] 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 }
        Returns:
        The version number. This value is for comparison with the constants beginning with kCTVersionNumber and will not exceed kCTVersionNumber11_0.
      • kCTFontSymbolicTrait

        public static CFStringRef kCTFontSymbolicTrait()
        [@defined] 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.
      • kCTFontWeightTrait

        public static CFStringRef kCTFontWeightTrait()
        [@defined] 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.
      • kCTFontWidthTrait

        public static CFStringRef kCTFontWidthTrait()
        [@defined] 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.
      • kCTFontSlantTrait

        public static CFStringRef kCTFontSlantTrait()
        [@defined] 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.
      • kCTFontURLAttribute

        public static CFStringRef kCTFontURLAttribute()
        [@defined] 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.
      • kCTFontNameAttribute

        public static CFStringRef kCTFontNameAttribute()
        [@defined] 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.
      • kCTFontDisplayNameAttribute

        public static CFStringRef kCTFontDisplayNameAttribute()
        [@defined] 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.
      • kCTFontFamilyNameAttribute

        public static CFStringRef kCTFontFamilyNameAttribute()
        [@defined] 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.
      • kCTFontStyleNameAttribute

        public static CFStringRef kCTFontStyleNameAttribute()
        [@defined] 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.
      • kCTFontTraitsAttribute

        public static CFStringRef kCTFontTraitsAttribute()
        [@defined] 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.
      • kCTFontVariationAttribute

        public static CFStringRef kCTFontVariationAttribute()
        [@defined] 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.
      • kCTFontSizeAttribute

        public static CFStringRef kCTFontSizeAttribute()
        [@defined] 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.
      • kCTFontMatrixAttribute

        public static CFStringRef kCTFontMatrixAttribute()
        [@defined] 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.
      • kCTFontCascadeListAttribute

        public static CFStringRef kCTFontCascadeListAttribute()
        [@defined] 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.
      • kCTFontCharacterSetAttribute

        public static CFStringRef kCTFontCharacterSetAttribute()
        [@defined] 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.
      • kCTFontLanguagesAttribute

        public static CFStringRef kCTFontLanguagesAttribute()
        [@defined] 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.
      • kCTFontBaselineAdjustAttribute

        public static CFStringRef kCTFontBaselineAdjustAttribute()
        [@defined] 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.
      • kCTFontMacintoshEncodingsAttribute

        public static CFStringRef kCTFontMacintoshEncodingsAttribute()
        [@defined] kCTFontMacintoshEncodingsAttribute The Macintosh encodings (legacy script codes). The value associated with this key is a CFNumberRef containing a bitfield of the script codes in ; bit 0 corresponds to kFontRomanScript, and so on. This attribute is provided for legacy compatibility.
      • kCTFontFeaturesAttribute

        public static CFStringRef kCTFontFeaturesAttribute()
        [@defined] 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.
      • kCTFontFeatureSettingsAttribute

        public static CFStringRef kCTFontFeatureSettingsAttribute()
        [@defined] 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) ].
      • kCTFontFixedAdvanceAttribute

        public static CFStringRef kCTFontFixedAdvanceAttribute()
        [@defined] 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.
      • kCTFontOrientationAttribute

        public static CFStringRef kCTFontOrientationAttribute()
        [@defined] 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.
      • kCTFontFormatAttribute

        public static CFStringRef kCTFontFormatAttribute()
        [@defined] 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.
      • kCTFontRegistrationScopeAttribute

        public static CFStringRef kCTFontRegistrationScopeAttribute()
        [@defined] 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.
      • kCTFontPriorityAttribute

        public static CFStringRef kCTFontPriorityAttribute()
        [@defined] 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.
      • kCTFontEnabledAttribute

        public static CFStringRef kCTFontEnabledAttribute()
        [@defined] 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.
      • kCTFontDownloadableAttribute

        public static CFStringRef kCTFontDownloadableAttribute()
        [@defined] 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.
      • kCTFontDownloadedAttribute

        public static CFStringRef kCTFontDownloadedAttribute()
        [@defined] 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.)
      • kCTFontDescriptorMatchingSourceDescriptor

        public static CFStringRef kCTFontDescriptorMatchingSourceDescriptor()
        CTFontDescriptorRef; The current font descriptor. Valid when state is kCTFontDescriptorMatchingDidMatch.
      • kCTFontDescriptorMatchingDescriptors

        public static CFStringRef kCTFontDescriptorMatchingDescriptors()
        CFArray; Array of descriptors to be queried. Valid while downloading or when state is kCTFontDescriptorMatchingWillBeginQuerying.
      • kCTFontDescriptorMatchingResult

        public static CFStringRef kCTFontDescriptorMatchingResult()
        CFArray; Array of matched font descriptors. Valid when state is kCTFontDescriptorMatchingDidMatch or CTFontDescriptorMatchingEnd.
      • kCTFontDescriptorMatchingPercentage

        public static CFStringRef kCTFontDescriptorMatchingPercentage()
        CFNumber; Download progress in 0 - 100. Valid during Downloading state.
      • kCTFontDescriptorMatchingCurrentAssetSize

        public static CFStringRef kCTFontDescriptorMatchingCurrentAssetSize()
        CFNumber; Byte size to download for the current descriptor. Valid during Downloading state.
      • kCTFontDescriptorMatchingTotalDownloadedSize

        public static CFStringRef kCTFontDescriptorMatchingTotalDownloadedSize()
        CFNumber; Total downloaded byte size. Valid during Downloading state.
      • kCTFontDescriptorMatchingTotalAssetSize

        public static CFStringRef kCTFontDescriptorMatchingTotalAssetSize()
        CFNumber; Total byte size to download. Always valid, but may be Zero when information is not available.
      • kCTFontDescriptorMatchingError

        public static CFStringRef kCTFontDescriptorMatchingError()
        CFError; Valid when state kCTFontDescriptorMatchingDidFailWithError.
      • kCTFontCopyrightNameKey

        public static CFStringRef kCTFontCopyrightNameKey()
        Name specifier constants [@defined] kCTFontCopyrightNameKey The name specifier for the copyright name.
      • kCTFontFamilyNameKey

        public static CFStringRef kCTFontFamilyNameKey()
        [@defined] kCTFontFamilyNameKey The name specifier for the family name.
      • kCTFontSubFamilyNameKey

        public static CFStringRef kCTFontSubFamilyNameKey()
        [@defined] kCTFontSubFamilyNameKey The name specifier for the subfamily name.
      • kCTFontStyleNameKey

        public static CFStringRef kCTFontStyleNameKey()
        [@defined] kCTFontStyleNameKey The name specifier for the style name.
      • kCTFontUniqueNameKey

        public static CFStringRef kCTFontUniqueNameKey()
        [@defined] 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.
      • kCTFontFullNameKey

        public static CFStringRef kCTFontFullNameKey()
        [@defined] kCTFontFullNameKey The name specifier for the full name.
      • kCTFontVersionNameKey

        public static CFStringRef kCTFontVersionNameKey()
        [@defined] kCTFontVersionNameKey The name specifier for the version name.
      • kCTFontPostScriptNameKey

        public static CFStringRef kCTFontPostScriptNameKey()
        [@defined] kCTFontPostScriptNameKey The name specifier for the PostScript name.
      • kCTFontTrademarkNameKey

        public static CFStringRef kCTFontTrademarkNameKey()
        [@defined] kCTFontTrademarkNameKey The name specifier for the trademark name.
      • kCTFontManufacturerNameKey

        public static CFStringRef kCTFontManufacturerNameKey()
        [@defined] kCTFontManufacturerNameKey The name specifier for the manufacturer name.
      • kCTFontDesignerNameKey

        public static CFStringRef kCTFontDesignerNameKey()
        [@defined] kCTFontDesignerNameKey The name specifier for the designer name.
      • kCTFontDescriptionNameKey

        public static CFStringRef kCTFontDescriptionNameKey()
        [@defined] kCTFontDescriptionNameKey The name specifier for the description name.
      • kCTFontVendorURLNameKey

        public static CFStringRef kCTFontVendorURLNameKey()
        [@defined] kCTFontVendorURLNameKey The name specifier for the vendor url name.
      • kCTFontDesignerURLNameKey

        public static CFStringRef kCTFontDesignerURLNameKey()
        [@defined] kCTFontDesignerURLNameKey The name specifier for the designer url name.
      • kCTFontLicenseNameKey

        public static CFStringRef kCTFontLicenseNameKey()
        [@defined] kCTFontLicenseNameKey The name specifier for the license name.
      • kCTFontLicenseURLNameKey

        public static CFStringRef kCTFontLicenseURLNameKey()
        [@defined] kCTFontLicenseURLNameKey The name specifier for the license url name.
      • kCTFontSampleTextNameKey

        public static CFStringRef kCTFontSampleTextNameKey()
        [@defined] kCTFontSampleTextNameKey The name specifier for the sample text name string.
      • kCTFontPostScriptCIDNameKey

        public static CFStringRef kCTFontPostScriptCIDNameKey()
        [@defined] kCTFontPostScriptCIDNameKey The name specifier for the PostScript CID name.
      • kCTFontVariationAxisIdentifierKey

        public static CFStringRef kCTFontVariationAxisIdentifierKey()
        [@defined] 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.
      • kCTFontVariationAxisMinimumValueKey

        public static CFStringRef kCTFontVariationAxisMinimumValueKey()
        [@defined] 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.
      • kCTFontVariationAxisMaximumValueKey

        public static CFStringRef kCTFontVariationAxisMaximumValueKey()
        [@defined] 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.
      • kCTFontVariationAxisDefaultValueKey

        public static CFStringRef kCTFontVariationAxisDefaultValueKey()
        [@defined] 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.
      • kCTFontVariationAxisNameKey

        public static CFStringRef kCTFontVariationAxisNameKey()
        [@defined] 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.
      • kCTFontOpenTypeFeatureTag

        public static CFStringRef kCTFontOpenTypeFeatureTag()
        [@defined] 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.
      • kCTFontOpenTypeFeatureValue

        public static CFStringRef kCTFontOpenTypeFeatureValue()
        [@defined] 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.
      • kCTFontFeatureTypeIdentifierKey

        public static CFStringRef kCTFontFeatureTypeIdentifierKey()
        [@defined] 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.
      • kCTFontFeatureTypeNameKey

        public static CFStringRef kCTFontFeatureTypeNameKey()
        [@defined] 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.
      • kCTFontFeatureTypeExclusiveKey

        public static CFStringRef kCTFontFeatureTypeExclusiveKey()
        [@defined] 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.
      • kCTFontFeatureTypeSelectorsKey

        public static CFStringRef kCTFontFeatureTypeSelectorsKey()
        [@defined] 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.
      • kCTFontFeatureSelectorIdentifierKey

        public static CFStringRef kCTFontFeatureSelectorIdentifierKey()
        [@defined] 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.
      • kCTFontFeatureSelectorNameKey

        public static CFStringRef kCTFontFeatureSelectorNameKey()
        [@defined] 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.
      • kCTFontFeatureSelectorDefaultKey

        public static CFStringRef kCTFontFeatureSelectorDefaultKey()
        [@defined] 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.
      • kCTFontFeatureSelectorSettingKey

        public static CFStringRef kCTFontFeatureSelectorSettingKey()
        [@defined] 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.
      • kCTBaselineClassRoman

        public static CFStringRef kCTBaselineClassRoman()
        [@defined] 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.
      • kCTBaselineClassIdeographicCentered

        public static CFStringRef kCTBaselineClassIdeographicCentered()
        [@defined] 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.
      • kCTBaselineClassIdeographicLow

        public static CFStringRef kCTBaselineClassIdeographicLow()
        [@defined] 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.
      • kCTBaselineClassIdeographicHigh

        public static CFStringRef kCTBaselineClassIdeographicHigh()
        [@defined] 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.
      • kCTBaselineClassHanging

        public static CFStringRef kCTBaselineClassHanging()
        [@defined] 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.
      • kCTBaselineClassMath

        public static CFStringRef kCTBaselineClassMath()
        [@defined] kCTBaselineClassMathKey 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.
      • kCTBaselineReferenceFont

        public static CFStringRef kCTBaselineReferenceFont()
        [@defined] 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.
      • kCTBaselineOriginalFont

        public static CFStringRef kCTBaselineOriginalFont()
        [@defined] 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.
      • kCTFontCollectionRemoveDuplicatesOption

        public static CFStringRef kCTFontCollectionRemoveDuplicatesOption()
        [@defined] 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.
      • kCTFontManagerErrorDomain

        public static CFStringRef kCTFontManagerErrorDomain()
        [@const] kCTFontManagerErrorDomain CFError domain for CTFontManager errors CFErrors with this domain will have error codes corresponding to one of the CTFontManagerErrors above.
      • kCTFontManagerErrorFontURLsKey

        public static CFStringRef kCTFontManagerErrorFontURLsKey()
        [@constant] 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.
      • kCTFontManagerRegisteredFontsChangedNotification

        public static CFStringRef kCTFontManagerRegisteredFontsChangedNotification()
        [@constant] 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.
      • kCTFramePathClippingPathAttributeName

        public static CFStringRef kCTFramePathClippingPathAttributeName()
        [@const] 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.
        See Also:
        kCTFrameClippingPathsAttributeName()
      • kCTTypesetterOptionDisableBidiProcessing

        public static CFStringRef kCTTypesetterOptionDisableBidiProcessing()
        [@const] 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.
      • kCTTypesetterOptionForcedEmbeddingLevel

        public static CFStringRef kCTTypesetterOptionForcedEmbeddingLevel()
        [@const] 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.
      • kCTRubyAnnotationSizeFactorAttributeName

        public static CFStringRef kCTRubyAnnotationSizeFactorAttributeName()
        [@const] kCTRubyAnnotationSizeFactorAttributeName Specifies the size of the annotation text as a percent of the size of the base text. Value must be a CFNumberRef.
      • kCTRubyAnnotationScaleToFitAttributeName

        public static CFStringRef kCTRubyAnnotationScaleToFitAttributeName()
        [@const] 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.
      • kCTFontAttributeName

        public static CFStringRef kCTFontAttributeName()
        [@const] kCTFontAttributeName The font. Value must be a CTFontRef. Default is Helvetica 12.
      • kCTForegroundColorFromContextAttributeName

        public static CFStringRef kCTForegroundColorFromContextAttributeName()
        [@const] 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.
      • kCTKernAttributeName

        public static CFStringRef kCTKernAttributeName()
        [@const] 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.
      • kCTLigatureAttributeName

        public static CFStringRef kCTLigatureAttributeName()
        [@const] 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.
      • kCTForegroundColorAttributeName

        public static CFStringRef kCTForegroundColorAttributeName()
        [@const] kCTForegroundColorAttributeName The foreground color. Value must be a CGColorRef. Default value is black.
      • kCTBackgroundColorAttributeName

        public static CFStringRef kCTBackgroundColorAttributeName()
        [@const] kCTBackgroundColorAttributeName The background color. Value must be a CGColorRef. Default is no background color.
      • kCTParagraphStyleAttributeName

        public static CFStringRef kCTParagraphStyleAttributeName()
        [@const] 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.
        See Also:
        CFStringGetParagraphBounds
      • kCTStrokeWidthAttributeName

        public static CFStringRef kCTStrokeWidthAttributeName()
        [@const] 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.
      • kCTStrokeColorAttributeName

        public static CFStringRef kCTStrokeColorAttributeName()
        [@const] kCTStrokeColorAttributeName The stroke color. Value must be a CGColorRef. Default is the foreground color.
      • kCTUnderlineStyleAttributeName

        public static CFStringRef kCTUnderlineStyleAttributeName()
        [@const] 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.
      • kCTSuperscriptAttributeName

        public static CFStringRef kCTSuperscriptAttributeName()
        [@const] 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.
      • kCTUnderlineColorAttributeName

        public static CFStringRef kCTUnderlineColorAttributeName()
        [@const] kCTUnderlineColorAttributeName The underline color. Value must be a CGColorRef. Default is the foreground color.
      • kCTVerticalFormsAttributeName

        public static CFStringRef kCTVerticalFormsAttributeName()
        [@const] 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.
      • kCTHorizontalInVerticalFormsAttributeName

        public static CFStringRef kCTHorizontalInVerticalFormsAttributeName()
        [@const] 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.
      • kCTGlyphInfoAttributeName

        public static CFStringRef kCTGlyphInfoAttributeName()
        [@const] 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.
      • kCTCharacterShapeAttributeName

        public static CFStringRef kCTCharacterShapeAttributeName()
        [@const] 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.
      • kCTLanguageAttributeName

        public static CFStringRef kCTLanguageAttributeName()
        [@const] 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.
      • kCTRunDelegateAttributeName

        public static CFStringRef kCTRunDelegateAttributeName()
        [@const] 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.
      • kCTWritingDirectionAttributeName

        public static CFStringRef kCTWritingDirectionAttributeName()
        [@const] 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.
        See Also:
        kCTWritingDirectionLeftToRight, kCTWritingDirectionRightToLeft, kCTWritingDirectionEmbedding, kCTWritingDirectionOverride
      • kCTRubyAnnotationAttributeName

        public static CFStringRef kCTRubyAnnotationAttributeName()
        [@const] kCTRubyAnnotationAttributeName Key to reference a CTRubyAnnotation. Value must be a CTRubyAnnotationRef. See CTRubyAnnotation.h for more information.
      • kCTTabColumnTerminatorsAttributeName

        public static CFStringRef kCTTabColumnTerminatorsAttributeName()
        [@const] 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.
      • kCTFontVariationAxisHiddenKey

        public static CFStringRef kCTFontVariationAxisHiddenKey()
        [@defined] 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.
      • kCTBaselineOffsetAttributeName

        public static CFStringRef kCTBaselineOffsetAttributeName()
        [@const] 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.
        See Also:
        NSBaselineOffsetAttributeName
      • CTFontCollectionCreateMatchingFontDescriptorsWithOptions

        public static CFArrayRef CTFontCollectionCreateMatchingFontDescriptorsWithOptions​(CTFontCollectionRef collection,
                                                                                          CFDictionaryRef options)
        [@function] CTFontCollectionCreateMatchingFontDescriptorsWithOptions Returns an array of font descriptors matching the collection.
        Parameters:
        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.
        Returns:
        An array of CTFontDescriptors matching the collection definition or NULL if there are none.
      • CTFontManagerCreateFontDescriptorsFromData

        public static CFArrayRef CTFontManagerCreateFontDescriptorsFromData​(CFDataRef data)
        [@function] CTFontManagerCreateFontDescriptorsFromData Returns an array of font descriptors for the fonts in the supplied data. Note: the font descriptors are not available through font descriptor matching.
        Parameters:
        data - A CFData containing font data.
        Returns:
        An array of font descriptors. This can be an empty array in the event of invalid or unsupported font data.
      • CTFontManagerRegisterFontURLs

        public static void CTFontManagerRegisterFontURLs​(CFArrayRef fontURLs,
                                                         int scope,
                                                         boolean enabled,
                                                         CoreText.Block_CTFontManagerRegisterFontURLs registrationHandler)
        [@function] CTFontManagerRegisterFontURLs 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.
        Parameters:
        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.
      • CTFontManagerUnregisterFontURLs

        public static void CTFontManagerUnregisterFontURLs​(CFArrayRef fontURLs,
                                                           int scope,
                                                           CoreText.Block_CTFontManagerUnregisterFontURLs registrationHandler)
        [@function] CTFontManagerUnregisterFontURLs 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.
        Parameters:
        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.
      • CTFontManagerRegisterFontDescriptors

        public static void CTFontManagerRegisterFontDescriptors​(CFArrayRef fontDescriptors,
                                                                int scope,
                                                                boolean enabled,
                                                                CoreText.Block_CTFontManagerRegisterFontDescriptors registrationHandler)
        [@function] CTFontManagerRegisterFontDescriptors 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.
        Parameters:
        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.
      • CTFontManagerUnregisterFontDescriptors

        public static void CTFontManagerUnregisterFontDescriptors​(CFArrayRef fontDescriptors,
                                                                  int scope,
                                                                  CoreText.Block_CTFontManagerUnregisterFontDescriptors registrationHandler)
        [@function] CTFontManagerUnregisterFontDescriptors Unregisters font descriptors with the font manager. Unregistered fonts do not participate in font descriptor matching.
        Parameters:
        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.
      • CTFontManagerRegisterFontsWithAssetNames

        public static void CTFontManagerRegisterFontsWithAssetNames​(CFArrayRef fontAssetNames,
                                                                    CFBundleRef bundle,
                                                                    int scope,
                                                                    boolean enabled,
                                                                    CoreText.Block_CTFontManagerRegisterFontsWithAssetNames registrationHandler)
        [@function] CTFontManagerRegisterFontsWithAssetNames 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.
        Parameters:
        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.
      • CTFontManagerCopyRegisteredFontDescriptors

        public static CFArrayRef CTFontManagerCopyRegisteredFontDescriptors​(int scope,
                                                                            boolean enabled)
        [@function] CTFontManagerCopyRegisteredFontDescriptors 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.
        Parameters:
        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.
        Returns:
        Array of of font descriptors registered by the application. Array may be empty if nothing is registered.
      • CTFontManagerRequestFonts

        public static void CTFontManagerRequestFonts​(CFArrayRef fontDescriptors,
                                                     CoreText.Block_CTFontManagerRequestFonts completionHandler)
        [@function] CTFontManagerRequestFonts 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.
        Parameters:
        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.
      • CTGlyphInfoGetGlyph

        public static char CTGlyphInfoGetGlyph​(CTGlyphInfoRef glyphInfo)
        [@function] CTGlyphInfoGetGlyph Gets the glyph for a glyph info, if applicable. This function will return the glyph.
        Parameters:
        glyphInfo - The glyph info from which you would like the glyph.
        Returns:
        If the glyph info object was created with a font, it will be returned. Otherwise, this function will return 0.
      • CTRunGetBaseAdvancesAndOrigins

        public static void CTRunGetBaseAdvancesAndOrigins​(CTRunRef runRef,
                                                          CFRange range,
                                                          CGSize advancesBuffer,
                                                          CGPoint originsBuffer)
        [@function] CTRunGetBaseAdvancesAndOrigins 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.
        Parameters:
        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.
      • kCTFontFeatureSampleTextKey

        public static CFStringRef kCTFontFeatureSampleTextKey()
        [@defined] 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.
      • kCTFontFeatureTooltipTextKey

        public static CFStringRef kCTFontFeatureTooltipTextKey()
        [@defined] 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.
      • kCTFontManagerErrorFontDescriptorsKey

        public static CFStringRef kCTFontManagerErrorFontDescriptorsKey()
        [@constant] 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.
      • kCTFontManagerErrorFontAssetNameKey

        public static CFStringRef kCTFontManagerErrorFontAssetNameKey()
        [@constant] 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.
      • kCTFontRegistrationUserInfoAttribute

        public static CFStringRef kCTFontRegistrationUserInfoAttribute()
        [@defined] 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.
      • kCTTypesetterOptionAllowUnboundedLayout

        public static CFStringRef kCTTypesetterOptionAllowUnboundedLayout()
        [@const] 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.
      • kCTTrackingAttributeName

        public static CFStringRef kCTTrackingAttributeName()
        [@const] 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.
        See Also:
        kCTKernAttributeName(), kCTLigatureAttributeName()
      • kCTFontVariationAxesAttribute

        public static CFStringRef kCTFontVariationAxesAttribute()
        [@defined] 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.
      • kCTFontOpticalSizeAttribute

        public static CFStringRef kCTFontOpticalSizeAttribute()
        [@defined] 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.