예제 #1
0
        public void SetFont(FontFace font)
        {
            if (_fonts.Count > 0)
            {
                if (CurrentFont.Equals(font))
                {
                    return;
                }
            }

            ImportFont(font);
            CurrentFontIndex = _fonts.IndexOf(font);
        }
예제 #2
0
        /// <summary>
        /// Imports the specified <see cref="FontFace"/> into this <see cref="TextFactory"/> if it hasn't already been imported.
        /// </summary>
        public void ImportFont(FontFace font)
        {
            if (font is null)
            {
                return;
            }

            if (_fonts.Count > 0)
            {
                if (CurrentFont.Equals(font))
                {
                    return;
                }
            }

            if (!_fonts.Contains(font))
            {
                _fonts.Add(font);
            }
        }