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); }
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); } }
public FontTypefaceHandler(sw.Font font) { Font = font; Control = new sw.FontFace(font); }