Skip to content

Commit 007f1c0

Browse files
committed
Ensured very robust text wrapping with long string
1 parent 2cd8836 commit 007f1c0

8 files changed

Lines changed: 161 additions & 0 deletions
540 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
145 KB
Binary file not shown.
69.9 KB
Binary file not shown.

src/EPPlus.Fonts.OpenType.Tests/Integration/EnsureWrappingWithFreeFonts.cs

Lines changed: 132 additions & 0 deletions
Large diffs are not rendered by default.

src/EPPlus.Fonts.OpenType.Tests/Reading/TtfReadingTests.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,37 @@ public void ReadAllOTFFonts()
165165
Assert.AreEqual(0, fontsThatCannotBeEmbedded.Count());
166166
}
167167

168+
[TestMethod]
169+
public void ReadAllTestTTFFontsAndVerifyUseIsOkay()
170+
{
171+
List<OpenTypeFont> allFontsList = OpenTypeFonts.GetAllBaseFontData(FontFolders, false, Scanner.FontFormat.Ttf);
172+
173+
List<LicenseDataHolder> dataHolder = new List<LicenseDataHolder>();
174+
175+
for (int i = 0; i < allFontsList.Count; i++)
176+
{
177+
LicenseDataHolder dataHolderItem = new LicenseDataHolder()
178+
{
179+
FontName = allFontsList[i].FullName,
180+
LicenseType = allFontsList[i].Os2Table.fsType,
181+
LTypeString = GetFsString(allFontsList[i].Os2Table.fsType)
182+
};
183+
184+
dataHolder.Add(dataHolderItem);
185+
Assert.AreEqual(Scanner.FontFormat.Ttf, allFontsList[i].Format);
186+
}
187+
188+
//Ensure all fonts in the font folder are free to install/use
189+
var fontsThatAreInstallableEmbedded = dataHolder.Where(x => x.LicenseType == 0);
190+
191+
Assert.AreEqual(fontsThatAreInstallableEmbedded.Count(), dataHolder.Count());
192+
}
193+
168194
[TestMethod, Ignore]
169195
public void ReadAllTTFFonts()
170196
{
197+
UseSystemFonts();
198+
171199
List<OpenTypeFont> allFontsList = OpenTypeFonts.GetAllBaseFontData(FontFolders, true, Scanner.FontFormat.Ttf);
172200

173201
List<LicenseDataHolder> dataHolder = new List<LicenseDataHolder>();

src/EPPlus.Fonts.OpenType.Tests/TextFragmentCollectionTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public void MeasureGoudy()
5757
var text = "Goudy size";
5858

5959
var measurer = OpenTypeFonts.GetShaperForFont(font5);
60+
6061
var widthInPoints = measurer.ShapeLight(text).GetWidthInPoints(16f);
6162

6263
var inPixels = Math.Round(widthInPoints.PointToPixel(), 0, MidpointRounding.AwayFromZero);

0 commit comments

Comments
 (0)