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;
        }
예제 #2
0
		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;
		}
예제 #3
0
        FontData GetWidgetFont()
        {
            if (!(Widget is Control))
            {
                return(FontData.SystemDefault);
            }

            return(FontData.FromControl((Control)Widget));
        }
예제 #4
0
        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;
        }
예제 #5
0
        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;
        }
예제 #6
0
        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));
        }
예제 #7
0
        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;
        }
예제 #8
0
 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;
 }
예제 #9
0
파일: WidgetBackend.cs 프로젝트: garuma/xwt
        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;
        }
예제 #10
0
        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;
        }
예제 #11
0
		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;
		}
예제 #12
0
파일: WidgetBackend.cs 프로젝트: silwol/xwt
        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;
        }