public TypographyFeatureInfo(CanvasTypographyFeatureName n)
        {
            Feature = n;

            if (IsNamedFeature(Feature))
            {
                DisplayName = Feature.Humanize().Transform(To.TitleCase);
            }
            else
            {
                //
                // For custom font features, we can produce the OpenType feature tag
                // using the feature name.
                //
                uint id = (uint)(Feature);
                DisplayName = DirectWrite.GetTagName(id);
            }
        }
示例#2
0
        public TypographyFeatureInfo(CanvasTypographyFeatureName n)
        {
            Feature = n;

            if (IsNamedFeature(Feature))
            {
                DisplayName = Feature.Humanize().Transform(To.TitleCase);
            }
            else
            {
                //
                // For custom font features, we can produce the OpenType feature tag
                // using the feature name.
                //
                uint id = (uint)(Feature);
                DisplayName = ("Custom: ") +
                              ((char)((id >> 24) & 0xFF)) +
                              ((char)((id >> 16) & 0xFF)) +
                              ((char)((id >> 8) & 0xFF)) +
                              ((char)((id >> 0) & 0xFF));
            }
        }