Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ListItemPainter: set font specification when calling drawText #366 #410

Merged
merged 1 commit into from
Nov 17, 2019
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
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ private static void drawText(RenderingContext c, BlockBox box, IdentValue listSt

c.getOutputDevice().setColor(box.getStyle().getColor());
c.getOutputDevice().setFont(box.getStyle().getFSFont(c));
if (c.getOutputDevice() instanceof AbstractOutputDevice) {
((AbstractOutputDevice) c.getOutputDevice()).setFontSpecification(box.getStyle().getFontSpecification());
}
c.getTextRenderer().drawString(
c.getOutputDevice(), text.getText(), x, y);
}
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<html>
<head>
<style>
p {
page-break-after: always;
}
</style>
</head>
<body>
<p>
<b>bolded text</b>
</p>
<ol>
<li>counter should not be bold</li>
</ol>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,15 @@ public void testFloatClearBoth() throws IOException {
public void testBorderRadius() throws IOException {
assertTrue(vt.runTest("border-radius"));
}

/**
* Check counter style after page break, it should not be affected by a previous bolded text, see issue
* https://github.com/danfickle/openhtmltopdf/issues/366
*/
@Test
public void testListCounterAfterPageBreak() throws IOException {
assertTrue(vt.runTest("list-counter-after-page-break"));
}

// TODO:
// + Elements that appear just on generated overflow pages.
Expand Down