Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
infi.he authored and asolntsev committed Sep 16, 2023
1 parent 36e6ca3 commit 5249699
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
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>
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"));
}
}

0 comments on commit 5249699

Please sign in to comment.