Esempio n. 1
0
        /// <summary>
        /// Creates a new font set.
        /// </summary>
        /// <param name="family">The font family.</param>
        /// <param name="size">Size in pixels.</param>
        /// <param name="resolution">Resolution in dpi.</param>
        public FontAssetCore(FontFamily family, int size, uint resolution)
        {
            _family     = family;
            _resolution = resolution;

            FT_FaceRec face = (FT_FaceRec)Marshal.PtrToStructure(_family.Face, typeof(FT_FaceRec));

            _charSet = new BitmapCharacterSet(face.num_glyphs)
            {
                RenderedSize = size,
                Width        = MAX_WIDTH,
                Height       = MAX_HEIGHT
            };
            _charSet.Ascender = _charSet.RenderedSize * face.ascender / face.height;
        }
Esempio n. 2
0
    /// <summary>
    /// Creates a new font set.
    /// </summary>
    /// <param name="family">The font family.</param>
    /// <param name="size">Size in pixels.</param>
    /// <param name="resolution">Resolution in dpi.</param>
    public FontAssetCore(FontFamily family, int size, uint resolution)
    {
      _family = family;
      _resolution = resolution;

      FT_FaceRec face = (FT_FaceRec) Marshal.PtrToStructure(_family.Face, typeof(FT_FaceRec));

      _charSet = new BitmapCharacterSet(face.num_glyphs)
        {
          RenderedSize = size,
          Width = MAX_WIDTH,
          Height = MAX_HEIGHT
        };
      _charSet.Base = _charSet.RenderedSize * face.ascender / face.height;
    }