Skip to content

Commit

Permalink
Some more test icons with activated Anti aliasing
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasgeiger committed Oct 1, 2015
1 parent 869e5bb commit 8dccd4e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/main/java/net/sf/jabref/gui/IconTheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class IconTheme {
static {
try {
FONT = Font.createFont(Font.TRUETYPE_FONT, FontBasedIcon.class.getResourceAsStream("/fonts/fontawesome-webfont.ttf"));
FONT_16 = FONT.deriveFont(16f);
FONT_16 = FONT.deriveFont(Font.PLAIN, 16f);
} catch (FontFormatException | IOException e) {
// PROBLEM!
e.printStackTrace();
Expand All @@ -32,8 +32,13 @@ public class IconTheme {
public enum JabRefIcon {

ADD("\uf067", Color.GREEN),
CLIPBOARD("\uf0ea"),
FOLDER("\uf07b"),
REMOVE("\uf068", Color.RED);
REMOVE("\uf068", Color.RED),
FILE("\uf0f6"),
PDF_FILE("\uf1c1"),
SEARCH("\uf002"),
TAGS("\uf02c");

private final String code;
private final Color color;
Expand Down Expand Up @@ -109,6 +114,11 @@ public FontBasedIcon(String code, Color iconColor) {
public void paintIcon(Component c, Graphics g, int x, int y) {
Graphics2D g2 = (Graphics2D) g.create();

RenderingHints rh = new RenderingHints(
RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g2.setRenderingHints(rh);

g2.setFont(FONT_16);
g2.setColor(iconColor);
FontMetrics fm = g2.getFontMetrics();
Expand Down

0 comments on commit 8dccd4e

Please sign in to comment.