Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

CTFont Reference

Derived from
CFType
Framework
Declared in
CTFont.h

Overview

The CTFont opaque type represents a Core Text font object. Font objects represent fonts to an application, providing access to characteristics of the font, such as point size, transform matrix, and other attributes. Fonts provide assistance in laying out glyphs relative to one another and are used to establish the current font when drawing in a graphics context.

Functions by Task

Creating Fonts

Getting Font Data

Getting Font Names

Working With Encoding

Getting Font Metrics

Getting Glyph Data

Working With Font Variations

Getting Font Features

Converting Fonts

Getting Font Table Data

Getting the Type Identifier

Functions

CTFontCopyAttribute

Returns the value associated with an arbitrary attribute of the given font.

CFTypeRef CTFontCopyAttribute (
   CTFontRef font,
   CFStringRef attribute
);

Parameters
font

The font reference.

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 the attribute definitions documentation for information as to how each attribute is packaged as a CFType.

Availability
Declared In
CTFont.h

CTFontCopyAvailableTables

Returns an array of font table tags.

CFArrayRef CTFontCopyAvailableTables (
   CTFontRef font,
   CTFontTableOptions options
);

Parameters
font

The font reference.

options

The font table options.

Return Value

An array of CTFontTableTag values for the given font and the supplied options.

Discussion

The returned set will contain unboxed values, which can be extracted like so:

CTFontTableTag tag = (CTFontTableTag)(uintptr_t)CFArrayGetValueAtIndex(tags, index);
Availability
Declared In
CTFont.h

CTFontCopyCharacterSet

Returns the Unicode character set of the font.

