GetAvailableFontFaces() public method

Gets the available variants of the font with varying weight, style and stretch.
Not all weights, styles or strech variants and combinations are available for every font or family. In case of an invalid combination, most toolkits fallback to a system default variant. GetAvailableFontFaces helps to retrieve only valid combinations for a specific font family.
public GetAvailableFontFaces ( ) : ReadOnlyCollection
return ReadOnlyCollection
Beispiel #1
0
		void UpdateFaceList (Font font)
		{
			storeFace.Clear ();
			int row = -1;
			foreach (var face in font.GetAvailableFontFaces ()) {
				row = storeFace.AddRow ();
				storeFace.SetValues (row, dfaceName, face.Name, dfaceFont, face.Font, dfaceMarkup, "<span font=\"" + face.Font.WithSize (listFace.Font.Size) + "\">" + face.Name + "</span>");
			}
			if (row >= 0) {
				listFace.SelectRow (0);
			}
			listFace.QueueForReallocate ();
		}