Esempio n. 1
0
        public void ShouldStopIfNotFitting()
        {
            var         font           = new Font(FontFamily, 16, FontStyle.Regular);
            var         chars          = GetChars("abcde");
            ISet <char> charsToProcess = new HashSet <char>(chars);

            var page = new SpriteFontPage(font, ref charsToProcess, 35, 1);

            page.Start.Should().Be('a');
            page.End.Should().Be('c');
            charsToProcess.Should().BeEquivalentTo('d', 'e');
        }
Esempio n. 2
0
        public void ShouldHaveSpecifiedSymbols()
        {
            var         font           = new Font(FontFamily, 16, FontStyle.Regular);
            var         chars          = GetChars("abcd");
            ISet <char> charsToProcess = new HashSet <char>(chars);

            var page = new SpriteFontPage(font, ref charsToProcess, 64, 1);

            page.Start.Should().Be('a');
            page.End.Should().Be('d');
            foreach (var character in chars)
            {
                page.HasGlyph(character).Should().BeTrue();
                var rectangle = page.GetGlyph(character);
                rectangle.IsEmpty.Should().BeFalse();
            }
            page.GetGlyph('Z').IsEmpty.Should().BeTrue();
        }