Esempio n. 1
0
        public void ShapedStringBuilder_IsAppendedFromShaper_WhenSpecifyingSubstring()
        {
            var sstrb = new ShapedStringBuilder();

            GivenAnUltravioletApplicationWithNoWindow()
            .WithPlugin(new FreeTypeFontPlugin())
            .WithContent(content =>
            {
                var font = content.Load <UltravioletFont>("Fonts/FiraSans");
                using (var textShaper = new HarfBuzzTextShaper(content.Ultraviolet))
                {
                    textShaper.SetUnicodeProperties(TextDirection.LeftToRight, TextScript.Latin, "en");
                    textShaper.Append("Hello, world!");

                    textShaper.AppendTo(sstrb, font.Regular, 7, 5);
                }
            })
            .RunForOneFrame();

            TheResultingValue(sstrb.Length).ShouldBe(5);
        }