예제 #1
0
        public void ContainsTextIsCorrect()
        {
            const string text = "A";

            var font = new SKFont();

            font.Typeface = SKTypeface.Default;

            Assert.True(font.ContainsGlyphs(text));
        }
예제 #2
0
        public void ContainsUnicodeTextIsCorrect()
        {
            const string text      = "🚀";
            var          emojiChar = StringUtilities.GetUnicodeCharacterCode(text, SKTextEncoding.Utf32);

            var font = new SKFont();

            // use the default typeface (which shouldn't have the emojis)
            font.Typeface = SKTypeface.Default;

            Assert.False(font.ContainsGlyphs(text));

            // find a font with the character
            var typeface = SKFontManager.Default.MatchCharacter(emojiChar);

            Assert.NotNull(typeface);
            font.Typeface = typeface;

            Assert.True(font.ContainsGlyphs(text));
        }