Example #1
0
 /// <summary>
 /// Releases font.
 /// </summary>
 internal void ClearFont()
 {
     if (null != this.font)
     {
         this.engine.GetFontsFactory(this.window.Desktop.Theme).DeleteFont(this.font);
         this.font = null;
     }
 }
Example #2
0
        /// <summary>
        /// If requested builds and returns font.
        /// </summary>
        /// <returns></returns>
        private IFont GetFont()
        {
            if ((null != this.font) && (this.font.Name == this.name) && (this.font.Size == this.size) && (this.font.Bold == this.bold) && (this.font.Italic == this.italic))
            {
                return this.font;
            }

            ClearFont();

            this.font = this.engine.GetFontsFactory(this.window.Desktop.Theme).CreateFont(this.name, this.size, this.bold, this.italic, this.engine, this.window.Desktop.Theme);

            return this.font;
        }
Example #3
0
        /// <summary>
        /// Releases font object. Cheks reference count to object if its zero deletes fonts object.
        /// </summary>
        /// <param name="font"></param>
        internal void DeleteFont(IFont font)
        {
            if (null != font)
            {
                int count = font.Release();

                if (count <= 0)
                {
                    this.loadedFonts.Remove(font);
                }
            }
        }