コード例 #1
0
        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." );
        }
コード例 #2
0
        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 ) );
        }