Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

TimesBold.java 10.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. /*
  2. * $Id$
  3. * Copyright 1999-2004 The Apache Software Foundation.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. *
  17. *!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  18. * Automatically generated by font-file.xsl. DO NOT EDIT!
  19. *!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  20. */
  21. package org.apache.fop.fonts.base14;
  22. import org.apache.fop.fonts.FontType;
  23. import org.apache.fop.fonts.Typeface;
  24. import org.apache.fop.fonts.CodePointMapping;
  25. public class TimesBold extends Typeface {
  26. private final static String fontName = "Times-Bold";
  27. private final static String encoding = "WinAnsiEncoding";
  28. private final static int capHeight = 676;
  29. private final static int xHeight = 461;
  30. private final static int ascender = 676;
  31. private final static int descender = -205;
  32. private final static int firstChar = 32;
  33. private final static int lastChar = 255;
  34. private final static int[] width;
  35. private final CodePointMapping mapping =
  36. CodePointMapping.getMapping("WinAnsiEncoding");
  37. static {
  38. width = new int[256];
  39. width[0x41] = 722;
  40. width[0xc6] = 1000;
  41. width[0xc1] = 722;
  42. width[0xc2] = 722;
  43. width[0xc4] = 722;
  44. width[0xc0] = 722;
  45. width[0xc5] = 722;
  46. width[0xc3] = 722;
  47. width[0x42] = 667;
  48. width[0x43] = 722;
  49. width[0xc7] = 722;
  50. width[0x44] = 722;
  51. width[0x45] = 667;
  52. width[0xc9] = 667;
  53. width[0xca] = 667;
  54. width[0xcb] = 667;
  55. width[0xc8] = 667;
  56. width[0xd0] = 722;
  57. width[0x80] = 500;
  58. width[0x46] = 611;
  59. width[0x47] = 778;
  60. width[0x48] = 778;
  61. width[0x49] = 389;
  62. width[0xcd] = 389;
  63. width[0xce] = 389;
  64. width[0xcf] = 389;
  65. width[0xcc] = 389;
  66. width[0x4a] = 500;
  67. width[0x4b] = 778;
  68. width[0x4c] = 667;
  69. width[0x4d] = 944;
  70. width[0x4e] = 722;
  71. width[0xd1] = 722;
  72. width[0x4f] = 778;
  73. width[0x8c] = 1000;
  74. width[0xd3] = 778;
  75. width[0xd4] = 778;
  76. width[0xd6] = 778;
  77. width[0xd2] = 778;
  78. width[0xd8] = 778;
  79. width[0xd5] = 778;
  80. width[0x50] = 611;
  81. width[0x51] = 778;
  82. width[0x52] = 722;
  83. width[0x53] = 556;
  84. width[0x8a] = 556;
  85. width[0x54] = 667;
  86. width[0xde] = 611;
  87. width[0x55] = 722;
  88. width[0xda] = 722;
  89. width[0xdb] = 722;
  90. width[0xdc] = 722;
  91. width[0xd9] = 722;
  92. width[0x56] = 722;
  93. width[0x57] = 1000;
  94. width[0x58] = 722;
  95. width[0x59] = 722;
  96. width[0xdd] = 722;
  97. width[0x9f] = 722;
  98. width[0x5a] = 667;
  99. width[0x8e] = 667;
  100. width[0x61] = 500;
  101. width[0xe1] = 500;
  102. width[0xe2] = 500;
  103. width[0xb4] = 333;
  104. width[0xe4] = 500;
  105. width[0xe6] = 722;
  106. width[0xe0] = 500;
  107. width[0x26] = 833;
  108. width[0xe5] = 500;
  109. width[0x5e] = 581;
  110. width[0x7e] = 520;
  111. width[0x2a] = 500;
  112. width[0x40] = 930;
  113. width[0xe3] = 500;
  114. width[0x62] = 556;
  115. width[0x5c] = 278;
  116. width[0x7c] = 220;
  117. width[0x7b] = 394;
  118. width[0x7d] = 394;
  119. width[0x5b] = 333;
  120. width[0x5d] = 333;
  121. width[0xa6] = 220;
  122. width[0x95] = 350;
  123. width[0x63] = 444;
  124. width[0xe7] = 444;
  125. width[0xb8] = 333;
  126. width[0xa2] = 500;
  127. width[0x88] = 333;
  128. width[0x3a] = 333;
  129. width[0x2c] = 250;
  130. width[0xa9] = 747;
  131. width[0xa4] = 500;
  132. width[0x64] = 556;
  133. width[0x86] = 500;
  134. width[0x87] = 500;
  135. width[0xb0] = 400;
  136. width[0xa8] = 333;
  137. width[0xf7] = 570;
  138. width[0x24] = 500;
  139. width[0x65] = 444;
  140. width[0xe9] = 444;
  141. width[0xea] = 444;
  142. width[0xeb] = 444;
  143. width[0xe8] = 444;
  144. width[0x38] = 500;
  145. width[0x85] = 1000;
  146. width[0x97] = 1000;
  147. width[0x96] = 500;
  148. width[0x3d] = 570;
  149. width[0xf0] = 500;
  150. width[0x21] = 333;
  151. width[0xa1] = 333;
  152. width[0x66] = 333;
  153. width[0x35] = 500;
  154. width[0x83] = 500;
  155. width[0x34] = 500;
  156. width[0x67] = 500;
  157. width[0xdf] = 556;
  158. width[0x60] = 333;
  159. width[0x3e] = 570;
  160. width[0xab] = 500;
  161. width[0xbb] = 500;
  162. width[0x8b] = 333;
  163. width[0x9b] = 333;
  164. width[0x68] = 556;
  165. width[0x2d] = 333;
  166. width[0x69] = 278;
  167. width[0xed] = 278;
  168. width[0xee] = 278;
  169. width[0xef] = 278;
  170. width[0xec] = 278;
  171. width[0x6a] = 333;
  172. width[0x6b] = 556;
  173. width[0x6c] = 278;
  174. width[0x3c] = 570;
  175. width[0xac] = 570;
  176. width[0x6d] = 833;
  177. width[0xaf] = 333;
  178. width[0xb5] = 556;
  179. width[0xd7] = 570;
  180. width[0x6e] = 556;
  181. width[0x39] = 500;
  182. width[0xf1] = 556;
  183. width[0x23] = 500;
  184. width[0x6f] = 500;
  185. width[0xf3] = 500;
  186. width[0xf4] = 500;
  187. width[0xf6] = 500;
  188. width[0x9c] = 722;
  189. width[0xf2] = 500;
  190. width[0x31] = 500;
  191. width[0xbd] = 750;
  192. width[0xbc] = 750;
  193. width[0xb9] = 300;
  194. width[0xaa] = 300;
  195. width[0xba] = 330;
  196. width[0xf8] = 500;
  197. width[0xf5] = 500;
  198. width[0x70] = 556;
  199. width[0xb6] = 540;
  200. width[0x28] = 333;
  201. width[0x29] = 333;
  202. width[0x25] = 1000;
  203. width[0x2e] = 250;
  204. width[0xb7] = 250;
  205. width[0x89] = 1000;
  206. width[0x2b] = 570;
  207. width[0xb1] = 570;
  208. width[0x71] = 556;
  209. width[0x3f] = 500;
  210. width[0xbf] = 500;
  211. width[0x22] = 555;
  212. width[0x84] = 500;
  213. width[0x93] = 500;
  214. width[0x94] = 500;
  215. width[0x91] = 333;
  216. width[0x92] = 333;
  217. width[0x82] = 333;
  218. width[0x27] = 278;
  219. width[0x72] = 444;
  220. width[0xae] = 747;
  221. width[0x73] = 389;
  222. width[0x9a] = 389;
  223. width[0xa7] = 500;
  224. width[0x3b] = 333;
  225. width[0x37] = 500;
  226. width[0x36] = 500;
  227. width[0x2f] = 278;
  228. width[0x20] = 250;
  229. width[0xa3] = 500;
  230. width[0x74] = 333;
  231. width[0xfe] = 556;
  232. width[0x33] = 500;
  233. width[0xbe] = 750;
  234. width[0xb3] = 300;
  235. width[0x98] = 333;
  236. width[0x99] = 1000;
  237. width[0x32] = 500;
  238. width[0xb2] = 300;
  239. width[0x75] = 556;
  240. width[0xfa] = 556;
  241. width[0xfb] = 556;
  242. width[0xfc] = 556;
  243. width[0xf9] = 556;
  244. width[0x5f] = 500;
  245. width[0x76] = 500;
  246. width[0x77] = 722;
  247. width[0x78] = 500;
  248. width[0x79] = 500;
  249. width[0xfd] = 500;
  250. width[0xff] = 500;
  251. width[0xa5] = 500;
  252. width[0x7a] = 444;
  253. width[0x9e] = 444;
  254. width[0x30] = 500;
  255. }
  256. public String getEncoding() {
  257. return encoding;
  258. }
  259. public String getFontName() {
  260. return fontName;
  261. }
  262. public FontType getFontType() {
  263. return FontType.TYPE1;
  264. }
  265. public int getAscender(int size) {
  266. return size * ascender;
  267. }
  268. public int getCapHeight(int size) {
  269. return size * capHeight;
  270. }
  271. public int getDescender(int size) {
  272. return size * descender;
  273. }
  274. public int getXHeight(int size) {
  275. return size * xHeight;
  276. }
  277. public int getFirstChar() {
  278. return firstChar;
  279. }
  280. public int getLastChar() {
  281. return lastChar;
  282. }
  283. public int getWidth(int i,int size) {
  284. return size * width[i];
  285. }
  286. public int[] getWidths() {
  287. int[] arr = new int[getLastChar()-getFirstChar()+1];
  288. System.arraycopy(width, getFirstChar(), arr, 0, getLastChar()-getFirstChar()+1);
  289. //for( int i = 0; i < arr.length; i++) arr[i] *= size;
  290. return arr;
  291. }
  292. public boolean hasKerningInfo() {
  293. return false;
  294. }
  295. public java.util.Map getKerningInfo() {
  296. return java.util.Collections.EMPTY_MAP;
  297. }
  298. public char mapChar(char c) {
  299. char d = mapping.mapChar(c);
  300. if(d != 0) {
  301. return d;
  302. } else {
  303. return '#';
  304. }
  305. }
  306. }