MonoMac.CoreGraphics.CGFont.CreateFromProvider Method
Creates a font from a data provider.

Syntax

public static CGFont CreateFromProvider (CGDataProvider provider)

Parameters

provider
Data provider that wraps the font.

Returns

The constructed font.

Remarks

You can use this method to create CGFonts from an in-memory representation of the font (for example, to embed binary fonts into your application to prevent easy copying of licensed fonts, or when you fetch the font from a streaming source and do not want to store it on disk).

c# Example

// 
// Load font into byte array from a file.
//
byte [] myBuffer = File.ReadAllBytes ("demo.ttf"); 
CGFont font = CGFont.CreateFromProvider (new CGDataProvider (myBuffer, 0, myBuffer.Count));

Requirements

Namespace: MonoMac.CoreGraphics
Assembly: XamMac (in XamMac.dll)
Assembly Versions: 0.0.0.0