4.8.  Comparing Fonts

Quantity

It is simple to compare the number of fonts in two documents:

<testcase name="haveSameNumberOfFonts">
  <assertThat testDocument="test/test.pdf"
              masterDocument="master/master.pdf"
  >
    <haveSameNumberOfFonts />
  </assertThat>
</testcase>

Font Properties

Fonts of two PDF documents are equal if all font information contains identical values.

<testcase name="haveSameFonts">
  <assertThat testDocument="test/test.pdf"
              masterDocument="master/master.pdf"
  >
    <haveSameFonts />
  </assertThat>
</testcase>

Information about all fonts of a PDF document can be extracted using the utility ExtractFontsInfo. See chapter 9.6: “Extract Font Information to XML”.