Example #1
0
        public void ConstructorTest_FontWithSingleDpiWithOrigin_WithFallbackFonts()
        {
            Font font = FakeFont.CreateFont("ABC");

            FontFamily[] fontFamilies = new[]
            {
                FakeFont.CreateFont("DEF").Family,
                FakeFont.CreateFont("GHI").Family
            };

            var         origin  = new Vector2(123, 345);
            const float dpi     = 123;
            TextOptions options = new(font)
            {
                Dpi = dpi,
                FallbackFontFamilies = fontFamilies,
                Origin = origin
            };

            Assert.Equal(dpi, options.Dpi);
            Assert.Equal(fontFamilies, options.FallbackFontFamilies);
            Assert.Equal(font, options.Font);
            Assert.Equal(origin, options.Origin);
            VerifyPropertyDefault(options);
        }
Example #2
0
        public void ContructorTest_FontWithXandYDpisWithOrigin_WithFallbackFonts()
        {
            Font font = FakeFont.CreateFont("ABC");

            FontFamily[] fontFamilys = new[]
            {
                FakeFont.CreateFont("DEF").Family,
                FakeFont.CreateFont("GHI").Family
            };

            var   origin  = new Vector2(123, 345);
            float dpix    = 123;
            float dpiy    = 456;
            var   options = new RendererOptions(font, dpix, dpiy, origin)
            {
                FallbackFontFamilies = fontFamilys
            };

            Assert.Equal(dpix, options.DpiX);
            Assert.Equal(dpiy, options.DpiY);
            Assert.Equal(fontFamilys, options.FallbackFontFamilies);
            Assert.Equal(font, options.Font);
            Assert.Equal(origin, options.Origin);
            VerifyPropertyDefault(options);
        }
Example #3
0
        public void ConstructorTest_FontOnly()
        {
            Font font    = FakeFont.CreateFont("ABC");
            var  options = new TextOptions(font);

            Assert.Equal(72, options.Dpi);
            Assert.Empty(options.FallbackFontFamilies);
            Assert.Equal(font, options.Font);
            Assert.Equal(Vector2.Zero, options.Origin);
            VerifyPropertyDefault(options);
        }
Example #4
0
        public void ConstructorTest_FontWithOrigin()
        {
            Font        font    = FakeFont.CreateFont("ABC");
            var         origin  = new Vector2(123, 345);
            TextOptions options = new(font) { Origin = origin };

            Assert.Equal(72, options.Dpi);
            Assert.Empty(options.FallbackFontFamilies);
            Assert.Equal(font, options.Font);
            Assert.Equal(origin, options.Origin);
            VerifyPropertyDefault(options);
        }
Example #5
0
        public void ContructorTest_FontWithOrigin()
        {
            var font    = FakeFont.CreateFont("ABC");
            var origin  = new Vector2(123, 345);
            var options = new RendererOptions(font, origin);

            Assert.Equal(72, options.DpiX);
            Assert.Equal(72, options.DpiY);
            Assert.Empty(options.FallbackFontFamilies);
            Assert.Equal(font, options.Font);
            Assert.Equal(origin, options.Origin);
            VerifyPropertyDefault(options);
        }
Example #6
0
        public void ContructorTest_FontWithSingleDpi()
        {
            var   font    = FakeFont.CreateFont("ABC");
            float dpi     = 123;
            var   options = new RendererOptions(font, dpi);

            Assert.Equal(dpi, options.DpiX);
            Assert.Equal(dpi, options.DpiY);
            Assert.Empty(options.FallbackFontFamilies);
            Assert.Equal(font, options.Font);
            Assert.Equal(Vector2.Zero, options.Origin);
            VerifyPropertyDefault(options);
        }
Example #7
0
        public void ContructorTest_FontWithXandYDpis()
        {
            Font  font    = FakeFont.CreateFont("ABC");
            float dpix    = 123;
            float dpiy    = 456;
            var   options = new RendererOptions(font, dpix, dpiy);

            Assert.Equal(dpix, options.DpiX);
            Assert.Equal(dpiy, options.DpiY);
            Assert.Empty(options.FallbackFontFamilies);
            Assert.Equal(font, options.Font);
            Assert.Equal(Vector2.Zero, options.Origin);
            VerifyPropertyDefault(options);
        }
Example #8
0
        public void ConstructorTest_FontWithSingleDpi()
        {
            Font        font    = FakeFont.CreateFont("ABC");
            const float dpi     = 123;
            var         options = new TextOptions(font)
            {
                Dpi = dpi
            };

            Assert.Equal(dpi, options.Dpi);
            Assert.Empty(options.FallbackFontFamilies);
            Assert.Equal(font, options.Font);
            Assert.Equal(Vector2.Zero, options.Origin);
            VerifyPropertyDefault(options);
        }
Example #9
0
        public void ContructorTest_FontWithSingleDpi_WithFallbackFonts()
        {
            var font        = FakeFont.CreateFont("ABC");
            var fontFamilys = new[] {
                FakeFont.CreateFont("DEF").Family,
                FakeFont.CreateFont("GHI").Family
            };
            float dpi     = 123;
            var   options = new RendererOptions(font, dpi)
            {
                FallbackFontFamilies = fontFamilys
            };

            Assert.Equal(dpi, options.DpiX);
            Assert.Equal(dpi, options.DpiY);
            Assert.Equal(fontFamilys, options.FallbackFontFamilies);
            Assert.Equal(font, options.Font);
            Assert.Equal(Vector2.Zero, options.Origin);
            VerifyPropertyDefault(options);
        }
Example #10
0
        public void ConstructorTest_FontOnly_WithFallbackFonts()
        {
            Font font = FakeFont.CreateFont("ABC");

            FontFamily[] fontFamilies = new[]
            {
                FakeFont.CreateFont("DEF").Family,
                FakeFont.CreateFont("GHI").Family
            };

            var options = new TextOptions(font)
            {
                FallbackFontFamilies = fontFamilies
            };

            Assert.Equal(72, options.Dpi);
            Assert.Equal(fontFamilies, options.FallbackFontFamilies);
            Assert.Equal(font, options.Font);
            Assert.Equal(Vector2.Zero, options.Origin);
            VerifyPropertyDefault(options);
        }
Example #11
0
 public void GetStylePassesCorrectValues()
 {
     var font        = FakeFont.CreateFontWithInstance("ABC", out var abcFontInstance);
     var fontFamilys = new[] {
Example #12
0
        public void GetMissingGlyphFromMainFont()
        {
            Font font = FakeFont.CreateFontWithInstance("ABC", "ABC", out Fakes.FakeFontInstance abcFontInstance);

            FontFamily[] fontFamilies = new[]
Example #13
0
 public TextOptionsTests()
 {
     this.fakeFont          = FakeFont.CreateFont("ABC");
     this.newTextOptions    = new TextOptions(this.fakeFont);
     this.clonedTextOptions = new TextOptions(this.newTextOptions);
 }
Example #14
0
        public void GetStylePassesCorrectValues()
        {
            Font font = FakeFont.CreateFontWithInstance("ABC", out Fakes.FakeFontInstance abcFontInstance);

            FontFamily[] fontFamilys = new[]