public FontAnalysis GetAnalysis()
        {
            if (_analysis == null)
            {
                _analysis = TypographyAnalyzer.Analyze(this);
            }

            return(_analysis);
        }
Beispiel #2
0
        /// <summary>
        /// Creates a FontAnalysis object for a FontVariant and ensures the custom
        /// search map for the font is loaded
        /// </summary>
        /// <param name="variant"></param>
        /// <returns></returns>
        public static FontAnalysis Analyze(FontVariant variant)
        {
            var analysis = new FontAnalysis(variant.FontFace);

            if (analysis.HasGlyphNames)
            {
                PrepareSearchMap(variant, analysis.GlyphNameMappings);
            }
            return(analysis);
        }
Beispiel #3
0
        /// <summary>
        /// Creates a FontAnalysis object for a FontVariant and ensures the custom
        /// search map for the font is loaded
        /// </summary>
        /// <param name="variant"></param>
        /// <returns></returns>
        public static FontAnalysis Analyze(FontVariant variant)
        {
            var analysis = new FontAnalysis(variant.FontFace);

            if (analysis.GlyphNames != null &&
                analysis.GlyphNames.Count > 0)
            {
                PrepareSearchMap(variant, analysis.GlyphNames.ToList());
            }

            // TODO : Parse Design & Script Language Tags
            // if (!string.IsNullOrWhiteSpace(analysis.DesignLanguages))
            // {
            //     var langs = analysis.DesignLanguages.Split(',');
            // }

            return(analysis);
        }