public override IEnumerable <KeyValuePair <string, object> > GetAvailableFamilyFaces(string family) { FontFamily wpfFamily; if (!registeredFonts.TryGetValue(family, out wpfFamily)) // check for custom fonts { wpfFamily = new FontFamily(family); } foreach (var face in wpfFamily.GetTypefaces()) { var langCurrent = SW.Markup.XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag); var langInvariant = SW.Markup.XmlLanguage.GetLanguage("en-us");; string name; if (face.FaceNames.TryGetValue(langCurrent, out name) || face.FaceNames.TryGetValue(langInvariant, out name)) { var fontData = new FontData(wpfFamily, 0) { Style = face.Style, Weight = face.Weight, Stretch = face.Stretch }; yield return(new KeyValuePair <string, object> (name, fontData)); } } yield break; }
internal void SetFont (FontData font) { MenuItem.FontFamily = font.Family; MenuItem.FontSize = font.GetDeviceIndependentPixelSize(MenuItem); MenuItem.FontStyle = font.Style; MenuItem.FontWeight = font.Weight; MenuItem.FontStretch = font.Stretch; }
FontData GetWidgetFont() { if (!(Widget is Control)) { return(FontData.SystemDefault); } return(FontData.FromControl((Control)Widget)); }
void SetWidgetFont(FontData font) { if (!(Widget is Control)) { return; } var control = (Control)Widget; control.FontFamily = font.Family; control.FontSize = font.Size; control.FontStyle = font.Style; control.FontWeight = font.Weight; control.FontStretch = font.Stretch; }
void SetWidgetFont(FontData font) { if (!(Widget is Control)) { return; } var control = (Control)Widget; control.FontFamily = font.Family; control.FontSize = font.GetDeviceIndependentPixelSize(control); control.FontStyle = font.Style; control.FontWeight = font.Weight; control.FontStretch = font.Stretch; }
FontData GetWidgetFont() { if (!(Widget is Control)) { double size = WpfFontBackendHandler.GetPointsFromDeviceUnits(SystemFonts.MessageFontSize); return(new FontData(SystemFonts.MessageFontFamily, size) { Style = SystemFonts.MessageFontStyle, Weight = SystemFonts.MessageFontWeight }); } return(FontData.FromControl((Control)Widget)); }
void SetWidgetFont(FontData font) { if (!(Widget is Control)) { return; } var control = (Control)Widget; control.FontFamily = font.Family; control.FontSize = FontBackendHandler.GetPixelsFromPoints(font.Size, DPI); control.FontStyle = font.Style; control.FontWeight = font.Weight; control.FontStretch = font.Stretch; }
public override IEnumerable<KeyValuePair<string, object>> GetAvailableFamilyFaces(string family) { var wpfFamily = new FontFamily (family); foreach (var face in wpfFamily.GetTypefaces ()) { var langCurrent = SW.Markup.XmlLanguage.GetLanguage (CultureInfo.CurrentCulture.IetfLanguageTag); var langInvariant = SW.Markup.XmlLanguage.GetLanguage ("en-us");; string name; if (face.FaceNames.TryGetValue (langCurrent, out name) || face.FaceNames.TryGetValue (langInvariant, out name)) { var fontData = new FontData (wpfFamily, 0) { Style = face.Style, Weight = face.Weight, Stretch = face.Stretch }; yield return new KeyValuePair<string, object> (name, fontData); } } yield break; }
void SetWidgetFont(FontData font) { if (!(Widget is Control)) return; var control = (Control)Widget; control.FontFamily = font.Family; control.FontSize = font.GetDeviceIndependentPixelSize (control); control.FontStyle = font.Style; control.FontWeight = font.Weight; control.FontStretch = font.Stretch; }
void SetWidgetFont(FontData font) { if (!(Widget is Control)) return; var control = (Control)Widget; control.FontFamily = font.Family; control.FontSize = font.Size; control.FontStyle = font.Style; control.FontWeight = font.Weight; control.FontStretch = font.Stretch; }
void SetWidgetFont(FontData font) { if (!(Widget is Control)) return; var control = (Control)Widget; control.FontFamily = font.Family; control.FontSize = FontBackendHandler.GetPixelsFromPoints (font.Size, DPI); control.FontStyle = font.Style; control.FontWeight = font.Weight; control.FontStretch = font.Stretch; }