Advertisement
Guest User

Untitled

a guest
Oct 10th, 2015
13,962
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. public enum DefaultFontInfo{
  2.  
  3. A('A', 5),
  4. a('a', 5),
  5. B('B', 5),
  6. b('b', 5),
  7. C('C', 5),
  8. c('c', 5),
  9. D('D', 5),
  10. d('d', 5),
  11. E('E', 5),
  12. e('e', 5),
  13. F('F', 5),
  14. f('f', 4),
  15. G('G', 5),
  16. g('g', 5),
  17. H('H', 5),
  18. h('h', 5),
  19. I('I', 3),
  20. i('i', 1),
  21. J('J', 5),
  22. j('j', 5),
  23. K('K', 5),
  24. k('k', 4),
  25. L('L', 5),
  26. l('l', 1),
  27. M('M', 5),
  28. m('m', 5),
  29. N('N', 5),
  30. n('n', 5),
  31. O('O', 5),
  32. o('o', 5),
  33. P('P', 5),
  34. p('p', 5),
  35. Q('Q', 5),
  36. q('q', 5),
  37. R('R', 5),
  38. r('r', 5),
  39. S('S', 5),
  40. s('s', 5),
  41. T('T', 5),
  42. t('t', 4),
  43. U('U', 5),
  44. u('u', 5),
  45. V('V', 5),
  46. v('v', 5),
  47. W('W', 5),
  48. w('w', 5),
  49. X('X', 5),
  50. x('x', 5),
  51. Y('Y', 5),
  52. y('y', 5),
  53. Z('Z', 5),
  54. z('z', 5),
  55. NUM_1('1', 5),
  56. NUM_2('2', 5),
  57. NUM_3('3', 5),
  58. NUM_4('4', 5),
  59. NUM_5('5', 5),
  60. NUM_6('6', 5),
  61. NUM_7('7', 5),
  62. NUM_8('8', 5),
  63. NUM_9('9', 5),
  64. NUM_0('0', 5),
  65. EXCLAMATION_POINT('!', 1),
  66. AT_SYMBOL('@', 6),
  67. NUM_SIGN('#', 5),
  68. DOLLAR_SIGN('$', 5),
  69. PERCENT('%', 5),
  70. UP_ARROW('^', 5),
  71. AMPERSAND('&', 5),
  72. ASTERISK('*', 5),
  73. LEFT_PARENTHESIS('(', 4),
  74. RIGHT_PERENTHESIS(')', 4),
  75. MINUS('-', 5),
  76. UNDERSCORE('_', 5),
  77. PLUS_SIGN('+', 5),
  78. EQUALS_SIGN('=', 5),
  79. LEFT_CURL_BRACE('{', 4),
  80. RIGHT_CURL_BRACE('}', 4),
  81. LEFT_BRACKET('[', 3),
  82. RIGHT_BRACKET(']', 3),
  83. COLON(':', 1),
  84. SEMI_COLON(';', 1),
  85. DOUBLE_QUOTE('"', 3),
  86. SINGLE_QUOTE('\'', 1),
  87. LEFT_ARROW('<', 4),
  88. RIGHT_ARROW('>', 4),
  89. QUESTION_MARK('?', 5),
  90. SLASH('/', 5),
  91. BACK_SLASH('\\', 5),
  92. LINE('|', 1),
  93. TILDE('~', 5),
  94. TICK('`', 2),
  95. PERIOD('.', 1),
  96. COMMA(',', 1),
  97. SPACE(' ', 3),
  98. DEFAULT('a', 4);
  99.  
  100. private char character;
  101. private int length;
  102.  
  103. DefaultFontInfo(char character, int length) {
  104. this.character = character;
  105. this.length = length;
  106. }
  107.  
  108. public char getCharacter(){
  109. return this.character;
  110. }
  111.  
  112. public int getLength(){
  113. return this.length;
  114. }
  115.  
  116. public int getBoldLength(){
  117. if(this == DefaultFontInfo.SPACE) return this.getLength();
  118. return this.length + 1;
  119. }
  120.  
  121. public static DefaultFontInfo getDefaultFontInfo(char c){
  122. for(DefaultFontInfo dFI : DefaultFontInfo.values()){
  123. if(dFI.getCharacter() == c) return dFI;
  124. }
  125. return DefaultFontInfo.DEFAULT;
  126. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement