예제 #1
0
 /// <summary>
 ///     Creates a <see cref="GdiFontMetrics"/> object from <b>baseFontName</b>
 /// </summary>
 private void ObtainFontMetrics() {
     dc = new GdiDeviceContent();
     GdiFont font = GdiFont.CreateDesignFont(
         properties.FaceName, properties.IsBold, properties.IsItalic, dc);
     unicodeRanges = new GdiUnicodeRanges(dc);
     metrics = font.GetMetrics(dc);
 }
예제 #2
0
파일: GdiFont.cs 프로젝트: nholik/FO.Net
        /// <summary>
        ///     Creates a font whose height is equal to the negative value
        ///     of the EM Square
        /// </summary>
        /// <param name="faceName">The typeface name of a font.</param>
        /// <returns></returns>
        public static GdiFont CreateDesignFont(string faceName, bool bold, bool italic, GdiDeviceContent dc)
        {
            GdiFont tempFont = GdiFont.CreateFont(faceName, 2048, bold, italic);

            dc.SelectFont(tempFont);
            GdiFontMetrics metrics = tempFont.GetMetrics(dc);

            tempFont.Dispose();

            return(CreateFont(faceName, -Math.Abs(metrics.EmSquare), bold, italic));
        }
예제 #3
0
        /// <summary>
        ///     Creates a font whose height is equal to the negative value
        ///     of the EM Square
        /// </summary>
        /// <param name="faceName">The typeface name of a font.</param>
        /// <returns></returns>
        public static GdiFont CreateDesignFont(string faceName, bool bold, bool italic, GdiDeviceContent dc)
        {
            // TODO: Is there a simpler method of obtaining the em-sqaure?
            GdiFont tempFont = GdiFont.CreateFont(faceName, 2048, bold, italic);

            dc.SelectFont(tempFont);
            GdiFontMetrics metrics = tempFont.GetMetrics(dc);

            tempFont.Dispose();

            return(CreateFont(faceName, -Math.Abs(metrics.EmSquare), bold, italic));
        }
예제 #4
0
 public PdfIdentityHEncoding(GdiFontMetrics metrics)
 {
     this.metrics = metrics;
 }