Пример #1
0
 public Font GetFontFromCache(int id, Style style, StyleInstance styleInstance)
 {
     return(this.GetFontFromCache(id, MappingHelper.GetStyleFontFamily(style, styleInstance, this.GetDefaultFont().Name), MappingHelper.GetStyleFontSize(style, styleInstance), MappingHelper.GetStyleFontStyle(style, styleInstance), MappingHelper.GetStyleFontWeight(style, styleInstance), MappingHelper.GetStyleFontTextDecoration(style, styleInstance)));
 }
Пример #2
0
 protected Font GetFont(Style style, StyleInstance styleInstance)
 {
     return(this.m_fontCache.GetFont(MappingHelper.GetStyleFontFamily(style, styleInstance, this.GetDefaultFont().Name), MappingHelper.GetStyleFontSize(style, styleInstance), MappingHelper.GetStyleFontStyle(MappingHelper.GetStyleFontStyle(style, styleInstance), MappingHelper.GetStyleFontWeight(style, styleInstance), MappingHelper.GetStyleFontTextDecoration(style, styleInstance))));
 }
Пример #3
0
        public Font GetFont(Style style, StyleInstance styleInstance, bool hasScope)
        {
            if (style == null)
            {
                return(this.m_mapMapper.GetDefaultFontFromCache(0));
            }
            string text = MappingHelper.DefaultFontFamily;

            if (this.m_mapMapper.GetDefaultFont() != null)
            {
                text = this.m_mapMapper.GetDefaultFont().Name;
            }
            if (!MappingHelper.IsPropertyExpression(style.FontFamily) || hasScope)
            {
                text = MappingHelper.GetStyleFontFamily(style, styleInstance, text);
            }
            float           fontSize       = (MappingHelper.IsPropertyExpression(style.FontSize) && !hasScope) ? MappingHelper.DefaultFontSize : MappingHelper.GetStyleFontSize(style, styleInstance);
            FontStyles      fontStyle      = (MappingHelper.IsPropertyExpression(style.FontStyle) && !hasScope) ? FontStyles.Normal : MappingHelper.GetStyleFontStyle(style, styleInstance);
            FontWeights     fontWeight     = (MappingHelper.IsPropertyExpression(style.FontWeight) && !hasScope) ? FontWeights.Normal : MappingHelper.GetStyleFontWeight(style, styleInstance);
            TextDecorations textDecoration = (MappingHelper.IsPropertyExpression(style.TextDecoration) && !hasScope) ? TextDecorations.None : MappingHelper.GetStyleFontTextDecoration(style, styleInstance);

            return(this.m_mapMapper.GetFontFromCache(0, text, fontSize, fontStyle, fontWeight, textDecoration));
        }