public override void Dispose() { base.Dispose(); instance = null; }
/// <summary> /// Internal constructor. This class cannot be instantiated externally. /// </summary> internal FontManager() { if (instance == null) { instance = this; } }
public void TestParseTrueTypeFontDef() { FontManager fontManager = new FontManager(); Assert.AreEqual( 0, fontManager.Resources.Count, "The FontManager is initialized with fonts already loaded." ); Stream stream = GetFontDefinitonStream(); fontManager.ParseScript( stream, "Fonts", String.Empty ); Assert.AreEqual( 1, fontManager.Resources.Count, "The FontManager did not parse a true type font definition file." ); }
public void TestParseCorrectTrueTypeFontDef() { FontManager fontManager = new FontManager(); Stream stream = GetFontDefinitonStream(); fontManager.ParseScript( stream, String.Empty, String.Empty ); Font parsedFont = (Font)fontManager[ FontName ]; Assert.AreEqual( CorrectFontType, parsedFont.Type, String.Format( "The parsed font should be of type {0}.", CorrectFontType ) ); Assert.AreEqual( SourceName, parsedFont.Source, String.Format( "The parsed font should have the source {0}.", SourceName ) ); Assert.AreEqual( TrueTypeSize, parsedFont.TrueTypeSize, String.Format( "The parsed font should have the TrueTypeSize {0}.", TrueTypeSize ) ); Assert.AreEqual( TrueTypeResolution, parsedFont.TrueTypeResolution, String.Format( "The parsed font should have the TrueTypeResolution {0}.", TrueTypeResolution ) ); }