Skip to content

Commit 8656090

Browse files
ars18wrwiText-CI
authored andcommitted
SVG: Switch to PX as a default font-size metric. Update cmps.
DEVSIX-2882
1 parent c62a9ec commit 8656090

File tree

77 files changed

+2
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+2
-3
lines changed

svg/src/main/java/com/itextpdf/svg/utils/SvgTextUtil.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,7 @@ public static float resolveFontSize(ISvgTextNodeRenderer renderer, float parentF
190190
// TODO DEVSIX-2866 Support rem value for svgs
191191
fontSize = CssUtils.parseRelativeFontSize(elementFontSize, parentFontSize);
192192
} else {
193-
// TODO DEVSIX-2882 Switch to PX
194-
fontSize = CssUtils.parseAbsoluteFontSize(elementFontSize, CommonCssConstants.PT);
193+
fontSize = CssUtils.parseAbsoluteFontSize(elementFontSize, CommonCssConstants.PX);
195194
}
196195
}
197196
if ((Float.isNaN(fontSize)) || fontSize < 0f) {

svg/src/test/java/com/itextpdf/svg/renderers/impl/TextLeafSvgNodeRendererIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void getContentLengthBaseTest() throws Exception {
6666
toTest.setAttribute(SvgConstants.Attributes.FONT_SIZE, "10");
6767
PdfFont font = PdfFontFactory.createFont();
6868
float actual = toTest.getTextContentLength(12, font);
69-
float expected = 22.78f;
69+
float expected = 17.085f;
7070
Assert.assertEquals(expected, actual, 1e-6f);
7171
}
7272

Binary file not shown.

0 commit comments

Comments
 (0)