Skip to content

Commit eeac910

Browse files
committed
Fix CanFilterClippedLetters() failing on MacOS because font is not available
1 parent 5439c07 commit eeac910

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/UglyToad.PdfPig.Tests/Integration/LetterFilterTests.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
namespace UglyToad.PdfPig.Tests.Integration
22
{
3+
using PdfPig.Fonts.SystemFonts;
34
using System.Linq;
45

56
public class LetterFilterTests
67
{
7-
[Fact]
8+
[SkippableFact]
89
public void CanFilterClippedLetters()
910
{
1011
var one = IntegrationHelpers.GetDocumentPath("ClipPathLetterFilter-Test1.pdf");
1112

13+
// The 'TimesNewRomanPSMT' font is used by this particular document. Thus, results cannot be trusted on
14+
// platforms where this font isn't generally available (e.g. OSX, Linux, etc.), so we skip it!
15+
var font = SystemFontFinder.Instance.GetTrueTypeFont("TimesNewRomanPSMT");
16+
var font1 = SystemFontFinder.Instance.GetTrueTypeFont("TimesNewRomanPS-BoldMT");
17+
var font2 = SystemFontFinder.Instance.GetTrueTypeFont("TimesNewRomanPS-ItalicMT");
18+
Skip.If(font is null || font1 is null || font2 is null, "Skipped because the font TimesNewRomanPSMT or a font from TimesNewRoman family could not be found in the execution environment.");
19+
1220
using (var doc1 = PdfDocument.Open(one, new ParsingOptions { ClipPaths = true }))
1321
using (var doc2 = PdfDocument.Open(one, new ParsingOptions { ClipPaths = false }))
1422
{

0 commit comments

Comments
 (0)