Example #1
0
        public static FontStyles GetStyleFontStyle(Style style, StyleInstance styleInstance)
        {
            ReportEnumProperty <FontStyles> fontStyle = style.FontStyle;

            if (MappingHelper.IsStylePropertyDefined(fontStyle))
            {
                if (!fontStyle.IsExpression)
                {
                    return(fontStyle.Value);
                }
                return(styleInstance.FontStyle);
            }
            return(FontStyles.Normal);
        }
Example #2
0
        public static TextDecorations GetStyleFontTextDecoration(Style style, StyleInstance styleInstance)
        {
            ReportEnumProperty <TextDecorations> textDecoration = style.TextDecoration;

            if (MappingHelper.IsStylePropertyDefined(textDecoration))
            {
                if (!textDecoration.IsExpression)
                {
                    return(textDecoration.Value);
                }
                return(styleInstance.TextDecoration);
            }
            return(TextDecorations.None);
        }
Example #3
0
        public static string GetStyleFontFamily(Style style, StyleInstance styleInstance, string fallbackFont)
        {
            ReportStringProperty fontFamily = style.FontFamily;

            if (MappingHelper.IsStylePropertyDefined(fontFamily))
            {
                if (!fontFamily.IsExpression)
                {
                    if (fontFamily != null)
                    {
                        return(fontFamily.Value);
                    }
                }
                else if (styleInstance.FontFamily != null)
                {
                    return(styleInstance.FontFamily);
                }
            }
            return(fallbackFont);
        }
Example #4
0
        public static float GetStyleFontSize(Style style, StyleInstance styleInstance)
        {
            ReportSizeProperty fontSize = style.FontSize;

            if (MappingHelper.IsStylePropertyDefined(fontSize))
            {
                if (!fontSize.IsExpression)
                {
                    return((float)fontSize.Value.ToPoints());
                }
                if (styleInstance.FontSize != null)
                {
                    ReportSize fontSize2 = styleInstance.FontSize;
                    if (fontSize2 != null)
                    {
                        return((float)fontSize2.ToPoints());
                    }
                }
            }
            return(MappingHelper.DefaultFontSize);
        }