示例#1
0
        /// <summary>
        /// Creates a new VectorFont with the File specified at path and the specified size in pixels.
        /// It is assumed that the font is either Monospaced or only single chars are used.
        /// </summary>
        /// <param name="path">path to the font-file</param>
        /// <param name="size">size in pixles</param>
        public VectorFont(string path, uint size)
        {
            lib = new Library();

            face = new Face(lib, path);

            face.SetPixelSizes(0, size);

            this.size = face.Size;
        }
示例#2
0
 internal void RemoveChildSize(FTSize child)
 {
     childSizes.Remove(child);
 }
示例#3
0
 internal void AddChildSize(FTSize child)
 {
     childSizes.Add(child);
 }
示例#4
0
        /// <summary>
        /// Sets a new font size in pixels
        /// </summary>
        /// <param name="pixels">size in pixels</param>
        public void SetSize(uint pixels)
        {
            face.SetPixelSizes(0, pixels);

            foreach (VectorGlyph glyph in database.Values)
            {
                glyph.Dispose();
            }

            database = new Dictionary<char, VectorGlyph>();

            this.size.Dispose();

            this.size = face.Size;
        }