KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > render > mif > fonts > HelveticaBold


1 /*
2  * $Id: HelveticaBold.java,v 1.2.2.1 2003/02/25 14:39:49 jeremias Exp $
3  * ============================================================================
4  * The Apache Software License, Version 1.1
5  * ============================================================================
6  *
7  * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without modifica-
10  * tion, are permitted provided that the following conditions are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright notice,
16  * this list of conditions and the following disclaimer in the documentation
17  * and/or other materials provided with the distribution.
18  *
19  * 3. The end-user documentation included with the redistribution, if any, must
20  * include the following acknowledgment: "This product includes software
21  * developed by the Apache Software Foundation (http://www.apache.org/)."
22  * Alternately, this acknowledgment may appear in the software itself, if
23  * and wherever such third-party acknowledgments normally appear.
24  *
25  * 4. The names "FOP" and "Apache Software Foundation" must not be used to
26  * endorse or promote products derived from this software without prior
27  * written permission. For written permission, please contact
28  * apache@apache.org.
29  *
30  * 5. Products derived from this software may not be called "Apache", nor may
31  * "Apache" appear in their name, without prior written permission of the
32  * Apache Software Foundation.
33  *
34  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
35  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
36  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
37  * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
38  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
39  * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
40  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
41  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
42  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
43  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44  * ============================================================================
45  *
46  * This software consists of voluntary contributions made by many individuals
47  * on behalf of the Apache Software Foundation and was originally created by
48  * James Tauber <jtauber@jtauber.com>. For more information on the Apache
49  * Software Foundation, please see <http://www.apache.org/>.
50  */

