diff --git a/cewe2pdf.pyproj b/cewe2pdf.pyproj index 9e1d23d4..70d451e2 100644 --- a/cewe2pdf.pyproj +++ b/cewe2pdf.pyproj @@ -275,6 +275,7 @@ + diff --git a/tests/testTextBox/additional_fonts.txt b/tests/testTextBox/additional_fonts.txt new file mode 100644 index 00000000..d7e620fc --- /dev/null +++ b/tests/testTextBox/additional_fonts.txt @@ -0,0 +1,13 @@ +# Run from the repository root, as described in tests/README.md. +# Poppins Italic is deliberately the only Poppins face. The converter must +# register it as the Normal face of the Poppins family before page 4 uses that +# family with a normal CEWE text format. +tests/Resources/photofun/fonts/Poppins-Italic.ttf + +# The other text in this fixture uses these portable faces. +tests/Resources/photofun/fonts/EBGaramond-Regular.ttf +tests/Resources/photofun/fonts/EBGaramond-Bold.ttf +tests/Resources/photofun/fonts/EBGaramond-Italic.ttf +tests/Resources/photofun/fonts/EBGaramond-BoldItalic.ttf +tests/Resources/photofun/fonts/LiberationSans-BaDn.ttf +tests/Resources/photofun/fonts/Stafford Regular.ttf diff --git a/tests/testTextBox/cewe2pdf.ini b/tests/testTextBox/cewe2pdf.ini index a67a233a..2d385d51 100644 --- a/tests/testTextBox/cewe2pdf.ini +++ b/tests/testTextBox/cewe2pdf.ini @@ -1,7 +1,11 @@ [DEFAULT] -#cewe_folder = C:\Program Files\Elkjop fotoservice\elkjop fotoservice -#noShadows = False -#loadSystemFonts = True +noShadows = False -cewe_folder = tests +# Do not set cewe_folder = tests here. That folder supplies the complete +# Poppins family, including its regular face, and would conceal the page 4 +# regression. This fixture needs only the explicitly listed portable fonts, +# its one background folder, and the shared HPS resources below. +# The fixture lists its portable fonts in additional_fonts.txt. In particular, +# Poppins Italic is deliberately the only supplied Poppins face. +extraBackgroundFolders = tests/Resources/photofun/backgrounds hpsFolder = tests/hps diff --git a/tests/testTextBox/previous_result_pdfs/testTextBox.mcf.20261021S.pdf b/tests/testTextBox/previous_result_pdfs/testTextBox.mcf.20261021S.pdf new file mode 100644 index 00000000..eed46d25 Binary files /dev/null and b/tests/testTextBox/previous_result_pdfs/testTextBox.mcf.20261021S.pdf differ diff --git a/tests/testTextBox/testTextBox.mcf b/tests/testTextBox/testTextBox.mcf index fc06e193..31592c4e 100644 --- a/tests/testTextBox/testTextBox.mcf +++ b/tests/testTextBox/testTextBox.mcf @@ -176,8 +176,8 @@ -

Text with shadow

]]> - +

Text with shadow

]]> +
@@ -185,7 +185,7 @@ -

The boxes above check that letter spacing is taken into account in calculating line breaks. The second one happens to check font substitution for Brush Italic MT which only has an italic entry in the family, but you can only see that when executing locally with a full font set, and not on the github tests

]]> +

The boxes above check that letter spacing is taken into account in calculating line breaks. The second uses Poppins although the fixture supplies only Poppins Italic. It verifies that the converter uses that face as the family Normal font, including on GitHub.

]]>
diff --git a/tests/testTextBox/test_textBox.py b/tests/testTextBox/test_textBox.py index 53cbc92f..e61f9c37 100644 --- a/tests/testTextBox/test_textBox.py +++ b/tests/testTextBox/test_textBox.py @@ -68,9 +68,7 @@ def test_testfontsubstitution(main=False): if __name__ == '__main__': - # When running this test directly we will normally not have IGNORELOCALFONTS set, so the system - # fonts will be registered and could be accessed. When the tests are run by a full pytest - # discovery, IGNORELOCALFONTS is set to 1, so that the system fonts are not registered (not - # on the developer machine nor on the github servers) so the direct run result and the full - # pytest run result will not be the same. + # Match conftest.py and GitHub Actions. In particular, installed Poppins + # Regular would conceal this fixture's supplied-italic-only regression. + os.environ['IGNORELOCALFONTS'] = '1' test_testfontsubstitution(main=True)