Пример #1
0
        public FontVariant(CanvasFontFace face, StorageFile file, DWriteProperties dwProps)
        {
            FontFace   = face;
            FamilyName = dwProps.FamilyName;

            if (file != null)
            {
                IsImported = true;
                FileName   = file.Name;
                Source     = $"{FontFinder.GetAppPath(file)}#{dwProps.FamilyName}";
            }
            else
            {
                Source = dwProps.FamilyName;
            }

            string name = dwProps.FaceName;

            if (String.IsNullOrEmpty(name))
            {
                name = Utils.GetVariantDescription(face);
            }

            DirectWriteProperties = dwProps;
            PreferredName         = name;
            Panose = PanoseParser.Parse(face);
        }
Пример #2
0
 public Panose(PanoseFamily family, SerifStyle style)
 {
     Family           = family;
     Style            = style;
     IsSansSerifStyle = PanoseParser.IsSansSerif(Style);
     IsSerifStyle     =
         Style != SerifStyle.Any &&
         Style != SerifStyle.NoFit &&
         Family != PanoseFamily.NoFit &&
         Family != PanoseFamily.Script &&
         Family != PanoseFamily.Decorative &&
         !IsSansSerifStyle;
 }