public CTGlyphInfo(CGFontIndex cid, CTCharacterCollection collection, string baseString) { if (baseString == null) { throw ConstructorError.ArgumentNull(this, "baseString"); } using (var bs = new NSString(baseString)) handle = CTGlyphInfoCreateWithCharacterIdentifier(cid, collection, bs.Handle); if (handle == IntPtr.Zero) { throw ConstructorError.Unknown(this); } }
static IntPtr Create(CGFontIndex cid, CTCharacterCollection collection, string baseString) { if (baseString is null) { throw new ArgumentNullException(nameof(baseString)); } var bsHandle = CFString.CreateNative(baseString); try { return(CTGlyphInfoCreateWithCharacterIdentifier(cid, collection, bsHandle)); } finally { CFString.ReleaseNative(bsHandle); } }
public CTGlyphInfo (CGFontIndex cid, CTCharacterCollection collection, string baseString) { if (baseString == null) throw ConstructorError.ArgumentNull (this, "baseString"); using (var bs = new NSString (baseString)) handle = CTGlyphInfoCreateWithCharacterIdentifier (cid, collection, bs.Handle); if (handle == IntPtr.Zero) throw ConstructorError.Unknown (this); }
static extern IntPtr CTGlyphInfoCreateWithCharacterIdentifier (CGFontIndex cid, CTCharacterCollection collection, IntPtr baseString);
static extern IntPtr CTGlyphInfoCreateWithCharacterIdentifier(CGFontIndex cid, CTCharacterCollection collection, IntPtr baseString);
public CTGlyphInfo(CGFontIndex cid, CTCharacterCollection collection, string baseString) : base(Create(cid, collection, baseString), true, true) { }