51 package org.apache.fop.render.mif.fonts;
52
53 import org.apache.fop.render.mif.Font;
54
55 public class HelveticaBold extends Font {
56     private final static String JavaDoc fontName = "Helvetica-Bold";
57     private final static String JavaDoc encoding = "WinAnsiEncoding";
58     private final static int capHeight = 718;
59     private final static int xHeight = 532;
60     private final static int ascender = 718;
61     private final static int descender = -207;
62     private final static int firstChar = 32;
63     private final static int lastChar = 255;
64     private final static int[] width;
65
66     static {
67         width = new int[256];
68         width[0x0041] = 722;
69         width[0x00C6] = 1000;
70         width[0x00C1] = 722;
71         width[0x00C2] = 722;
72         width[0x00C4] = 722;
73         width[0x00C0] = 722;
74         width[0x00C5] = 722;
75         width[0x00C3] = 722;
76         width[0x0042] = 722;
77         width[0x0043] = 722;
78         width[0x00C7] = 722;
79         width[0x0044] = 722;
80         width[0x0045] = 667;
81         width[0x00C9] = 667;
82         width[0x00CA] = 667;
83         width[0x00CB] = 667;
84         width[0x00C8] = 667;
85         width[0x00D0] = 722;
86         width[0x0046] = 611;
87         width[0x0047] = 778;
88         width[0x0048] = 722;
89         width[0x0049] = 278;
90         width[0x00CD] = 278;
91         width[0x00CE] = 278;
92         width[0x00CF] = 278;
93         width[0x00CC] = 278;
94         width[0x004A] = 556;
95         width[0x004B] = 722;
96         width[0x004C] = 611;
97         width[0x004D] = 833;
98         width[0x004E] = 722;
99         width[0x00D1] = 722;
100         width[0x004F] = 778;
101         width[0x008C] = 1000;
102         width[0x00D3] = 778;
103         width[0x00D4] = 778;
104         width[0x00D6] = 778;
105         width[0x00D2] = 778;
106         width[0x00D8] = 778;
107         width[0x00D5] = 778;
108         width[0x0050] = 667;
109         width[0x0051] = 778;
110         width[0x0052] = 722;
111         width[0x0053] = 667;
112         width[0x008A] = 667;
113         width[0x0054] = 611;
114         width[0x00DE] = 667;
115         width[0x0055] = 722;
116         width[0x00DA] = 722;
117         width[0x00DB] = 722;
118         width[0x00DC] = 722;
119         width[0x00D9] = 722;
120         width[0x0056] = 667;
121         width[0x0057] = 944;
122         width[0x0058] = 667;
123         width[0x0059] = 667;
124         width[0x00DD] = 667;
125         width[0x009F] = 667;
126         width[0x005A] = 611;
127         width[0x0061] = 556;
128         width[0x00E1] = 556;
129         width[0x00E2] = 556;
130         width[0x00B4] = 333;
131         width[0x00E4] = 556;
132         width[0x00E6] = 889;
133         width[0x00E0] = 556;
134         width[0x0026] = 722;
135         width[0x00E5] = 556;
136         width[0x005E] = 584;
137         width[0x007E] = 584;
138         width[0x002A] = 389;
139         width[0x0040] = 975;
140         width[0x00E3] = 556;
141         width[0x0062] = 611;
142         width[0x005C] = 278;
143         width[0x007C] = 280;
144         width[0x007B] = 389;
145         width[0x007D] = 389;
146         width[0x005B] = 333;
147         width[0x005D] = 333;
148         width[0x00A6] = 280;
149         width[0x0095] = 350;
150         width[0x0063] = 556;
151         width[0x00E7] = 556;
152         width[0x00B8] = 333;
153         width[0x00A2] = 556;
154         width[0x0088] = 333;
155         width[0x003A] = 333;
156         width[0x002C] = 278;
157         width[0x00A9] = 737;
158         width[0x00A4] = 556;
159         width[0x0064] = 611;
160         width[0x0086] = 556;
161         width[0x0087] = 556;
162         width[0x00B0] = 400;
163         width[0x00A8] = 333;
164         width[0x00F7] = 584;
165         width[0x0024] = 556;
166         width[0x0065] = 556;
167         width[0x00E9] = 556;
168         width[0x00EA] = 556;
169         width[0x00EB] = 556;
170         width[0x00E8] = 556;
171         width[0x0038] = 556;
172         width[0x0085] = 1000;
173         width[0x0097] = 1000;
174         width[0x0096] = 556;
175         width[0x003D] = 584;
176         width[0x00F0] = 611;
177         width[0x0021] = 333;
178         width[0x00A1] = 333;
179         width[0x0066] = 333;
180         width[0x0035] = 556;
181         width[0x0083] = 556;
182         width[0x0034] = 556;
183         width[0xA4] = 167;
184         width[0x0067] = 611;
185         width[0x00DF] = 611;
186         width[0x0060] = 333;
187         width[0x003E] = 584;
188         width[0x00AB] = 556;
189         width[0x00BB] = 556;
190         width[0x008B] = 333;
191         width[0x009B] = 333;
192         width[0x0068] = 611;
193         width[0x002D] = 333;
194         width[0x0069] = 278;
195         width[0x00ED] = 278;
196         width[0x00EE] = 278;
197         width[0x00EF] = 278;
198         width[0x00EC] = 278;
199         width[0x006A] = 278;
200         width[0x006B] = 556;
201         width[0x006C] = 278;
202         width[0x003C] = 584;
203         width[0x00AC] = 584;
204         width[0x006D] = 889;
205         width[0x00AF] = 333;
206         width[0x2D] = 584;
207         width[0x00B5] = 611;
208         width[0x00D7] = 584;
209         width[0x006E] = 611;
210         width[0x0039] = 556;
211         width[0x00F1] = 611;
212         width[0x0023] = 556;
213         width[0x006F] = 611;
214         width[0x00F3] = 611;
215         width[0x00F4] = 611;
216         width[0x00F6] = 611;
217         width[0x009C] = 944;
218         width[0x00F2] = 611;
219         width[0x0031] = 556;
220         width[0x00BD] = 834;
221         width[0x00BC] = 834;
222         width[0x00B9] = 333;
223         width[0x00AA] = 370;
224         width[0x00BA] = 365;
225         width[0x00F8] = 611;
226         width[0x00F5] = 611;
227         width[0x0070] = 611;
228         width[0x00B6] = 556;
229         width[0x0028] = 333;
230         width[0x0029] = 333;
231         width[0x0025] = 889;
232         width[0x002E] = 278;
233         width[0x00B7] = 278;
234         width[0x0089] = 1000;
235         width[0x002B] = 584;
236         width[0x00B1] = 584;
237         width[0x0071] = 611;
238         width[0x003F] = 611;
239         width[0x00BF] = 611;
240         width[0x0022] = 474;
241         width[0x0084] = 500;
242         width[0x0093] = 500;
243         width[0x0094] = 500;
244         width[0x0091] = 278;
245         width[0x0092] = 278;
246         width[0x0082] = 278;
247         width[0x0027] = 238;
248         width[0x0072] = 389;
249         width[0x00AE] = 737;
250         width[0x00B0] = 333;
251         width[0x0073] = 556;
252         width[0x009A] = 556;
253         width[0x00A7] = 556;
254         width[0x003B] = 333;
255         width[0x0037] = 556;
256         width[0x0036] = 556;
257         width[0x002F] = 278;
258         width[0x0020] = 278;
259         width[0x00A0] = 278;
260         width[0x00A3] = 556;
261         width[0x0074] = 333;
262         width[0x00FE] = 611;
263         width[0x0033] = 556;
264         width[0x00BE] = 834;
265         width[0x00B3] = 333;
266         width[0x0098] = 333;
267         width[0x0099] = 1000;
268         width[0x0032] = 556;
269         width[0x00B2] = 333;
270         width[0x0075] = 611;
271         width[0x00FA] = 611;
272         width[0x00FB] = 611;
273         width[0x00FC] = 611;
274         width[0x00F9] = 611;
275         width[0x005F] = 556;
276         width[0x0076] = 556;
277         width[0x0077] = 778;
278         width[0x0078] = 556;
279         width[0x0079] = 556;
280         width[0x00FD] = 556;
281         width[0x00FF] = 556;
282         width[0x00A5] = 556;
283         width[0x007A] = 500;
284         width[0x0030] = 556;
285
286     }
287
288     public String JavaDoc encoding() {
289         return encoding;
290     }
291
292     public String JavaDoc fontName() {
293         return fontName;
294     }
295
296     public int getAscender(int size) {
297         return size * ascender;
298     }
299
300     public int getCapHeight(int size) {
301         return size * capHeight;
302     }
303
304     public int getDescender(int size) {
305         return size * descender;
306     }
307
308     public int getXHeight(int size) {
309         return size * xHeight;
310     }
311
312     public int getFirstChar() {
313         return firstChar;
314     }
315
316     public int getLastChar() {
317         return lastChar;
318     }
319
320     public int width(int i, int size) {
321         return size * width[i];
322     }
323
324     public int[] getWidths(int size) {
325         int[] arr = new int[getLastChar() - getFirstChar() + 1];
326         System.arraycopy(width, getFirstChar(), arr, 0,
327                          getLastChar() - getFirstChar() + 1);
328         for (int i = 0; i < arr.length; i++)
329             arr[i] *= size;
330         return arr;
331     }
332
333 }
334
335
Popular Tags