Esempio n. 1
0
 public override object Create(string fontName, double size, FontStyle style, FontWeight weight, FontStretch stretch)
 {
     size = GetPointsFromDeviceUnits(size);
     return(new FontData(new FontFamily(fontName), size)
     {
         Style = style.ToWpfFontStyle(),
         Weight = weight.ToWpfFontWeight(),
         Stretch = stretch.ToWpfFontStretch()
     });
 }
Esempio n. 2
0
        public override object Create(string fontName, double size, FontStyle style, FontWeight weight, FontStretch stretch)
        {
            FontFamily fontFamily;

            if (!registeredFonts.TryGetValue(fontName, out fontFamily))
            {
                fontFamily = new FontFamily(fontName);
            }

            size = GetPointsFromDeviceUnits(size);
            return(new FontData(fontFamily, size)
            {
                Style = style.ToWpfFontStyle(),
                Weight = weight.ToWpfFontWeight(),
                Stretch = stretch.ToWpfFontStretch()
            });
        }