CTFontDescriptor Reference
| Derived from | |
| Framework | ApplicationServices/CoreText |
| Declared in | CTFontDescriptor.h CTFontTraits.h |
Overview
The CTFontDescriptor opaque type represents a font descriptor, that is, a dictionary of attributes (such as name, point size, and variation) that can completely specify a font.
A font descriptor can be an incomplete specification, in which case the system chooses the most appropriate font to match the given attributes.
Functions by Task
Creating Font Descriptors
-
CTFontDescriptorCreateWithNameAndSize -
CTFontDescriptorCreateWithAttributes -
CTFontDescriptorCreateCopyWithAttributes -
CTFontDescriptorCreateCopyWithVariation -
CTFontDescriptorCreateCopyWithFeature -
CTFontDescriptorCreateMatchingFontDescriptors -
CTFontDescriptorCreateMatchingFontDescriptor
Getting Attributes
Getting the Font Descriptor Type
Functions
CTFontDescriptorCopyAttribute
Returns the value associated with an arbitrary attribute.
CFTypeRef CTFontDescriptorCopyAttribute ( CTFontDescriptorRef descriptor, CFStringRef attribute );
Parameters
- descriptor
The font descriptor.
- attribute
The requested attribute.
Return Value
A retained reference to an arbitrary attribute, or NULL if the requested attribute is not present.
Discussion
Refer to “Font Attributes” for documentation explaining how each attribute is packaged as a CFType object.
Availability
- Available in iOS 3.2 and later.
Declared In
CTFontDescriptor.hCTFontDescriptorCopyAttributes
Returns the attributes dictionary of the font descriptor.
CFDictionaryRef CTFontDescriptorCopyAttributes ( CTFontDescriptorRef descriptor );
Parameters
- descriptor
The font descriptor.
Return Value
The font descriptor attributes dictionary. This dictionary contains the minimum number of attributes to specify fully this particular font descriptor.
Availability
- Available in iOS 3.2 and later.
Declared In
CTFontDescriptor.hCTFontDescriptorCopyLocalizedAttribute
Returns a localized value for the requested attribute, if available.
CFTypeRef CTFontDescriptorCopyLocalizedAttribute ( CTFontDescriptorRef descriptor, CFStringRef attribute, CFStringRef *language );
Parameters
- descriptor
The font descriptor.
- attribute
The requested font attribute.
- language
On output, contains a reference to the matched language. The language identifier will conform to the RFC 3066bis standard.
Return Value
A retained reference to a localized attribute based on the global language list.
Discussion
This function passes back the matched language in language. If localization is not possible for the attribute, the behavior matches the value returned from CTFontDescriptorCopyAttribute. Generally, localization of attributes is applicable to name attributes of only a normalized font descriptor.
Availability
- Available in iOS 3.2 and later.
Declared In
CTFontDescriptor.hCTFontDescriptorCreateCopyWithAttributes
Creates a copy of the original font descriptor with new attributes.
CTFontDescriptorRef CTFontDescriptorCreateCopyWithAttributes ( CTFontDescriptorRef original, CFDictionaryRef attributes );
Parameters
- original
The original font descriptor.
- attributes
A dictionary containing arbitrary attributes.
Return Value
A new copy of the original font descriptor with attributes augmented by those specified. If there are conflicts between attributes, the new attributes replace existing ones.
Availability
- Available in iOS 3.2 and later.
Declared In
CTFontDescriptor.hCTFontDescriptorCreateCopyWithFeature
Copies a font descriptor with new feature settings.
CTFontDescriptorRef CTFontDescriptorCreateCopyWithFeature ( CTFontDescriptorRef original, CFNumberRef featureTypeIdentifier, CFNumberRef featureSelectorIdentifier );
Parameters
- original
The original font descriptor.
- featureTypeIdentifier
The feature type identifier.
- featureSelectorIdentifier
The feature selector identifier.
Return Value
A copy of the original font descriptor modified with the given feature settings.
Discussion
This is a convenience method to toggle more easily the state of individual features.
Availability
- Available in iOS 3.2 and later.
Declared In
CTFontDescriptor.hCTFontDescriptorCreateCopyWithVariation
Creates a copy of the original font descriptor with a new variation instance.
CTFontDescriptorRef CTFontDescriptorCreateCopyWithVariation ( CTFontDescriptorRef original, CFNumberRef variationIdentifier, CGFloat variationValue );
Parameters
- original
The original font descriptor.
- variationIdentifier
The variation axis identifier. This is the four-character code of the variation axis as a CFNumber object.
- variationValue
The value corresponding with the variation instance.
Return Value
A copy of the original font descriptor with a new variation instance.
Discussion
This is a convenience method for easily creating new variation font instances.
Availability
- Available in iOS 3.2 and later.
Declared In
CTFontDescriptor.hCTFontDescriptorCreateMatchingFontDescriptor
Returns the single preferred matching font descriptor based on the original descriptor and system precedence.
CTFontDescriptorRef CTFontDescriptorCreateMatchingFontDescriptor ( CTFontDescriptorRef descriptor, CFSetRef mandatoryAttributes );
Parameters
- descriptor
The original font descriptor.
- mandatoryAttributes
A set of attribute keys which must be identically matched in any returned font descriptors. May be
NULL.
Return Value
A retained, normalized font descriptor matching the attributes present in descriptor.
Discussion
The original descriptor may be returned in normalized form. The caller is responsible for releasing the result. In the context of font descriptors, normalized infers that the input values were matched up with actual existing fonts, and the descriptors for those existing fonts are the returned normalized descriptors.
Availability
- Available in iOS 3.2 and later.
Declared In
CTFontDescriptor.hCTFontDescriptorCreateMatchingFontDescriptors
Returns an array of normalized font descriptors matching the provided descriptor.
CFArrayRef CTFontDescriptorCreateMatchingFontDescriptors ( CTFontDescriptorRef descriptor, CFSetRef mandatoryAttributes );
Parameters
- descriptor
The font descriptor.
- mandatoryAttributes
A set of attribute keys that must be identically matched in any returned font descriptors. May be
NULL.
Return Value
A retained array of normalized font descriptors matching the attributes present in descriptor.
Discussion
If descriptor itself is normalized, then the array will contain only one item: the original descriptor. In the context of font descriptors, normalized infers that the input values were matched up with actual existing fonts, and the descriptors for those existing fonts are the returned normalized descriptors.
Availability
- Available in iOS 3.2 and later.
Declared In
CTFontDescriptor.hCTFontDescriptorCreateWithAttributes
Creates a new font descriptor reference from a dictionary of attributes.
CTFontDescriptorRef CTFontDescriptorCreateWithAttributes ( CFDictionaryRef attributes );
Parameters
- attributes
A dictionary containing arbitrary attributes.
Return Value
A new font descriptor with the attributes specified.
Discussion
The provided attribute dictionary can contain arbitrary attributes that are preserved; however, unrecognized attributes are ignored on font creation and and may not be preserved over the round trip from descriptor to font and back to descriptor.
Availability
- Available in iOS 3.2 and later.
Declared In
CTFontDescriptor.hCTFontDescriptorCreateWithNameAndSize
Creates a new font descriptor with the provided PostScript name and size.
CTFontDescriptorRef CTFontDescriptorCreateWithNameAndSize ( CFStringRef name, CGFloat size );
Parameters
- name
The PostScript name to be used for the font descriptor as a
CFStringRefobject.- size
The point size. If
0.0, the font size attribute (kCTFontSizeAttribute) is omitted from the returned font descriptor.
Return Value
A new font descriptor reference with the given PostScript name and point size.
Availability
- Available in iOS 3.2 and later.
Declared In
CTFontDescriptor.hCTFontDescriptorGetTypeID
Returns the type identifier for Core Text font descriptor references.
CFTypeID CTFontDescriptorGetTypeID ( void );
Return Value
The identifier for the CTFontDescriptor opaque type.
Availability
- Available in iOS 3.2 and later.
Declared In
CTFontDescriptor.hData Types
CTFontDescriptorRef
A reference to a CTFontDescriptor object.
typedef const struct __CTFontDescriptor *CTFontDescriptorRef;
Availability
- Available in iOS 3.2 and later.
Declared In
CTFontDescriptor.hConstants
Font Attributes
Font Attribute Constants
These constants are keys for accessing font attributes from a font descriptor.
const CFStringRef kCTFontURLAttribute; const CFStringRef kCTFontNameAttribute; const CFStringRef kCTFontDisplayNameAttribute; const CFStringRef kCTFontFamilyNameAttribute; const CFStringRef kCTFontStyleNameAttribute; const CFStringRef kCTFontTraitsAttribute; const CFStringRef kCTFontVariationAttribute; const CFStringRef kCTFontSizeAttribute; const CFStringRef kCTFontMatrixAttribute; const CFStringRef kCTFontCascadeListAttribute; const CFStringRef kCTFontCharacterSetAttribute; const CFStringRef kCTFontLanguagesAttribute; const CFStringRef kCTFontBaselineAdjustAttribute; const CFStringRef kCTFontMacintoshEncodingsAttribute; const CFStringRef kCTFontFeaturesAttribute; const CFStringRef kCTFontFeatureSettingsAttribute; const CFStringRef kCTFontFixedAdvanceAttribute; const CFStringRef kCTFontOrientationAttribute; const CFStringRef kCTFontFormatAttribute; const CFStringRef kCTFontRegistrationScopeAttribute; const CFStringRef kCTFontPriorityAttribute; const CFStringRef kCTFontEnabledAttribute;
Constants
kCTFontURLAttributeKey for accessing the font URL from the font descriptor. The value associated with this key is a
CFURLRefobject.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontNameAttributeKey for accessing the PostScript name from the font descriptor. The value associated with this key is a
CFStringRefobject. If the value is unspecified, it defaults toHelvetica, and if that font is unavailable, it falls back to the global font cascade list.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontDisplayNameAttributeKey for accessing the name used to display the font. Most commonly this is the full name. The value associated with this key is a
CFStringRefobject. If the value is unspecified, it defaults toHelvetica, and if that font is unavailable, it falls back to the global font cascade list.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontFamilyNameAttributeKey for accessing the font family name from the font descriptor. The value associated with this key is a
CFStringRefobject.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontStyleNameAttributeKey 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
CFStringRefobject.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontTraitsAttributeKey for accessing the dictionary of font traits for stylistic information. See “Font Traits” for the list of font traits. The value associated with this key is a
CFDictionaryRefobject.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontVariationAttributeKey to obtain the font variation dictionary instance as a
CFDictionaryRefobject. If specified in a font descriptor, fonts with the specified axes are primary match candidates; if no such fonts exist, this attribute is ignored.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontSizeAttributeKey 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
CFNumberRefobject.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontMatrixAttributeKey to specify the font transformation matrix when creating a font. If unspecified it defaults to the unit matrix. The value for this key is a
CFDataRefobject containing aCGAffineTransformobject.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontCascadeListAttributeKey to specify or obtain the cascade list used for a font reference. The cascade list is a
CFArrayRefobject containingCTFontDescriptorRefelements. If unspecified, the global cascade list is used.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontCharacterSetAttributeKey to specify or obtain the Unicode character coverage set for a font reference. The value for this key is a
CFCharacterSetRefobject. If specified, this attribute can be used to restrict the font to a subset of its actual character set. If unspecified, this attribute is ignored and the actual character set is used.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontLanguagesAttributeKey to specify or obtain a list of covered languages for a font reference. The value for this key is a
CFArrayRefobject containingCFStringRefelements. If specified, this attribute restricts the search to matching fonts that support the specified languages. The language identifier string should conform to the RFC 3066bis standard. If unspecified, this attribute is ignored.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontBaselineAdjustAttributeKey to specify or obtain the baseline adjustment for a font reference. This is primarily used when defining font descriptors for a cascade list to keep the baseline of all fonts even. The value associated with this is a float represented as a
CFNumberRefobject.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontMacintoshEncodingsAttributeKey to specify or obtain the Macintosh encodings for a font reference. The value associated with this key is a
CFNumberRefobject containing a bit field of the Macintosh encodings. This attribute is provided for legacy compatibility.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontFeaturesAttributeKey to specify or obtain the font features for a font reference. The value associated with this key is a
CFArrayRefobject containing font feature dictionaries. This feature list contains the feature information from the'feat'table of the font. For more information, seeCTFontCopyFeatures.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontFeatureSettingsAttributeKey to specify or obtain the font features settings for a font reference. The value associated with this key is a
CFArrayRefobject containing font feature-setting dictionaries. A feature-setting dictionary contains a tuple of akCTFontFeatureTypeIdentifierKeykey-value pair and akCTFontFeatureSelectorIdentifierKeykey-value pair. Each setting dictionary indicates which setting should be turned on. In the case of duplicate or conflicting setting, the last setting in the list takes precedence. It is the caller's responsibility to handle exclusive and nonexclusive settings as necessary.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontFixedAdvanceAttributeKey to specify a fixed advance to be used for a font reference. If present and specified, this attribute is used to specify a constant advance to override any font values. The value associated with this key is a float represented as a
CFNumberRefobject.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontOrientationAttributeKey to specify a particular orientation for the glyphs of the font. The value associated with this key is an integer represented as a
CFNumberRefobject containing one of the constants in “Font Orientation Constants.” If you want to receive vertical metrics from a font for vertical rendering, specifykCTFontVerticalOrientation. If unspecified, the font uses its native orientation.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontFormatAttributeKey to specify or obtain the recognized format of the font. The value associated with this key is an integer represented as a
CFNumberRefobject containing one of the constants in “Font Format Constants.”Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontRegistrationScopeAttributeKey to specify or obtain the font descriptor's registration scope. The value associated with this key is an integer represented as a
CFNumberRefobject containing one of the CTFontManagerScope enumerated values. A value ofNULLcan be returned for font descriptors that are not registered.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontPriorityAttributeKey to specify or obtain the font priority used by font descriptors when resolving duplicates and sorting match results. The value associated with this key is an integer represented as a
CFNumberRefobject containing one of the values enumerated in “Font Priority Constants.” The higher the value, the higher the priority of the font. Only registered fonts have a priority. Unregistered font descriptors returnNULL.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontEnabledAttributeKey to obtain the font enabled state. The returned value is an integer represented as a
CFNumberRefobject representing a Boolean value. Unregistered font descriptors returnNULL, which is equivalent tofalse.Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.
Font Orientation Constants
Specifies the intended rendering orientation of the font for obtaining glyph metrics. These constants are used as values of kCTFontOrientationAttribute.
enum {
kCTFontDefaultOrientation = 0,
kCTFontHorizontalOrientation = 1,
kCTFontVerticalOrientation = 2
};
typedef uint32_t CTFontOrientation;
Constants
kCTFontDefaultOrientationThe native orientation of the font.
Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontHorizontalOrientationSpecifies horizontal orientation.
Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontVerticalOrientationSpecifies vertical orientation.
Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.
Font Format Constants
Specifies the recognized format of the font.
enum {
kCTFontFormatUnrecognized = 0,
kCTFontFormatOpenTypePostScript = 1,
kCTFontFormatOpenTypeTrueType = 2,
kCTFontFormatTrueType = 3,
kCTFontFormatPostScript = 4,
kCTFontFormatBitmap = 5
};
typedef uint32_t CTFontFormat;
Constants
kCTFontFormatUnrecognizedThe font is not a recognized format.
Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontFormatOpenTypePostScriptThe font is an OpenType format containing PostScript data.
Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontFormatOpenTypeTrueTypeThe font is an OpenType format containing TrueType data.
Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontFormatTrueTypeThe font is a recognized TrueType format.
Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontFormatPostScriptThe font is a recognized PostScript format.
Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontFormatBitmapThe font is a bitmap-only format.
Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.
Font Priority Constants
Specifies the priority of font descriptors when resolving duplicates and sorting match results.
enum {
kCTFontPrioritySystem = 10000,
kCTFontPriorityNetwork = 20000,
kCTFontPriorityComputer = 30000,
kCTFontPriorityUser = 40000,
kCTFontPriorityDynamic = 50000,
kCTFontPriorityProcess = 60000
};
typedef uint32_t CTFontPriority;
Constants
kCTFontPrioritySystemPriority of system fonts (located in
/System/Library/Fonts).Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontPriorityNetworkPriority of network fonts (located in
/Network/Library/Fonts).Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontPriorityComputerPriority of computer local fonts (located in
/Library/Fonts).Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontPriorityUserPriority of local fonts (located in user's
Library/Fonts).Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontPriorityDynamicPriority of fonts registered dynamically, not located in a standard location (either kCTFontManagerScopeUser or kCTFontManagerScopeSession).
Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.kCTFontPriorityProcessPriority of fonts registered for the process (kCTFontManagerScopeProcess).
Available in iOS 3.2 and later.
Declared in
CTFontDescriptor.h.
Font Traits
Font Trait Constants
These constants are keys for accessing font traits from a font descriptor.
const CFStringRef kCTFontSymbolicTrait; const CFStringRef kCTFontWeightTrait; const CFStringRef kCTFontWidthTrait; const CFStringRef kCTFontSlantTrait;
Constants
kCTFontSymbolicTraitKey to access the symbolic traits value from the font traits dictionary. The value is returned as a
CFNumberRefobject.Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.kCTFontWeightTraitKey to access the normalized weight trait from the font traits dictionary. The value returned is a
CFNumberRefrepresenting a float value between-1.0and1.0for normalized weight. The value of0.0corresponds to the regular or medium font weight.Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.kCTFontWidthTraitKey to access the normalized proportion (width condense or expand) trait from the font traits dictionary. This value corresponds to the relative interglyph spacing for a given font. The value returned is a
CFNumberRefobject representing a float between-1.0and1.0. The value of0.0corresponds to regular glyph spacing, and negative values represent condensed glyph spacing.Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.kCTFontSlantTraitKey to access the normalized slant angle from the font traits dictionary. The value returned is a
CFNumberRefobject representing a float value between-1.0and1.0for normalized slant angle. The value of0.0corresponds to 0 degrees clockwise rotation from the vertical and1.0corresponds to 30 degrees clockwise rotation.Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.
Font Class Mask Shift Constants
These constants represent the font class mask shift.
enum { kCTFontClassMaskShift = 28};
Constants
kCTFontClassMaskShiftValue used to shift the font class to the uppermost four bits of the symbolic traits
Font Symbolic Traits Constants
These constants represent the symbolic representation of stylistic font attributes.
enum {
kCTFontItalicTrait = (1 << 0),
kCTFontBoldTrait = (1 << 1),
kCTFontExpandedTrait = (1 << 5),
kCTFontCondensedTrait = (1 << 6),
kCTFontMonoSpaceTrait = (1 << 10),
kCTFontVerticalTrait = (1 << 11),
kCTFontUIOptimizedTrait = (1 << 12),
kCTFontClassMaskTrait = (15 << kCTFontClassMaskShift)
};
typedef uint32_t CTFontSymbolicTraits;
Constants
kCTFontItalicTraitThe font typestyle is italic. Additional detail is available via
kCTFontSlantTrait.Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.kCTFontBoldTraitThe font typestyle is boldface. Additional detail is available via
kCTFontWeightTrait.Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.kCTFontExpandedTraitThe font typestyle is expanded. Expanded and condensed traits are mutually exclusive.
Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.kCTFontCondensedTraitThe font typestyle is condensed. Expanded and condensed traits are mutually exclusive. Additional detail is available via
kCTFontWidthTrait.Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.kCTFontMonoSpaceTraitThe font uses fixed-pitch glyphs if available. The font may have multiple glyph advances (many CJK glyphs contain two spaces).
Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.kCTFontVerticalTraitThe font uses vertical glyph variants and metrics.
Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.kCTFontUIOptimizedTraitThe font synthesizes appropriate attributes for user interface rendering, such as control titles, if necessary.
Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.kCTFontClassMaskTraitMask for the font class.
Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.
Discussion
CTFontSymbolicTraits symbolically describes stylistic aspects of a font. The upper 16 bits are used to describe appearance of the font, whereas the lower 16 bits are for typeface information. The font appearance information represented by the upper 16 bits can be used for stylistic font matching.
Font Stylistic Class Constants
These constants represent the stylistic class values of the font.
enum {
kCTFontUnknownClass = (0 << kCTFontClassMaskShift),
kCTFontOldStyleSerifsClass = (1 << kCTFontClassMaskShift),
kCTFontTransitionalSerifsClass = (2 << kCTFontClassMaskShift),
kCTFontModernSerifsClass = (3 << kCTFontClassMaskShift),
kCTFontClarendonSerifsClass = (4 << kCTFontClassMaskShift),
kCTFontSlabSerifsClass = (5 << kCTFontClassMaskShift),
kCTFontFreeformSerifsClass = (7 << kCTFontClassMaskShift),
kCTFontSansSerifClass = (8 << kCTFontClassMaskShift),
kCTFontOrnamentalsClass = (9 << kCTFontClassMaskShift),
kCTFontScriptsClass = (10 << kCTFontClassMaskShift),
kCTFontSymbolicClass = (12 << kCTFontClassMaskShift)
};
typedef uint32_t CTFontStylisticClass;
Constants
kCTFontUnknownClassThe font has no design classification.
Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.kCTFontOldStyleSerifsClassThe font’s style is based on the Latin printing style of the 15th to 17th century.
Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.kCTFontTransitionalSerifsClassThe font’s style is based on the Latin printing style of the 18th to 19th century.
Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.kCTFontModernSerifsClassThe font’s style is based on the Latin printing style of the 20th century.
Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.kCTFontClarendonSerifsClassThe font’s style is a variation of the Oldstyle Serifs and the Transitional Serifs.
Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.kCTFontSlabSerifsClassThe font’s style is characterized by serifs with a square transition between the strokes and the serifs (no brackets).
Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.kCTFontFreeformSerifsClassThe font’s style includes serifs, but it expresses a design freedom that does not generally fit within the other serif design classifications.
Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.kCTFontSansSerifClassThe font’s style includes most basic letter forms (excluding Scripts and Ornamentals) that do not have serifs on the strokes.
Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.kCTFontOrnamentalsClassThe font’s style includes highly decorated or stylized character shapes such as those typically used in headlines.
Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.kCTFontScriptsClassThe font’s style is among those typefaces designed to simulate handwriting.
Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.kCTFontSymbolicClassThe font’s style is generally design independent, making it suitable for special characters (icons, dingbats, technical symbols, and so on) that may be used equally well with any font.
Available in iOS 3.2 and later.
Declared in
CTFontTraits.h.
Discussion
CTFontStylisticClass classifies certain stylistic qualities of the font. These values correspond closely to the font class values in the OpenType OS/2 table. The class values are bundled in the upper four bits of the “Font Symbolic Traits Constants” and can be obtained via kCTFontClassMaskTrait.
© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-03-05)