-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #304 from zimmi/stop-logging-font-missing-unused-s…
…pace Fix warnings for icon font without space inside PDF/A, add tests
- Loading branch information
Showing
5 changed files
with
65 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+125 KB
openhtmltopdf-examples/src/main/resources/testcases/fonts/MaterialIcons-Regular.ttf
Binary file not shown.
19 changes: 19 additions & 0 deletions
19
openhtmltopdf-examples/src/main/resources/testcases/icon-font.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<html> | ||
<head> | ||
<style> | ||
@font-face { | ||
src: url(fonts/MaterialIcons-Regular.ttf); | ||
font-family: 'MaterialIcons'; | ||
} | ||
body { | ||
font-family: serif; | ||
} | ||
.material-icon { | ||
font-family: 'MaterialIcons'; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div style="display: table-cell;"><span class="material-icon"></span></div> | ||
</body> | ||
</html> |
25 changes: 25 additions & 0 deletions
25
openhtmltopdf-examples/src/test/java/com/openhtmltopdf/testcases/IconFontTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.openhtmltopdf.testcases; | ||
|
||
import com.openhtmltopdf.pdfboxout.PdfRendererBuilder.PdfAConformance; | ||
import org.junit.Test; | ||
|
||
public class IconFontTest { | ||
|
||
/** | ||
* Icon fonts sometimes contain no space character. They should still be | ||
* usable without warnings. | ||
*/ | ||
@Test | ||
public void testFontWithoutSpace() throws Exception { | ||
TestcaseRunner.runTestWithoutOutput("icon-font"); | ||
} | ||
|
||
/** | ||
* Should also work for PDF/A. | ||
*/ | ||
@Test | ||
public void testFontWithoutSpacePdfA() throws Exception { | ||
TestcaseRunner.runTestWithoutOutput("icon-font", PdfAConformance.PDFA_2_U); | ||
} | ||
|
||
} |