CTFontManager.UnregisterGraphicsFont(CGFont, NSError) 方法

定义

从 CoreText 字体系统取消注册 CoreGraphics 字体。

public static bool UnregisterGraphicsFont (CoreGraphics.CGFont font, out Foundation.NSError error);
static member UnregisterGraphicsFont : CoreGraphics.CGFont *  -> bool

参数

font
CGFont

要注销的 CoreGraphics 字体与 CoreText 字体系统。

error
NSError

返回错误(如果有)。

返回

成功时为 True,错误时为 false。

注解

// 
// Load font into byte array from a file.
//
byte [] myBuffer = GetEmbeddedResource ("myResource");
CGFont font = CGFont.CreateFromProvider (new CGDataProvider (myBuffer, 0, myBuffer.Count));
if (CTFontManager.RegisterGraphicsFont (font, out error)){
	//
	// access font
	//

	// Release font after we use it.
	CTFontManager.UnregisterGraphicsFont (font, out error);
}

适用于