Exemplo n.º 1
0
        public float FontSize(System.Drawing.Font font)
        {
            try
            {
                return (0.85f * font.GetHeight(this.graphics_.DpiX));
            }
            catch
            {
				return 1f;
            }
        }
Exemplo n.º 2
0
 private float getLineHeight(System.Drawing.Font font)
 {
     return font.GetHeight();
 }
Exemplo n.º 3
0
        // Calculates a set of column offset info based on measurements of the font and the display geometry
        protected void CalcColumns(System.Drawing.Font font)
        {
            if (!active || font == null)
                return;

            SizeF max_suf_bounds = dev.graph.MeasureString(big_suf, font, new Point(0, 0), fmt_default);
            max_suffix_width = (int)(max_suf_bounds.Width + 1);

            SizeF max_lab_bounds = dev.graph.MeasureString(big_lab, font, new Point(0, 0), fmt_default);
            max_lab_width = (int)(max_lab_bounds.Width);

            int small_col = max_lab_width;
            int large_col = (width - (small_col * 2)) / 2;

            line_offset = (float)Math.Round(font.GetHeight());

            if (two_column_labeled_offsets == null)
                two_column_labeled_offsets = new int[5];
            two_column_labeled_offsets[0] = xoff + 0;
            two_column_labeled_offsets[1] = xoff + small_col;
            two_column_labeled_offsets[2] = two_column_labeled_offsets[1] + large_col;
            two_column_labeled_offsets[3] = two_column_labeled_offsets[2] + small_col;
            two_column_labeled_offsets[4] = xoff + width;

            if (two_column_offsets == null)
                two_column_offsets = new int[3];
            two_column_offsets[0] = xoff + 0;
            two_column_offsets[1] = xoff + width / 2;
            two_column_offsets[2] = xoff + width;
        }
Exemplo n.º 4
0
        private double GetFontHeight(System.Drawing.Font font)
        {
            double resValue = 0;
            double height = 0;

            height = font.GetHeight() / 1.2;
            resValue = Math.Max(height, 14.25);

            return resValue;
        }