-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
with format tags. We select the truetype font. This allows some Google font stylesheets to be used (where a truetype font is provided), however, consider the network load issue if running a template multiple times. With tests for: + Simple uri which was previously all we supported. + Multiple uris/local with format tags. + Import of google CSS font sheet (manual test to avoid network load on each test run).
- Loading branch information
Showing
8 changed files
with
104 additions
and
6 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
Binary file added
BIN
+3.76 KB
...htmltopdf-examples/src/main/resources/visualtest/expected/css-font-face-rule-advanced.pdf
Binary file not shown.
Binary file added
BIN
+42.7 KB
openhtmltopdf-examples/src/main/resources/visualtest/expected/css-font-face-rule-google.pdf
Binary file not shown.
Binary file added
BIN
+3.76 KB
openhtmltopdf-examples/src/main/resources/visualtest/expected/css-font-face-rule-simple.pdf
Binary file not shown.
21 changes: 21 additions & 0 deletions
21
openhtmltopdf-examples/src/main/resources/visualtest/html/css-font-face-rule-advanced.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,21 @@ | ||
<html> | ||
<head> | ||
<style> | ||
@page { | ||
size: 200px 200px; | ||
} | ||
@font-face { | ||
font-family: 'Karla'; | ||
src: url(http://example.com/should-not-load.woff) format(woff), | ||
url(fonts/Karla-Bold.ttf) format(truetype), | ||
url(http://example.com/should-not-load.eot) format(eot); | ||
} | ||
body { | ||
font-family: 'Karla'; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
This is a test. Text should be bold. | ||
</body> | ||
</html> |
18 changes: 18 additions & 0 deletions
18
openhtmltopdf-examples/src/main/resources/visualtest/html/css-font-face-rule-google.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,18 @@ | ||
<html> | ||
<head> | ||
<style> | ||
@import url('https://fonts.googleapis.com/css?family=PT+Sans&display=swap&subset=cyrillic,cyrillic-ext,latin-ext'); | ||
@page { | ||
size: 20cm 6cm; | ||
} | ||
body { | ||
font-family: 'PT Sans', sans-serif; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
ABCČĆDĐEFGHIJKLMNOPQRSŠTUVWXYZŽabcčćdđefghijklmnopqrsštuvwxyzž | ||
АБВГҐДЂЕЁЄЖЗЅИІЇЙЈКЛЉМНЊОПРСТЋ | ||
УЎФХЦЧЏШЩЪЫЬЭЮЯабвгґдђеёєжзѕиіїйјклљмнњопрстћуўфхцчџшщъыьэюя | ||
</body> | ||
</html> |
19 changes: 19 additions & 0 deletions
19
openhtmltopdf-examples/src/main/resources/visualtest/html/css-font-face-rule-simple.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> | ||
@page { | ||
size: 200px 200px; | ||
} | ||
@font-face { | ||
font-family: 'Karla'; | ||
src: url(fonts/Karla-Bold.ttf); | ||
} | ||
body { | ||
font-family: 'Karla'; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
This is a test. Text should be bold. | ||
</body> | ||
</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