Exemplo n.º 1
0
        public void MeasureTextMeasuresTheTextForGlyphs()
        {
            var font          = new SKFont();
            var expectedWidth = font.MeasureText("Hello World!");

            var glyphs = font.GetGlyphs("Hello World!");
            var width  = font.MeasureText(glyphs);

            Assert.Equal(expectedWidth, width);
        }
Exemplo n.º 2
0
        public void MeasureTextReturnsTheBoundsForGlyphs()
        {
            var font          = new SKFont();
            var expectedWidth = font.MeasureText("Hello World!", out var expectedBounds);

            var glyphs = font.GetGlyphs("Hello World!");
            var width  = font.MeasureText(glyphs, out var bounds);

            Assert.Equal(expectedWidth, width);
            Assert.Equal(expectedBounds, bounds);
        }
Exemplo n.º 3
0
        public void MeasureTextMeasuresTheText()
        {
            var font = new SKFont();

            var width = font.MeasureText("Hello World!");

            Assert.True(width > 0);
        }
Exemplo n.º 4
0
        public void MeasureTextReturnsTheBounds()
        {
            var font = new SKFont();

            var width = font.MeasureText("Hello World!", out var bounds);

            Assert.True(width > 0);
            Assert.NotEqual(SKRect.Empty, bounds);
        }
Exemplo n.º 5
0
        public void MeasureTextSucceedsForEmtptyString()
        {
            var font = new SKFont();

            Assert.Equal(0, font.MeasureText(""));
        }