/// <summary>
		/// Returns a font that best matches the described font set.
		/// </summary>
		/// <param name="p_fsiFontInfo">The information describing the desired font.</param>
		/// <returns>A font that best matches the described font set.</returns>
		public Font RequestFont(FontSetInformation p_fsiFontInfo)
		{
			Font fntFont = null;
			for (Int32 i = m_lstFontSetGroups.Count - 1; i >= 0; i--)
			{
				FontSetGroup fsgGroup = m_lstFontSetGroups[i];
				if (fsgGroup.HasFontSet(p_fsiFontInfo.Set))
					fntFont = fsgGroup.GetFontSet(p_fsiFontInfo.Set).CreateFont(p_fsiFontInfo.Style, p_fsiFontInfo.Size);
				if ((fntFont == null) && (fsgGroup.DefaultFontSet != null))
					fntFont = fsgGroup.DefaultFontSet.CreateFont(p_fsiFontInfo.Style, p_fsiFontInfo.Size);
				if (fntFont != null)
					return fntFont;
			}
			return null;
		}
		/// <summary>Indicates whether this instance and a specified font provider information are equal.</summary>
		/// <param name="information">The information to check the equality of.</param>
		/// <returns>True if logically equal, otherwise false.</returns>
		public bool Equals(FontSetInformation information)
		{
			return ((Set == information.Set) || (String.IsNullOrEmpty(Set) && String.IsNullOrEmpty(information.Set))) && Size == information.Size && Style == information.Style;
		}
		/// <summary>
		/// The copy constructor.
		/// </summary>
		/// <param name="p_fsiCopy">The object to be copied.</param>
		public FontSetInformation(FontSetInformation p_fsiCopy)
		{
			Set = p_fsiCopy.Set;
			Size = p_fsiCopy.Size;
			Style = p_fsiCopy.Style;
		}
		/// <summary>Creates the static instance of the <see cref="FontSetInformation"/> class.</summary>
		static FontSetInformation()
		{
			FontSetInformation.Empty = new FontSetInformation();
		}
Пример #5
0
 /// <summary>Indicates whether this instance and a specified font provider information are equal.</summary>
 /// <param name="information">The information to check the equality of.</param>
 /// <returns>True if logically equal, otherwise false.</returns>
 public bool Equals(FontSetInformation information)
 {
     return(((Set == information.Set) || (String.IsNullOrEmpty(Set) && String.IsNullOrEmpty(information.Set))) && Size == information.Size && Style == information.Style);
 }
Пример #6
0
 /// <summary>
 /// The copy constructor.
 /// </summary>
 /// <param name="p_fsiCopy">The object to be copied.</param>
 public FontSetInformation(FontSetInformation p_fsiCopy)
 {
     Set   = p_fsiCopy.Set;
     Size  = p_fsiCopy.Size;
     Style = p_fsiCopy.Style;
 }
Пример #7
0
 /// <summary>Creates the static instance of the <see cref="FontSetInformation"/> class.</summary>
 static FontSetInformation()
 {
     FontSetInformation.Empty = new FontSetInformation();
 }