public void ValidGetFirstFontGillSansUrl()
        {
            var path = new Uri(ValidateGillSans.RootUrl);

            using (var reader = new TypefaceReader(path))
            {
                var url = new Uri(ValidateGillSans.UrlPath, UriKind.Relative);

                var face = reader.GetFirstFont(url);

                ValidateGillSans.AssertMatches(ValidateGillSans.FontTypefaces[0], face);
            }
        }
        public void ValidGetFirstFontGillSansPath()
        {
            var path = new DirectoryInfo(System.Environment.CurrentDirectory);

            using (var reader = new TypefaceReader(path))
            {
                var url = new FileInfo(ValidateGillSans.UrlPath);

                var face = reader.GetFirstFont(url);

                ValidateGillSans.AssertMatches(ValidateGillSans.FontTypefaces[0], face);
            }
        }
        public void ValidGetFontGillSansBold()
        {
            var path = new DirectoryInfo(System.Environment.CurrentDirectory);

            using (var reader = new TypefaceReader(path))
            {
                var file  = new FileInfo(ValidateGillSans.UrlPath);
                var index = ValidateGillSans.BoldRegularIndex;

                var face = reader.GetFont(file, index);
                Assert.IsNotNull(face);

                ValidateGillSans.AssertMatches(ValidateGillSans.FontTypefaces[index], face);
            }
        }
        public async Task ValidGetFontGillSansSemiBoldItalic()
        {
            var path = new DirectoryInfo(System.Environment.CurrentDirectory);

            using (var reader = new TypefaceReader(path))
            {
                var file  = new FileInfo(ValidateGillSans.UrlPath);
                var index = ValidateGillSans.SemiBoldItalicIndex;

                var face = await reader.GetFontAsync(file, index);

                Assert.IsNotNull(face);

                ValidateGillSans.AssertMatches(ValidateGillSans.FontTypefaces[index], face);
            }
        }
        public void ValidGetFontGillSansSemiBoldItalicFileInfoAndReference()
        {
            var path = new DirectoryInfo(System.Environment.CurrentDirectory);

            using (var reader = new TypefaceReader(path))
            {
                var file  = new FileInfo(ValidateGillSans.UrlPath);
                var index = ValidateGillSans.SemiBoldItalicIndex;

                var info = reader.ReadTypeface(file);
                var fref = info.Fonts[index];

                //Load from a known file and a font reference
                var face = reader.GetFont(file, fref);
                Assert.IsNotNull(face);

                ValidateGillSans.AssertMatches(ValidateGillSans.FontTypefaces[index], face);
            }
        }
        public void ValidGetFontGillSansBoldInfoAndRef()
        {
            var path = new DirectoryInfo(System.Environment.CurrentDirectory);

            using (var reader = new TypefaceReader(path))
            {
                var file  = new FileInfo(ValidateGillSans.UrlPath);
                var index = ValidateGillSans.BoldRegularIndex;

                var info = reader.ReadTypeface(file);
                var fref = info.Fonts[index];

                //Get the font with the info and the font reference
                var face = reader.GetFont(info, fref);

                Assert.IsNotNull(face);

                //Make sure the style matches
                var expected = ValidateGillSans.FontTypefaces[index];
                ValidateGillSans.AssertMatches(expected, face);
            }
        }