-
Notifications
You must be signed in to change notification settings - Fork 560
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
flying-saucer-examples/src/main/resources/demos/fontface/fontface.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,52 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>font-face</title> | ||
<style type="text/css"> | ||
@font-face { | ||
font-family: "NewZurica"; | ||
src: url("http://db.onlinewebfonts.com/t/ea265fee5f2171df02d2da4266768617.eot"); | ||
src: url("http://db.onlinewebfonts.com/t/ea265fee5f2171df02d2da4266768617.eot?#iefix") format("embedded-opentype"), | ||
url("http://db.onlinewebfonts.com/t/ea265fee5f2171df02d2da4266768617.woff2") format("woff2"), | ||
url("http://db.onlinewebfonts.com/t/ea265fee5f2171df02d2da4266768617.woff") format("woff"), | ||
url("http://db.onlinewebfonts.com/t/ea265fee5f2171df02d2da4266768617.ttf") format("truetype"), | ||
url("http://db.onlinewebfonts.com/t/ea265fee5f2171df02d2da4266768617.svg#NewZurica") format("svg"); | ||
} | ||
|
||
html { | ||
padding: 0px; | ||
margin: 0px; | ||
} | ||
|
||
body { | ||
background-color: #e1ddd9; | ||
font-size: 12px; | ||
font-family: Verdana, Arial, SunSans-Regular, Sans-Serif; | ||
color: #564b47; | ||
padding: 0px; | ||
margin: 0px; | ||
} | ||
|
||
.link { | ||
position: relative; | ||
margin: 0px; | ||
font-family: NewZurica; | ||
font-size: 60pt; | ||
} | ||
.link1 { | ||
position: relative; | ||
margin: 0px; | ||
font-size: 60pt; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="link"> | ||
hello word! | ||
</div> | ||
<div class="link1"> | ||
hello word! | ||
</div> | ||
</body> | ||
</html> |
19 changes: 19 additions & 0 deletions
19
...saucer-swt-examples/src/main/java/org/xhtmlrenderer/demo/core/Graphics2DRendererTest.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,19 @@ | ||
package org.xhtmlrenderer.demo.core; | ||
|
||
import org.xhtmlrenderer.simple.Graphics2DRenderer; | ||
|
||
import javax.imageio.ImageIO; | ||
import java.awt.image.BufferedImage; | ||
import java.io.File; | ||
|
||
/** | ||
* Created by infi.he on 2016/4/12. | ||
*/ | ||
public class Graphics2DRendererTest { | ||
|
||
public static void main(String[] args) throws Exception { | ||
BufferedImage img = Graphics2DRenderer.renderToImageAutoSize(new File("demos/fontface/fontface.html").toURL().toExternalForm(), | ||
700, BufferedImage.TYPE_INT_ARGB); | ||
ImageIO.write(img, "png", new File("test.png")); | ||
} | ||
} |