Created
July 23, 2015 08:35
-
-
Save gokhanaliccii/884ef64a514944c377a5 to your computer and use it in GitHub Desktop.
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
package enums; | |
public enum Font { | |
ALLER_BOLD(0), | |
ALLER_BOLD_ITALIC (1), | |
ALLER_ITALIC (2), | |
ALLER_LIGHT (3), | |
ALLER_NORMAL ( 4), | |
SEGOE_BOLD (5), | |
SEGOE_LIGHT ( 6), | |
SEGOE_NORMAL (7), | |
SEGOE_SEMI_BOLD (8), | |
MYRIAD_PRO_BOLD (9), | |
MYRIAD_PRO_REGULAR(10), | |
DEFAULT(-1); | |
private int font; | |
/** | |
* Constructor Font() | |
*/ | |
private Font(int font) { | |
this.font = font; | |
} | |
/** | |
* Getter getFont() | |
*/ | |
public int getFont() { | |
return font; | |
} | |
/** | |
* Getter getFont() | |
*/ | |
public static Font getFont(int font){ | |
switch (font) { | |
case 0: return ALLER_BOLD; | |
case 1: return ALLER_BOLD_ITALIC; | |
case 2: return ALLER_ITALIC; | |
case 3: return ALLER_LIGHT; | |
case 4: return ALLER_NORMAL; | |
case 5: return SEGOE_BOLD; | |
case 6: return SEGOE_LIGHT; | |
case 7: return SEGOE_NORMAL; | |
case 8: return SEGOE_SEMI_BOLD; | |
case 9: return MYRIAD_PRO_BOLD; | |
case 10: return MYRIAD_PRO_REGULAR; | |
default: return DEFAULT; | |
} | |
} | |
/** | |
* Getter getPath() | |
*/ | |
public String getPath(){ | |
switch (this) { | |
case ALLER_BOLD: return "fonts/Aller_Bd.ttf"; | |
case ALLER_BOLD_ITALIC: return "fonts/Aller_BdIt.ttf"; | |
case ALLER_ITALIC: return "fonts/Aller_It.ttf"; | |
case ALLER_LIGHT: return "fonts/Aller_Lt.ttf"; | |
case ALLER_NORMAL: return "fonts/Aller_Rg.ttf"; | |
case MYRIAD_PRO_BOLD: return "fonts/myriad_pro_bold.otf"; | |
case MYRIAD_PRO_REGULAR: return "fonts/myriad_pro_regular.otf"; | |
case SEGOE_BOLD: return "fonts/segoeuib.ttf"; | |
case SEGOE_LIGHT: return "fonts/segoeuil.ttf"; | |
case SEGOE_NORMAL: return "fonts/segoeui.ttf"; | |
case SEGOE_SEMI_BOLD: return "fonts/seguisb.ttf"; | |
default: return "fonts/seguisb.ttf"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment