Exemplo n.º 1
0
        public void AddViaStreamReturnsDescription()
        {
            var sut = new FontCollection();

            using Stream s = TestFonts.CarterOneFileData();
            FontFamily family = sut.Add(s, out FontDescription description);

            Assert.NotNull(description);
            Assert.Equal("Carter One", description.FontFamilyInvariantCulture);
            Assert.Equal("Regular", description.FontSubFamilyNameInvariantCulture);
            Assert.Equal(FontStyle.Regular, description.Style);
        }
Exemplo n.º 2
0
        public void InstallViaStreamReturnsDecription()
        {
            FontCollection sut = new FontCollection();

            using (System.IO.Stream s = TestFonts.CarterOneFileData())
            {
                FontFamily family = sut.Install(s, out FontDescription description);
                Assert.NotNull(description);
                Assert.Equal("Carter One", description.FontFamily);
                Assert.Equal("Regular", description.FontSubFamilyName);
                Assert.Equal(FontStyle.Regular, description.Style);
            }
        }
        public void FontClassNoPath_SetProperties()
        {
            var collection = new FontCollection();

            using Stream stream = TestFonts.CarterOneFileData();
            FontFamily family = collection.Add(stream);
            var        font   = new Font(family, 12);

            Assert.Equal("Carter One", font.Name);
            Assert.Equal(12, font.Size);
            Assert.Equal(FontStyle.Regular, font.RequestedStyle);
            Assert.False(font.IsBold);
            Assert.False(font.IsItalic);
            Assert.False(font.TryGetPath(out string path));
            Assert.Null(path);
        }
Exemplo n.º 4
0
        public void Issue21_LoopDetectedLoadingGlyphs()
        {
            Font font = new FontCollection().Install(TestFonts.CarterOneFileData()).CreateFont(12);

            GlyphInstance g = font.Instance.GetGlyph('\0');
        }
        public void Issue21_LoopDetectedLoadingGlyphs()
        {
            Font font = new FontCollection().Add(TestFonts.CarterOneFileData()).CreateFont(12);

            font.FontMetrics.GetGlyphMetrics(new CodePoint('\0'), ColorFontSupport.None).First();
        }