Deprecated CGFont Functions

A function identified as deprecated has been superseded and may become unsupported in the future.

Deprecated in Mac OS X v10.6

CGFontCreateWithPlatformFont

Creates a font object from an Apple Type Services (ATS) font. (Deprecated in Mac OS X v10.6. Use Core Text, documented in Core Text Reference Collection, instead.)

CGFontRef CGFontCreateWithPlatformFont (
   void *platformFontReference
);
Parameters
platformFontReference

A generic pointer to a font object. The font should be of a type appropriate to the platform on which your program is running. For Mac OS X, you should pass a pointer to an ATS font.

Return Value

The font object, or NULL if the platform font could not be located. You are responsible for releasing this object using CGFontRelease.

Discussion

Before drawing text in a Quartz context, you must set the font in the current graphics state. For ATS Fonts, call this function to create a Quartz font, and pass it to CGContextSetFont.

Special Considerations

This function is deprecated because it takes a pointer to an ATSFontRef object—itself deprecated—and is used almost solely by QuickDraw-based applications. There's no direct one-to-one replacement for the function; however, Apple recommends that clients using ATSUI and QuickDraw move to Core Text and Core Graphics instead.

Availability
Declared In
CGFont.h


© 2003, 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-07-23)