Пример #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);
        }