コード例 #1
0
        }         //HtmlFontProperty

        // constructor given a system Font
        public HtmlFontProperty(System.Drawing.Font font)
        {
            _name        = font.Name;
            _size        = HtmlFontConversion.FontSizeToHtml(font.SizeInPoints);
            _bold        = font.Bold;
            _italic      = font.Italic;
            _underline   = font.Underline;
            _strikeout   = font.Strikeout;
            _subscript   = false;
            _superscript = false;
        }         //HtmlFontProperty
コード例 #2
0
        }         //FontSizeFromHtml

        // Used to determine the HtmlFontSize from a style attribute
        public static HtmlFontSize StyleSizeToHtml(string sizeDesc)
        {
            // currently assume the value is a fixed point
            // should take into account relative and absolute values
            float size;

            try
            {
                size = Single.Parse(Regex.Replace(sizeDesc, @"[^\d|\.]", ""));
            }
            catch (Exception)
            {
                // set size to zero to return HtmlFontSize.Default
                size = 0;
            }

            // return value as a HtmlFontSize
            return(HtmlFontConversion.FontSizeToHtml(size));
        }         //StyleSizeToHtml
コード例 #3
0
        }         //FontSizeToHtml

        // determine the font size given the html font size
        public static float FontSizeFromHtml(HtmlFontSize fontSize)
        {
            return(HtmlFontConversion.FontSizeFromHtml((int)fontSize));
        }         //FontSizeFromHtml