Esempio n. 1
0
 internal CTFrame(IntPtr handle, bool owns)
 {
     if (handle == IntPtr.Zero)
     {
         throw ConstructorError.ArgumentNull(this, "handle");
     }
     this.handle = handle;
     if (!owns)
     {
         CFObject.CFRetain(handle);
     }
 }
Esempio n. 2
0
 public CTFont(CGFont font, float size, CGAffineTransform transform)
 {
     if (font == null)
     {
         throw new ArgumentNullException("font");
     }
     handle = CTFontCreateWithGraphicsFont(font.Handle, size, ref transform, IntPtr.Zero);
     if (handle == IntPtr.Zero)
     {
         throw ConstructorError.Unknown(this);
     }
 }
Esempio n. 3
0
 public CTFont(CGFont font, float size, CTFontDescriptor descriptor)
 {
     if (font == null)
     {
         throw new ArgumentNullException("font");
     }
     handle = CTFontCreateWithGraphicsFont2(font.Handle, size, IntPtr.Zero, descriptor == null ? IntPtr.Zero : descriptor.Handle);
     if (handle == IntPtr.Zero)
     {
         throw ConstructorError.Unknown(this);
     }
 }
Esempio n. 4
0
 public CTFont(CTFontDescriptor descriptor, float size, ref CGAffineTransform matrix)
 {
     if (descriptor == null)
     {
         throw ConstructorError.ArgumentNull(this, "descriptor");
     }
     handle = CTFontCreateWithFontDescriptor(descriptor.Handle, size, ref matrix);
     if (handle == IntPtr.Zero)
     {
         throw ConstructorError.Unknown(this);
     }
 }
Esempio n. 5
0
 public CTFontCollection(CTFontDescriptor[] queryDescriptors, CTFontCollectionOptions options)
 {
     using (var descriptors = queryDescriptors == null
                                 ? null
                                 : CFArray.FromNativeObjects(queryDescriptors))
         handle = CTFontCollectionCreateWithFontDescriptors(
             descriptors == null ? IntPtr.Zero : descriptors.Handle,
             options == null ? IntPtr.Zero : options.Dictionary.Handle);
     if (handle == IntPtr.Zero)
     {
         throw ConstructorError.Unknown(this);
     }
 }
Esempio n. 6
0
 public CTFontDescriptor(string name, float size)
 {
     if (name == null)
     {
         throw ConstructorError.ArgumentNull(this, "name");
     }
     using (CFString n = name)
         handle = CTFontDescriptorCreateWithNameAndSize(n.Handle, size);
     if (handle == IntPtr.Zero)
     {
         throw ConstructorError.Unknown(this);
     }
 }
 public CTFont(CTFontUIFontType uiType, float size, string language)
 {
     if (language == null)
     {
         throw ConstructorError.ArgumentNull(this, "language");
     }
     using (CFString l = language)
         handle = CTFontCreateUIFontForLanguage(uiType, size, l.Handle);
     if (handle == IntPtr.Zero)
     {
         throw ConstructorError.Unknown(this);
     }
 }
 public CTFont(CTFontDescriptor descriptor, float size, CTFontOptions options)
 {
     if (descriptor == null)
     {
         throw ConstructorError.ArgumentNull(this, "descriptor");
     }
     handle = CTFontCreateWithFontDescriptorAndOptions(descriptor.Handle,
                                                       size, IntPtr.Zero, options);
     if (handle == IntPtr.Zero)
     {
         throw ConstructorError.Unknown(this);
     }
 }
 public CTFont(string name, float size, ref CGAffineTransform matrix, CTFontOptions options)
 {
     if (name == null)
     {
         throw ConstructorError.ArgumentNull(this, "name");
     }
     using (CFString n = name)
         handle = CTFontCreateWithNameAndOptions(n.Handle, size, ref matrix, options);
     if (handle == IntPtr.Zero)
     {
         throw ConstructorError.Unknown(this);
     }
 }
 public CTFont(string name, float size)
 {
     if (name == null)
     {
         throw ConstructorError.ArgumentNull(this, "name");
     }
     using (NSString n = new NSString(name))
         handle = CTFontCreateWithName(n.Handle, size, IntPtr.Zero);
     if (handle == IntPtr.Zero)
     {
         throw ConstructorError.Unknown(this);
     }
 }
Esempio n. 11
0
        public CTRunDelegate(CTRunDelegateOperations operations)
        {
            if (operations == null)
            {
                throw ConstructorError.ArgumentNull(this, "operations");
            }

            handle = CTRunDelegateCreate(operations.GetCallbacks(), GCHandle.ToIntPtr(operations.handle));
            if (handle == IntPtr.Zero)
            {
                throw ConstructorError.Unknown(this);
            }
        }
Esempio n. 12
0
        public CTLine(NSAttributedString value)
        {
            if (value == null)
            {
                throw ConstructorError.ArgumentNull(this, "value");
            }

            Handle = CTLineCreateWithAttributedString(value.Handle);

            if (Handle == IntPtr.Zero)
            {
                throw ConstructorError.Unknown(this);
            }
        }
Esempio n. 13
0
        public CTTypesetter(NSAttributedString value, CTTypesetterOptions options)
        {
            if (value == null)
            {
                throw ConstructorError.ArgumentNull(this, "value");
            }

            handle = CTTypesetterCreateWithAttributedStringAndOptions(value.Handle,
                                                                      options == null ? IntPtr.Zero : options.Dictionary.Handle);

            if (handle == IntPtr.Zero)
            {
                throw ConstructorError.Unknown(this);
            }
        }
Esempio n. 14
0
        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);
            }
        }
Esempio n. 15
0
        public CTGlyphInfo(CGGlyph glyph, CTFont font, string baseString)
        {
            if (font == null)
            {
                throw ConstructorError.ArgumentNull(this, "font");
            }
            if (baseString == null)
            {
                throw ConstructorError.ArgumentNull(this, "baseString");
            }

            using (var bs = new NSString(baseString))
                handle = CTGlyphInfoCreateWithGlyph(glyph, font.Handle, bs.Handle);

            if (handle == IntPtr.Zero)
            {
                throw ConstructorError.Unknown(this);
            }
        }
Esempio n. 16
0
        public CTGlyphInfo(string glyphName, CTFont font, string baseString)
        {
            if (glyphName == null)
            {
                throw ConstructorError.ArgumentNull(this, "glyphName");
            }
            if (font == null)
            {
                throw ConstructorError.ArgumentNull(this, "font");
            }
            if (baseString == null)
            {
                throw ConstructorError.ArgumentNull(this, "baseString");
            }

            using (var gn = new NSString(glyphName))
                using (var bs = new NSString(baseString))
                    Handle = CTGlyphInfoCreateWithGlyphName(gn.Handle, font.Handle, bs.Handle);

            if (Handle == IntPtr.Zero)
            {
                throw ConstructorError.Unknown(this);
            }
        }