Skip to content

Commit a9a4d0b

Browse files
committed
basic doc, add uber jar config
1 parent d51bd60 commit a9a4d0b

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
11
# Java Glyph Tester
22

33
A tool for testing the JDK font rendering behaviour
4+
5+
###Build
6+
This project uses maven to build : `mvn clean install` builds the uberjar necessary to run the tool.
7+
8+
###Run
9+
Below command will generate an image for all glyphs contained in Hack-Regular, at size 14, using c:\tmp as output directory
10+
11+
`java -jar java-glyphtester-0.1.jar --fontfile C:\Users\jorgheymans\Downloads\Hack-v2_020-ttf\Hack-Regular.ttf --fontsize 14 --fontstyle
12+
regular --fontname hack --outputdirectory c:\tmp`
13+
14+
If you only want to test one or more specific glyphs you can specify them at the end like this:
15+
16+
`java -jar java-glyphtester-0.1.jar --fontfile C:\Users\jorgheymans\Downloads\Hack-v2_020-ttf\Hack-Regular.ttf --fontsize 14 --fontstyle
17+
regular --fontname hack --outputdirectory c:\tmp A B C D`
18+
19+
Note that per glyph 8 images are generated, one for each aliasing mode available in the standard jdk:
20+
RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT
21+
RenderingHints.VALUE_TEXT_ANTIALIAS_GASP
22+
RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HBGR
23+
RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB
24+
RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_VBGR
25+
RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_VRGB
26+
RenderingHints.VALUE_TEXT_ANTIALIAS_OFF
27+
RenderingHints.VALUE_TEXT_ANTIALIAS_ON
28+
29+
See https://docs.oracle.com/javase/7/docs/api/java/awt/RenderingHints.html for more info

pom.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,28 @@
1414
<target>1.7</target>
1515
</configuration>
1616
</plugin>
17+
<plugin>
18+
<artifactId>maven-shade-plugin</artifactId>
19+
<version>2.4.3</version>
20+
<executions>
21+
<execution>
22+
<phase>package</phase>
23+
<goals>
24+
<goal>shade</goal>
25+
</goals>
26+
<configuration>
27+
<transformers>
28+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
29+
<manifestEntries>
30+
<main-class>org.sourcefoundry.glyphtester.Main</main-class>
31+
<build-number>1</build-number>
32+
</manifestEntries>
33+
</transformer>
34+
</transformers>
35+
</configuration>
36+
</execution>
37+
</executions>
38+
</plugin>
1739
</plugins>
1840
</build>
1941
<dependencies>

src/main/java/org/sourcefoundry/glyphtester/CommandLine.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ public class CommandLine {
3232

3333
@Parameter(names = {"--outputdirectory"}, required = true)
3434
String outputDirectory;
35+
3536
@Parameter(names = {"--renderinghints"})
3637
String renderingHints;
38+
3739
@Parameter
3840
List<String> glyphsToTest;
3941
private JCommander jCommander = null;

0 commit comments

Comments
 (0)