File: MacFontUtils.java

package info (click to toggle)
mac-widgets 0.10.0%2Bsvn416-dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,968 kB
  • ctags: 2,003
  • sloc: java: 9,909; makefile: 13; sh: 12
file content (42 lines) | stat: -rw-r--r-- 2,048 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.explodingpixels.macwidgets;

import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.RenderingHints;

import javax.swing.UIManager;

public class MacFontUtils {

    public static final float DEFAULT_FONT_SIZE = 11.0f;
    
    public static final float HUD_FONT_SIZE = 11.0f;
 	
	public static final Font DEFAULT_FONT = new Font("Serif", Font.PLAIN, 11); 

    public static final Font ITUNES_FONT =
    		UIManager.getFont("Table.font") != null ? UIManager.getFont("Table.font").deriveFont(DEFAULT_FONT_SIZE) : DEFAULT_FONT.deriveFont(DEFAULT_FONT_SIZE);

    public static final Font ITUNES_TABLE_HEADER_FONT =
    		UIManager.getFont("Table.font") != null ? UIManager.getFont("Table.font").deriveFont(Font.BOLD, DEFAULT_FONT_SIZE) : DEFAULT_FONT.deriveFont(Font.BOLD, DEFAULT_FONT_SIZE);

    public static final Font TOOLBAR_LABEL_FONT =
    		UIManager.getFont("Label.font") != null ? UIManager.getFont("Label.font").deriveFont(DEFAULT_FONT_SIZE) : DEFAULT_FONT.deriveFont(DEFAULT_FONT_SIZE);

    public static final Font DEFAULT_BUTTON_FONT =
    		UIManager.getFont("Button.font") != null ? UIManager.getFont("Button.font").deriveFont(DEFAULT_FONT_SIZE) : DEFAULT_FONT.deriveFont(DEFAULT_FONT_SIZE);
    				
    public static final Font HUD_BUTTON_FONT =
    		UIManager.getFont("Button.font") != null ? UIManager.getFont("Button.font").deriveFont(DEFAULT_FONT_SIZE) : DEFAULT_FONT.deriveFont(DEFAULT_FONT_SIZE);

    public static final Font DEFAULT_LABEL_FONT =
    		UIManager.getFont("Label.font") != null ? UIManager.getFont("Label.font").deriveFont(DEFAULT_FONT_SIZE) : DEFAULT_FONT.deriveFont(DEFAULT_FONT_SIZE);

    public static final Font BOLD_LABEL_FONT =
    	    UIManager.getFont("Label.font") != null ? UIManager.getFont("Label.font").deriveFont(DEFAULT_FONT_SIZE) : DEFAULT_FONT.deriveFont(Font.BOLD, DEFAULT_FONT_SIZE);
    		
    		
    public static void enableAntialiasing(Graphics2D g2) {
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    }
}