Esempio n. 1
0
        public static string AddHtmlFontTag(this string pValue, string pColor, uFontSize pSize, uFontWeight pFontWeight, uFontStyle pFontStyle
                                            , uTextDecoration pTextDecoration, uTextAlign pAlign, uFontName pFontName)
        {
            string size       = pSize.ToString().Replace("xx", "xx-").Replace("x", "x-");
            string weight     = pFontWeight.ToString();
            string fontStyle  = pFontStyle.ToString();
            string decoration = pTextDecoration.ToString().Replace('_', '-');
            string align      = pAlign.ToString();
            string fontName   = pFontName.ToString().Replace("_", "").Replace("Sans Serif", "Sans-Serif");

            string s = @"<font style=
                        'color: {1}; 
                        font-size: {2}; 
                        font-weight: {3}; 
                        font-style: {4}; 
                        text-decoration: {5};
                        text-align:{6};'
                        font-family: {7};
                     >
                        {0}
                    </font>";

            s = string.Format(s, pValue, pColor, size, weight, fontStyle, decoration, align, fontName);
            return(s);
        }
Esempio n. 2
0
 public static string AddHtmlFontTag(this string pValue, string pColor, uFontSize pSize, uFontWeight pFontWeight)
 {
     return(AddHtmlFontTag(pValue, pColor, pSize, pFontWeight, uFontStyle.normal, uTextDecoration.none, uTextAlign.left, uFontName.Arial));
 }