Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cewe2pdf.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@
<Content Include="tests\testTextArt\previous_result_pdfs\test_textart.mcf.20250511S.pdf" />
<Content Include="tests\testTextArt\test_textart.mcf" />
<Content Include="tests\testTextArt\test_textart_mcf-Dateien\folderid.xml~" />
<Content Include="tests\testTextBox\additional_fonts.txt" />
<Content Include="tests\testTextBox\cewe2pdf.ini" />
<Content Include="tests\testTextLinks\cewe2pdf.ini" />
<Content Include="tests\testTextLinks\testTextLinks.mcf" />
Expand Down
13 changes: 13 additions & 0 deletions tests/testTextBox/additional_fonts.txt
Original file line number Diff line number Diff line change
@@ -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
12 changes: 8 additions & 4 deletions tests/testTextBox/cewe2pdf.ini
Original file line number Diff line number Diff line change
@@ -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
Binary file not shown.
6 changes: 3 additions & 3 deletions tests/testTextBox/testTextBox.mcf
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,16 @@
<decoration>
<shadow shadowAngle="135" shadowBlurNew="4" shadowDistance="14.000000000000004" shadowEnabled="1" shadowIntensity="51" shadowWidthInMM="1.5"/>
</decoration>
<text applySpotColor="0" areaTextType="content"><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css">p, li { white-space: pre-wrap; }hr { height: 1px; border-width: 0; }li.unchecked::marker { content: "\2610"; }li.checked::marker { content: "\2612"; }</style></head><body style=" font-family:'Brush Script MT'; font-size:36pt; font-weight:400; font-style:normal; letter-spacing:17.625px;"><p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:100%;"><span style=" color:#000000; -qt-stroke-color:transparent; -qt-stroke-width:0px; -qt-stroke-linecap:squarecap; -qt-stroke-linejoin:beveljoin;">Text with shadow</span></p></body></html>]]><outline width="0"/>
<textFormat Alignment="ALIGNHCENTER,ALIGNVCENTER" IndentMargin="5" VerticalIndentMargin="50" backgroundColor="#00000000" font="Brush Script MT,36,-1,5,400,0,0,0,0,0,0,1,17.625,0,0,1" foregroundColor="#ff000000" hasOutline="0" hyphenation="0" letterSpacing="35.25" lineHeight="100"/>
<text applySpotColor="0" areaTextType="content"><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css">p, li { white-space: pre-wrap; }hr { height: 1px; border-width: 0; }li.unchecked::marker { content: "\2610"; }li.checked::marker { content: "\2612"; }</style></head><body style=" font-family:'Poppins'; font-size:36pt; font-weight:400; font-style:normal; letter-spacing:17.625px;"><p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:100%;"><span style=" color:#000000; -qt-stroke-color:transparent; -qt-stroke-width:0px; -qt-stroke-linecap:squarecap; -qt-stroke-linejoin:beveljoin;">Text with shadow</span></p></body></html>]]><outline width="0"/>
<textFormat Alignment="ALIGNHCENTER,ALIGNVCENTER" IndentMargin="5" VerticalIndentMargin="50" backgroundColor="#00000000" font="Poppins,36,-1,5,400,0,0,0,0,0,0,1,17.625,0,0,1" foregroundColor="#ff000000" hasOutline="0" hyphenation="0" letterSpacing="35.25" lineHeight="100"/>
</text>
</area>
<area areatype="textarea">
<position height="299.749" left="2384.02" rotation="0" top="1583.21" width="1381.95" zposition="7014"/>
<decoration>
<border applySpotColor="0" color="#ff54ddff" enabled="1" gap="10" position="centered" width="4"/>
</decoration>
<text applySpotColor="0" areaTextType="content"><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css">p, li { white-space: pre-wrap; }hr { height: 1px; border-width: 0; }li.unchecked::marker { content: "\2610"; }li.checked::marker { content: "\2612"; }</style></head><body style=" font-family:'Liberation Sans'; font-size:14pt; font-weight:400; font-style:normal; letter-spacing:0px;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:100%;"><span style=" color:#000000; -qt-stroke-color:transparent; -qt-stroke-width:0px; -qt-stroke-linecap:squarecap; -qt-stroke-linejoin:beveljoin;">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</span></p></body></html>]]><outline width="0"/>
<text applySpotColor="0" areaTextType="content"><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css">p, li { white-space: pre-wrap; }hr { height: 1px; border-width: 0; }li.unchecked::marker { content: "\2610"; }li.checked::marker { content: "\2612"; }</style></head><body style=" font-family:'Liberation Sans'; font-size:14pt; font-weight:400; font-style:normal; letter-spacing:0px;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:100%;"><span style=" color:#000000; -qt-stroke-color:transparent; -qt-stroke-width:0px; -qt-stroke-linecap:squarecap; -qt-stroke-linejoin:beveljoin;">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.</span></p></body></html>]]><outline width="0"/>
<textFormat Alignment="ALIGNLEADING,ALIGNTOP" IndentMargin="5" VerticalIndentMargin="50" backgroundColor="#00000000" font="Liberation Sans,14,-1,5,400,0,0,0,0,0,0,1,0,0,0,1" foregroundColor="#ff000000" hasOutline="0" hyphenation="0" letterSpacing="0" lineHeight="100"/>
</text>
</area>
Expand Down
8 changes: 3 additions & 5 deletions tests/testTextBox/test_textBox.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Loading