CFCharacterSetRef CTFontCopyCharacterSet (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

A retained reference to the font's character set.

Discussion

The returned character set covers the nominal referenced by the font's Unicode 'cmap’ table.

Availability
Declared In
CTFont.h

CTFontCopyDisplayName

Returns the display name of the given font.

CFStringRef CTFontCopyDisplayName (
   CTFontRef font
);

Parameters
font

The font reference.

Discussion

A retained reference to the localized display name of the font.

Availability
Declared In
CTFont.h

CTFontCopyFamilyName

Returns the family name of the given font.

CFStringRef CTFontCopyFamilyName (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

A retained reference to the family name of the font.

Availability
Declared In
CTFont.h

CTFontCopyFeatures

Returns an array of font features.

CFArrayRef CTFontCopyFeatures (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

An array of font feature dictionaries for the font reference.

Availability
Declared In
CTFont.h

CTFontCopyFeatureSettings

Returns an array of font feature-setting tuples.

CFArrayRef CTFontCopyFeatureSettings (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

A normalized array of font feature-setting dictionaries. The array contains only the nondefault settings that should be applied to the font, or NULL if the default settings should be used.

Discussion

A feature-setting dictionary is a tuple of a kCTFontFeatureTypeIdentifierKey key-value pair and a kCTFontFeatureSelectorIdentifierKey key-value pair. Each setting dictionary indicates which setting is enabled. It is the caller's responsibility to handle exclusive and nonexclusive settings as necessary.

The feature settings are verified against those that the font supports and any that do not apply are removed. Further, feature settings that represent a default setting for the font are also removed.

Availability
Declared In
CTFont.h

CTFontCopyFontDescriptor

Returns the normalized font descriptor for the given font reference.

CTFontDescriptorRef CTFontCopyFontDescriptor (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

A normalized font descriptor for a font containing enough information to recreate this font at a later time.

Availability
Declared In
CTFont.h

CTFontCopyFullName

Returns the full name of the given font.

CFStringRef CTFontCopyFullName (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

A retained reference to the full name of the font.

Availability
Declared In
CTFont.h

CTFontCopyGraphicsFont

Returns a Core Graphics font reference and attributes.

CGFontRef CTFontCopyGraphicsFont (
   CTFontRef font,
   CTFontDescriptorRef *attributes
);

Parameters
font

The font reference.

attributes

On output, points to a font descriptor containing additional attributes from the font. Can be NULL. Must be released by the caller.

Return Value

A CGFontRef object for the given font reference.

Availability
Declared In
CTFont.h

CTFontCopyLocalizedName

Returns a reference to a localized name for the given font.

CFStringRef CTFontCopyLocalizedName (
   CTFontRef font,
   CFStringRef nameKey,
   CFStringRef *language
);

Parameters
font

The font reference.

nameKey

The name specifier. See “Name Specifier Constants” for possible values.

language

On output, points to the language string of the returned name string. The format of the language identifier conforms to the RFC 3066bis standard.

Return Value

A specific localized name from the font reference or NULL if the font does not have an entry for the requested name key.

Discussion

The name is localized based on the user's global language preference precedence. That is, the user’s language preference is a list of languages in order of precedence. So, for example, if the list had Japanese and English, in that order, then a font that did not have Japanese name strings but had English strings would return the English strings.

Availability
Declared In
CTFont.h

CTFontCopyName

Returns a reference to the requested name of the given font.

CFStringRef CTFontCopyName (
   CTFontRef font,
   CFStringRef nameKey
);

Parameters
font

The font reference.

nameKey

The name specifier. See “Name Specifier Constants” for possible values.

Return Value

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 is preferred, otherwise the first available version is returned.

Availability
Declared In
CTFont.h

CTFontCopyPostScriptName

Returns the PostScript name of the given font.

CFStringRef CTFontCopyPostScriptName (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

A retained reference to the PostScript name of the font.

Availability
Declared In
CTFont.h

CTFontCopySupportedLanguages

Returns an array of languages supported by the font.

CFArrayRef CTFontCopySupportedLanguages (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

A retained reference to an array of languages supported by the font. The array contains language identifier strings as CFStringRef objects. The format of the language identifier conforms to the RFC 3066bis standard.

Availability
Declared In
CTFont.h

CTFontCopyTable

Returns a reference to the font table data.

CFDataRef CTFontCopyTable (
   CTFontRef font,
   CTFontTableTag table,
   CTFontTableOptions options
);

Parameters
font

The font reference.

table

The font table identifier as a CTFontTableTag constant. See “Font Table Tag Constants” for possible values.

options

The font table options.

Return Value

A retained reference to the font table data as a CFDataRef object. The table data is not actually copied; however, the data reference must be released.

Availability
Declared In
CTFont.h

CTFontCopyTraits

Returns the traits dictionary of the given font.

CFDictionaryRef CTFontCopyTraits (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

A retained reference to the font traits dictionary. Individual traits can be accessed with the trait key constants.

Discussion

See the Constants section of CTFontDescriptor Reference for a definition of the font traits.

Availability
Declared In
CTFont.h

CTFontCopyVariation

Returns a variation dictionary from the font reference.

CFDictionaryRef CTFontCopyVariation (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

The current variation instance as a dictionary.

Discussion

The keys for each variation correspond to the variation identifier obtained via kCTFontVariationAxisIdentifierKey, which represents the four-character axis code as a CFNumber object.

Availability
Declared In
CTFont.h

CTFontCopyVariationAxes

Returns an array of variation axes.

CFArrayRef CTFontCopyVariationAxes (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

An array of variation axes dictionaries. Each variation axis dictionary contains the five variation axis keys listed in “Font Variation Axis Dictionary Keys”.

Availability
Declared In
CTFont.h

CTFontCreateCopyWithAttributes

Returns a new font with additional attributes based on the original font.

CTFontRef CTFontCreateCopyWithAttributes (
   CTFontRef font,
   CGFloat size,
   const CGAffineTransform *matrix,
   CTFontDescriptorRef attributes
);

Parameters
font

The 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 is preserved.

matrix

The transformation matrix for the font. If NULL is specified, the original font’s matrix is preserved.

attributes

A font descriptor containing additional attributes that the new font should contain.

Return Value

A new font reference converted from the original with the specified attributes.

Discussion

This function provides a mechanism to change attributes quickly 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.

Availability
Declared In
CTFont.h

CTFontCreateCopyWithFamily

Returns a new font in the specified family based on the traits of the original font.

CTFontRef CTFontCreateCopyWithFamily (
   CTFontRef font,
   CGFloat size,
   const CGAffineTransform *matrix,
   CFStringRef family
);

Parameters
font

The 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 is preserved.

matrix

The transformation matrix for the font. If NULL is specified, the original font’s matrix is preserved.

family

The name of the desired family.

Return Value

A new font reference with the original traits in the given family, or NULL if none is found in the system.

Availability
Declared In
CTFont.h

CTFontCreateCopyWithSymbolicTraits

Returns a new font in the same font family as the original with the specified symbolic traits.

CTFontRef CTFontCreateCopyWithSymbolicTraits (
   CTFontRef font,
   CGFloat size,
   const CGAffineTransform *matrix,
   uint32_t symTraitValue,
   uint32_t symTraitMask
);

Parameters
font

The 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 is preserved.

matrix

The transformation matrix for the font. If NULL is specified, the original font’s matrix is preserved.

symTraitValue

The value of the symbolic traits.

symTraitMask

The mask bits of the symbolic traits.

Return Value

A new font reference in the same family with the given symbolic traits. or NULL if none is found in the system.

Availability
Declared In
CTFont.h

CTFontCreateForString

Returns a new font reference that can best map the given string range based on the current font.

CTFontRef CTFontCreateForString (
   CTFontRef currentFont,
   CFStringRef string,
   CFRange range
);

Parameters
currentFont

The current font that contains a valid cascade list.

string

A unicode string containing characters that cannot be encoded by the current font.

range

A CFRange structure specifying the range of the string that needs to be mapped.

Return Value

The best substitute font from the cascade list of the current font that can encode the specified string range. If the current font is capable of encoding the string range, then it is retained and returned.

Availability
Declared In
CTFont.h

CTFontCreatePathForGlyph

Creates a path for the specified glyph.

CGPathRef CTFontCreatePathForGlyph(
   CTFontRef font,
   CGGlyph glyph,
   const CGAffineTransform *transform
);

Parameters
font

The font reference.

glyph

The glyph.

transform

An affine transform applied to the path. Can be NULL. If NULL, CGAffineTransformIdentity is used.

Return Value

A CGPath object containing the glyph outlines, NULL on error. Must be released by caller.

Discussion

Creates a path from the outlines of the glyph for the specified font. The path reflects the font point size, matrix, and transform parameter, applied in that order. The transform parameter is most commonly be used to provide a translation to the desired glyph origin.

Availability
Declared In
CTFont.h

CTFontCreateUIFontForLanguage

Returns the special user-interface font for the given language and user-interface type.

CTFontRef CTFontCreateUIFontForLanguage (
   CTFontUIFontType uiType,
   CGFloat size,
   CFStringRef language
);

Parameters
uiType

A constant specifying the intended user-interface use for the requested font reference. See “Enumerations” for possible values.

size

The point size for the font reference. If 0.0 is specified, the default size for the requested user-interface type is used.

language

Language specifier string to select a font for a particular localization. If NULL is specified, the current system language is used. The format of the language identifier should conform to the RFC 3066bis standard.

Return Value

The correct font for various user-interface uses.

Discussion

The only required parameter is the uiType selector; the other parameters have default values.

Availability
Declared In
CTFont.h

CTFontCreateWithFontDescriptor

Returns a new font reference that best matches the given font descriptor.

CTFontRef CTFontCreateWithFontDescriptor (
   CTFontDescriptorRef descriptor,
   CGFloat size,
   const CGAffineTransform *matrix
);

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 is used.

matrix

The transformation matrix for the font. If NULL is specified, the identity matrix is used.

Return Value

A CTFontRef that best matches the attributes provided with the font descriptor.

Discussion

The size and matrix parameters override any specified in the font descriptor unless they are unspecified (0.0 for size and NULL for matrix). A best match font is always returned, and default values are used for any unspecified parameters.

Availability
Declared In
CTFont.h

CTFontCreateWithGraphicsFont

Creates a new font reference from an existing Core Graphics font reference.

CTFontRef CTFontCreateWithGraphicsFont (
   CGFontRef graphicsFont,
   CGFloat size,
   const CGAffineTransform *matrix,
   CTFontDescriptorRef attributes
);

Parameters
graphicsFont

A valid Core Graphics font reference.

size

The point size for the font reference. If 0.0 is specified the default font size of 12.0 is used.

matrix

The transformation matrix for the font. If NULL, the identity matrix is used. Optional.

attributes

Additional attributes that should be matched. Optional.

Return Value

A new font reference for an existing CGFontRef object with the specified size, matrix, and additional attributes.

Availability
Declared In
CTFont.h

CTFontCreateWithName

Returns a new font reference for the given name.

CTFontRef CTFontCreateWithName (
   CFStringRef name,
   CGFloat size,
   const CGAffineTransform *matrix
);

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 are matched in a fallback manner.

size

The point size for the font reference. If 0.0 is specified, the default font size of 12.0 is used.

matrix

The transformation matrix for the font. If NULL is specified, the identity matrix is used.

Return Value

Returns a CTFontRef that best matches the name provided with size and matrix attributes.

Discussion

The name parameter is the only required parameter, and default values are used for unspecified parameters (0.0 for size and NULL for matrix). If all parameters cannot be matched identically, a best match is found.

Availability
Declared In
CTFont.h

CTFontCreateWithPlatformFont

Creates a new font reference from an ATS font reference.

CTFontRef CTFontCreateWithPlatformFont (
   ATSFontRef platformFont,
   CGFloat size,
   const CGAffineTransform *matrix,
   CTFontDescriptorRef attributes
);

Parameters
platformFont

A valid ATSFontRef object.

size

The point size for the font reference. If 0.0 is specified the default font size of 12.0 is used.

matrix

The transformation matrix for the font. If NULL, the identity matrix is used. Optional.

attributes

A CTFontDescriptorRef containing additional attributes that should be matched. Optional.

Return Value

A new font reference for an ATSFontRef with the specified size, matrix, and additional attribtues.

Availability
Declared In
CTFont.h

CTFontCreateWithQuickdrawInstance

Returns a font reference for the given QuickDraw instance.

CTFontRef CTFontCreateWithQuickdrawInstance (
   ConstStr255Param name,
   int16_t identifier,
   uint8_t style,
   CGFloat size
);

Parameters
name

The QuickDraw font name. If zero length, identifier must be specified.

identifier

The QuickDraw font identifier. Can be 0, but if so, name must be specified.

style

The QuickDraw font style.

size

The point size for the font reference. If 0.0 is specified, the default size of 12.0 is used.

Return Value

The best font instance matching the QuickDraw instance information.

Discussion

This function is provided for compatibility support between Core Text and clients needing to support QuickDraw-style font references. QuickDraw is a deprecated technology in Mac OS X v10.4 and later.

Availability
Declared In
CTFont.h

CTFontGetAdvancesForGlyphs

Calculates the advances for an array of glyphs and returns the summed advance.

double CTFontGetAdvancesForGlyphs (
   CTFontRef font,
   CTFontOrientation orientation,
   const CGGlyph glyphs[],
   CGSize advances[],
   CFIndex count
);

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 objects to receive the computed glyph advances. If NULL, only the overall advance is calculated.

count

The capacity of the glyphs and advances buffers.

Return Value

The summed glyph advance of an array of glyphs.

Discussion

Individual glyph advances are passed back via the advances parameter. These are the ideal metrics for each glyph scaled and transformed in font space.

Availability
Declared In
CTFont.h

CTFontGetAscent

Returns the scaled font-ascent metric of the given font.

CGFloat CTFontGetAscent (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

The font-ascent metric scaled according to the point size and matrix of the font reference.

Availability
Declared In
CTFont.h

CTFontGetBoundingBox

Returns the scaled bounding box of the given font.

CGRect CTFontGetBoundingBox (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

The design bounding box of the font, which is the rectangle defined by xMin, yMin, xMax, and yMax values for the font. Returns CGRectNull on error.

Availability
Declared In
CTFont.h

CTFontGetBoundingRectsForGlyphs

Calculates the bounding rects for an array of glyphs and returns the overall bounding rectangle for the glyph run.

CGRect CTFontGetBoundingRectsForGlyphs (
   CTFontRef font,
   CTFontOrientation orientation,
   const CGGlyph glyphs[],
   CGRect boundingRects[],
   CFIndex count
);

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

On output, the computed glyph rectangles in an array of count number of CGRect objects. If NULL, only the overall bounding rectangle is calculated.

count

The capacity of the glyphs and boundingRects buffers.

Return Value

The overall bounding rectangle for an array or run of glyphs. Returns CGRectNull on error.

Discussion

The bounding rectangles of the individual glyphs are returned through the boundingRects parameter. These are the design metrics from the font transformed in font space.

Availability
Declared In
CTFont.h

CTFontGetCapHeight

Returns the cap-height metric of the given font.

CGFloat CTFontGetCapHeight (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

The font cap-height metric scaled according to the point size and matrix of the font reference.

Availability
Declared In
CTFont.h

CTFontGetDescent

Returns the scaled font-descent metric of the given font.

CGFloat CTFontGetDescent (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

The font-descent metric scaled according to the point size and matrix of the font reference.

Availability
Declared In
CTFont.h

CTFontGetGlyphCount

Returns the number of glyphs of the given font.

CFIndex CTFontGetGlyphCount (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

The number of glyphs in the font.

Availability
Declared In
CTFont.h

CTFontGetGlyphsForCharacters

Provides basic Unicode encoding for the given font, returning by reference an array of CGGlyph values corresponding to a given array of Unicode characters for the given font.

Boolean CTFontGetGlyphsForCharacters (
   CTFontRef font,
   const UniChar characters[],
   CGGlyph glyphs[],
   CFIndex count
);

Parameters
font

The font reference.

characters

An array of Unicode characters.

glyphs

On output, points to an array of glyph values.

count

The capacity of the character and glyph arrays.

Return Value

True if the font could encode all Unicode characters; otherwise False.

Discussion

If a glyph could not be encoded, a value of 0 is passed back at the corresponding index in the glyphs array and the function returns False. It is the responsibility of the caller to handle the Unicode properties of the input characters.

Availability
Declared In
CTFont.h

CTFontGetGlyphWithName

Returns the CGGlyph value for the specified glyph name in the given font.

CGGlyph CTFontGetGlyphWithName (
   CTFontRef font,
   CFStringRef glyphName
);

Parameters
font

The font reference.

glyphName

The glyph name as a CFString object.

Return Value

The glyph value for the named glyph as a CGGlyph object, or if the glyph name is not recognized, the .notdef glyph index value.

Discussion

The returned CGGlyph object can be used with any of the subsequent glyph data accessors or directly with Core Graphics.

Availability
Declared In
CTFont.h

CTFontGetLeading

Returns the scaled font-leading metric of the given font.

CGFloat CTFontGetLeading (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

The font-leading metric scaled according to the point size and matrix of the font reference.

Availability
Declared In
CTFont.h

CTFontGetMatrix

Returns the transformation matrix of the given font.

CGAffineTransform CTFontGetMatrix (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

The transformation matrix for the given font reference. This is the matrix that was provided when the font was created.

Availability
Declared In
CTFont.h

CTFontGetPlatformFont

Returns an ATS font reference and attributes.

ATSFontRef CTFontGetPlatformFont (
   CTFontRef font,
   CTFontDescriptorRef *attributes
);

Parameters
font

The font reference.

attributes

On output, points to a font descriptor containing additional attributes from the font. Can be NULL. Must be released by the caller.

Return Value

An ATSFontRef object for the given font reference.

Availability
Declared In
CTFont.h

CTFontGetSize

Returns the point size of the given font.

CGFloat CTFontGetSize (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

The point size of the given font reference. This is the point size provided when the font was created.

Availability
Declared In
CTFont.h

CTFontGetSlantAngle

Returns the slant angle of the given font.

CGFloat CTFontGetSlantAngle (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

The transformed slant angle of the font. This is equivalent to the italic or caret angle with any skew from the tranformation matrix applied.

Availability
Declared In
CTFont.h

CTFontGetStringEncoding

Returns the best string encoding for legacy format support.

CFStringEncoding CTFontGetStringEncoding (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

The best string encoding for the font.

Availability
Declared In
CTFont.h

CTFontGetSymbolicTraits

Returns the symbolic traits of the given font.

CTFontSymbolicTraits CTFontGetSymbolicTraits (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

The symbolic traits of the font. This is equivalent to the kCTFontSymbolicTrait value of the traits dictionary.

Discussion

See the Constants section of CTFontDescriptor Reference for a definition of the font traits.

Availability
Declared In
CTFont.h

CTFontGetTypeID

Returns the type identifier for Core Text font references.

CFTypeID CTFontGetTypeID (
   void
);

Return Value

The identifier for the CTFont opaque type.

Availability
Declared In
CTFont.h

CTFontGetUnderlinePosition

Returns the scaled underline position of the given font.

CGFloat CTFontGetUnderlinePosition (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

The font underline-position metric scaled according to the point size and matrix of the font reference.

Availability
Declared In
CTFont.h

CTFontGetUnderlineThickness

Returns the scaled underline-thickness metric of the given font.

CGFloat CTFontGetUnderlineThickness (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

The font underline-thickness metric scaled according to the point size and matrix of the font reference.

Availability
Declared In
CTFont.h

CTFontGetUnitsPerEm

Returns the units-per-em metric of the given font.

unsigned CTFontGetUnitsPerEm (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

The units per em of the font.

Availability
Declared In
CTFont.h

CTFontGetVerticalTranslationsForGlyphs

Calculates the offset from the default (horizontal) origin to the vertical origin for an array of glyphs.

void CTFontGetVerticalTranslationsForGlyphs (
   CTFontRef font,
   const CGGlyph glyphs[],
   CGSize translations[],
   CFIndex count
);

Parameters
font

The font reference.

glyphs

An array of count number of glyphs.

translations

On output, the computed origin offsets in an array of count number of CGSize objects.

count

The capacity of the glyphs and translations buffers.

Availability
Declared In
CTFont.h

CTFontGetXHeight

Returns the x-height metric of the given font.

CGFloat CTFontGetXHeight (
   CTFontRef font
);

Parameters
font

The font reference.

Return Value

The font x-height metric scaled according to the point size and matrix of the font reference.

Availability
Declared In
CTFont.h

Data Types

CTFontRef

A reference to a Core Text font object.

typedef const struct __CTFont *CTFontRef;

Availability
Declared In
CTFont.h

Constants

Global Variables

Name Specifier Constants

Name specifier constants provide access to the different names associated with a font.

const CFStringRef kCTFontCopyrightNameKey;
const CFStringRef kCTFontFamilyNameKey;
const CFStringRef kCTFontSubFamilyNameKey;
const CFStringRef kCTFontStyleNameKey;
const CFStringRef kCTFontUniqueNameKey;
const CFStringRef kCTFontFullNameKey;
const CFStringRef kCTFontVersionNameKey;
const CFStringRef kCTFontPostScriptNameKey;
const CFStringRef kCTFontTrademarkNameKey;
const CFStringRef kCTFontManufacturerNameKey;
const CFStringRef kCTFontDesignerNameKey;
const CFStringRef kCTFontDescriptionNameKey;
const CFStringRef kCTFontVendorURLNameKey;
const CFStringRef kCTFontDesignerURLNameKey;
const CFStringRef kCTFontLicenseNameKey;
const CFStringRef kCTFontLicenseURLNameKey;
const CFStringRef kCTFontSampleTextNameKey;
const CFStringRef kCTFontPostScriptCIDNameKey;

Constants
kCTFontCopyrightNameKey

The name specifier for the copyright name.

Available in Mac OS X v10.5 and later.

Declared in CTFont.h

kCTFontFamilyNameKey

The name specifier for the family name.

Available in Mac OS X v10.5 and later.

Declared in CTFont.h

kCTFontSubFamilyNameKey

The name specifier for the subfamily name.

Available in Mac OS X v10.5 and later.

Declared in CTFont.h

kCTFontStyleNameKey

The name specifier for the style name.

Available in Mac OS X v10.5 and later.

Declared in CTFont.h

kCTFontUniqueNameKey

The name specifier for the unique name.

Available in Mac OS X v10.5 and later.

Declared in CTFont.h

kCTFontFullNameKey

The name specifier for the full name.

Available in Mac OS X v10.5 and later.

Declared in CTFont.h

kCTFontVersionNameKey

The name specifier for the version name.

Available in Mac OS X v10.5 and later.

Declared in CTFont.h

kCTFontPostScriptNameKey

The name specifier for the PostScript name.

Available in Mac OS X v10.5 and later.

Declared in CTFont.h

kCTFontTrademarkNameKey

The name specifier for the trademark name.

Available in Mac OS X v10.5 and later.

Declared in CTFont.h

kCTFontManufacturerNameKey

The name specifier for the manufacturer name.

Available in Mac OS X v10.5 and later.

Declared in CTFont.h

kCTFontDesignerNameKey

The name specifier for the designer name.

Available in Mac OS X v10.5 and later.

Declared in CTFont.h

kCTFontDescriptionNameKey

The name specifier for the description name.

Available in Mac OS X v10.5 and later.

Declared in CTFont.h

kCTFontVendorURLNameKey

The name specifier for the vendor URL name.

Available in Mac OS X v10.5 and later.

Declared in CTFont.h

kCTFontDesignerURLNameKey

The name specifier for the designer URL name.

Available in Mac OS X v10.5 and later.

Declared in CTFont.h

kCTFontLicenseNameKey

The name specifier for the license name.

Available in Mac OS X v10.5 and later.

Declared in CTFont.h

kCTFontLicenseURLNameKey

The name specifier for the license URL name.

Available in Mac OS X v10.5 and later.

Declared in CTFont.h

kCTFontSampleTextNameKey

The name specifier for the sample text name string.

Available in Mac OS X v10.5 and later.

Declared in CTFont.h

kCTFontPostScriptCIDNameKey

The name specifier for the PostScript character identifier (CID) font name.

Available in Mac OS X v10.5 and later.

Declared in CTFont.h

Declared In
CTFont.h

Font Variation Axis Dictionary Keys

These constants provide keys to font variation axis dictionary values.

const CFStringRef kCTFontVariationAxisIdentifierKey;
const CFStringRef kCTFontVariationAxisMinimumValueKey;
const CFStringRef kCTFontVariationAxisMaximumValueKey;
const CFStringRef kCTFontVariationAxisDefaultValueKey;
const CFStringRef kCTFontVariationAxisNameKey;

Constants
kCTFontVariationAxisIdentifierKey

Key to get the variation axis identifier value as a CFNumberRef object.

Available in Mac OS X v10.5 and later.

Declared in CTFont.h

<