Beispiel #1
0
 public CTFontCollection(CTFontCollectionOptions options)
 {
     handle = CTFontCollectionCreateFromAvailableFonts (
             options == null ? IntPtr.Zero : options.Dictionary.Handle);
     if (handle == IntPtr.Zero)
         throw ConstructorError.Unknown (this);
 }
Beispiel #2
0
 public CTFontCollection(CTFontCollectionOptions options)
 {
     handle = CTFontCollectionCreateFromAvailableFonts(
         options == null ? IntPtr.Zero : options.Dictionary.Handle);
     if (handle == IntPtr.Zero)
     {
         throw ConstructorError.Unknown(this);
     }
 }
Beispiel #3
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);
 }
Beispiel #4
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);
     }
 }
Beispiel #5
0
        public CTFontCollection WithFontDescriptors(CTFontDescriptor[] queryDescriptors, CTFontCollectionOptions options)
        {
            IntPtr h;

            using (var descriptors = queryDescriptors == null
                                        ? null
                                        : CFArray.FromNativeObjects(queryDescriptors)) {
                h = CTFontCollectionCreateCopyWithFontDescriptors(
                    handle,
                    descriptors == null ? IntPtr.Zero : descriptors.Handle,
                    options == null ? IntPtr.Zero : options.Dictionary.Handle);
            }
            if (h == IntPtr.Zero)
            {
                return(null);
            }
            return(new CTFontCollection(h, true));
        }
Beispiel #6
0
 public CTFontCollection WithFontDescriptors(CTFontDescriptor[] queryDescriptors, CTFontCollectionOptions options)
 {
     IntPtr h;
     using (var descriptors = queryDescriptors == null
             ? null
             : CFArray.FromNativeObjects (queryDescriptors)) {
         h = CTFontCollectionCreateCopyWithFontDescriptors (
                 handle,
                 descriptors == null ? IntPtr.Zero : descriptors.Handle,
                 options == null ? IntPtr.Zero : options.Dictionary.Handle);
     }
     if (h == IntPtr.Zero)
         return null;
     return new CTFontCollection (h, true);
 }