KickJava   Java API By Example, From Geeks To Geeks.

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


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