예제 #1
0
파일: FontInfo.cs 프로젝트: drme/thw-ui
 /// <summary>
 /// Releases font.
 /// </summary>
 internal void ClearFont()
 {
     if (null != this.font)
     {
         this.engine.GetFontsFactory(this.window.Desktop.Theme).DeleteFont(this.font);
         this.font = null;
     }
 }
예제 #2
0
파일: FontInfo.cs 프로젝트: drme/thw-ui
        /// <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;
        }
예제 #3
0
파일: FontsFactory.cs 프로젝트: drme/thw-ui
        /// <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);
                }
            }
        }