Exemple #1
0
        public static FontStyle ToEtoStyle(this sw.Font font)
        {
            var style = FontStyle.None;

            if (font.Style == sw.FontStyle.Italic || font.Style == sw.FontStyle.Oblique)
            {
                style |= FontStyle.Italic;
            }

            if (font.Weight.IsBold())
            {
                style |= FontStyle.Bold;
            }
            return(style);
        }
Exemple #2
0
        public static bool GetFontFromFontFace(this FontCollection collection, FontFace fontFace, out SharpDX.DirectWrite.Font font)
        {
            if (comFunction == null)
            {
                comFunction = (_GetFontFromFontFace)Marshal.GetDelegateForFunctionPointer(
                    COMFunctionPointer(collection.NativePointer, INDEX_GetFontFromFontFace),
                    typeof(_GetFontFromFontFace)
                    );
            }
            font = null;
            IntPtr result;

            if (comFunction(collection.NativePointer, fontFace.NativePointer, out result) == S_OK)
            {
                font = new SharpDX.DirectWrite.Font(result);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #3
0
 public FontTypefaceHandler(sw.Font font)
 {
     Font    = font;
     Control = new sw.FontFace(font);
 }