public void ShouldGetName() { var font = TrueTypeFont.FromFile(@"C:\Windows\Fonts\arial.ttf"); var name = NameHelper.GetName(NameId.FontSubfamilyName, new CultureInfo("nl-NL"), font); Assert.Equal("Standaard", name); }
public void ShouldGetGlyph() { var font = TrueTypeFont.FromFile(@"C:\Windows\Fonts\arial.ttf"); var glyphIndex = GlyphHelper.GetGlyphIndex('A', font); Assert.NotEqual((uint)0, glyphIndex); }
public void ShouldGetKerning() { var font = TrueTypeFont.FromFile(@"C:\Windows\Fonts\arial.ttf"); var horizontalKerning = KerningHelper.GetHorizontalKerning('A', 'W', font); Assert.True(horizontalKerning < 0); horizontalKerning = KerningHelper.GetHorizontalKerning('T', 'T', font); Assert.Equal(0, horizontalKerning); }
public void ShouldParseWindowsFonts() { var fonts = new List <TrueTypeFont>(); foreach (var file in Directory.EnumerateFiles(@"C:\Windows\Fonts")) { if (file.EndsWith(".ttf")) { var font = TrueTypeFont.FromFile(file); fonts.Add(font); if (font.KernTable.SubtableCount > 0) { } } } Assert.NotEmpty(fonts); }