001: /*
002: * Copyright (c) 2007, intarsys consulting GmbH
003: *
004: * Redistribution and use in source and binary forms, with or without
005: * modification, are permitted provided that the following conditions are met:
006: *
007: * - Redistributions of source code must retain the above copyright notice,
008: * this list of conditions and the following disclaimer.
009: *
010: * - Redistributions in binary form must reproduce the above copyright notice,
011: * this list of conditions and the following disclaimer in the documentation
012: * and/or other materials provided with the distribution.
013: *
014: * - Neither the name of intarsys nor the names of its contributors may be used
015: * to endorse or promote products derived from this software without specific
016: * prior written permission.
017: *
018: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
019: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
020: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
021: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
022: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
023: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
024: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
025: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
026: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
027: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
028: * POSSIBILITY OF SUCH DAMAGE.
029: */
030: package de.intarsys.pdf.encoding;
031:
032: import de.intarsys.pdf.cos.COSObject;
033:
034: /**
035: * Implementation of statndard Roman encoding on the Mac platform.
036: * <p>
037: * This is not a "native" PDF endocing! It is simply used for mapping char codes
038: * in certain contexts (TrueType with 1,0 charmaps).
039: *
040: */
041: public class MacOSRomanEncoding extends MappedEncoding {
042: private static final String NAME_apple = null;
043:
044: private static final String NAME_approxequal = null;
045:
046: private static final String NAME_Delta = null;
047:
048: private static final String NAME_greaterequal = null;
049:
050: private static final String NAME_infinity = null;
051:
052: private static final String NAME_integral = null;
053:
054: private static final String NAME_lessequal = null;
055:
056: private static final String NAME_lozenge = null;
057:
058: private static final String NAME_notequal = null;
059:
060: private static final String NAME_Omega = null;
061:
062: private static final String NAME_partialdiff = null;
063:
064: private static final String NAME_pi = null;
065:
066: private static final String NAME_product = null;
067:
068: private static final String NAME_radical = null;
069:
070: private static final String NAME_summation = null;
071:
072: static public MacOSRomanEncoding UNIQUE = new MacOSRomanEncoding();
073:
074: public MacOSRomanEncoding() {
075: super ();
076: initialize();
077: }
078:
079: /*
080: * (non-Javadoc)
081: *
082: * @see de.intarsys.pdf.encoding.Encoding#getCosObject()
083: */
084: public COSObject getCosObject() {
085: return CN_MacRomanEncoding;
086: }
087:
088: /*
089: * (non-Javadoc)
090: *
091: * @see de.intarsys.pdf.encoding.Encoding#getName()
092: */
093: public String getName() {
094: return "MacOSRomanEncoding";
095: }
096:
097: /*
098: * (non-Javadoc)
099: *
100: * @see de.intarsys.pdf.font.MappedEncoding#initialize()
101: */
102: protected void initialize() {
103: addEncoding(0101, Encoding.NAME_A);
104: addEncoding(0256, Encoding.NAME_AE);
105: addEncoding(0347, Encoding.NAME_Aacute);
106: addEncoding(0345, Encoding.NAME_Acircumflex);
107: addEncoding(0200, Encoding.NAME_Adieresis);
108: addEncoding(0313, Encoding.NAME_Agrave);
109: addEncoding(0201, Encoding.NAME_Aring);
110: addEncoding(0314, Encoding.NAME_Atilde);
111: addEncoding(0102, Encoding.NAME_B);
112: addEncoding(0103, Encoding.NAME_C);
113: addEncoding(0202, Encoding.NAME_Ccedilla);
114: addEncoding(0104, Encoding.NAME_D);
115: addEncoding(0105, Encoding.NAME_E);
116: addEncoding(0203, Encoding.NAME_Eacute);
117: addEncoding(0346, Encoding.NAME_Ecircumflex);
118: addEncoding(0350, Encoding.NAME_Edieresis);
119: addEncoding(0351, Encoding.NAME_Egrave);
120: // addEncoding(0320, Encoding.NAME_Eth);
121: // addEncoding(0240, Encoding.NAME_Euro);
122: addEncoding(0106, Encoding.NAME_F);
123: addEncoding(0107, Encoding.NAME_G);
124: addEncoding(0110, Encoding.NAME_H);
125: addEncoding(0111, Encoding.NAME_I);
126: addEncoding(0352, Encoding.NAME_Iacute);
127: addEncoding(0353, Encoding.NAME_Icircumflex);
128: addEncoding(0354, Encoding.NAME_Idieresis);
129: addEncoding(0355, Encoding.NAME_Igrave);
130: addEncoding(0112, Encoding.NAME_J);
131: addEncoding(0113, Encoding.NAME_K);
132: addEncoding(0114, Encoding.NAME_L);
133: // addEncoding(0225, Encoding.NAME_Lslash);
134: addEncoding(0115, Encoding.NAME_M);
135: addEncoding(0116, Encoding.NAME_N);
136: addEncoding(0204, Encoding.NAME_Ntilde);
137: addEncoding(0117, Encoding.NAME_O);
138: addEncoding(0316, Encoding.NAME_OE);
139: addEncoding(0356, Encoding.NAME_Oacute);
140: addEncoding(0357, Encoding.NAME_Ocircumflex);
141: addEncoding(0205, Encoding.NAME_Odieresis);
142: addEncoding(0361, Encoding.NAME_Ograve);
143: addEncoding(0257, Encoding.NAME_Oslash);
144: addEncoding(0315, Encoding.NAME_Otilde);
145: addEncoding(0120, Encoding.NAME_P);
146: addEncoding(0121, Encoding.NAME_Q);
147: addEncoding(0122, Encoding.NAME_R);
148: addEncoding(0123, Encoding.NAME_S);
149: // addEncoding(0227, Encoding.NAME_Scaron);
150: addEncoding(0124, Encoding.NAME_T);
151: // addEncoding(0336, Encoding.NAME_Thorn);
152: addEncoding(0125, Encoding.NAME_U);
153: addEncoding(0362, Encoding.NAME_Uacute);
154: addEncoding(0363, Encoding.NAME_Ucircumflex);
155: addEncoding(0206, Encoding.NAME_Udieresis);
156: addEncoding(0364, Encoding.NAME_Ugrave);
157: addEncoding(0126, Encoding.NAME_V);
158: addEncoding(0127, Encoding.NAME_W);
159: addEncoding(0130, Encoding.NAME_X);
160: addEncoding(0131, Encoding.NAME_Y);
161: // addEncoding(0335, Encoding.NAME_Yacute);
162: addEncoding(0331, Encoding.NAME_Ydieresis);
163: addEncoding(0132, Encoding.NAME_Z);
164: // addEncoding(0231, Encoding.NAME_Zcaron);
165: addEncoding(0141, Encoding.NAME_a);
166: addEncoding(0207, Encoding.NAME_aacute);
167: addEncoding(0211, Encoding.NAME_acircumflex);
168: addEncoding(0253, Encoding.NAME_acute);
169: addEncoding(0212, Encoding.NAME_adieresis);
170: addEncoding(0276, Encoding.NAME_ae);
171: addEncoding(0210, Encoding.NAME_agrave);
172: addEncoding(0046, Encoding.NAME_ampersand);
173: addEncoding(0214, Encoding.NAME_aring);
174: addEncoding(0136, Encoding.NAME_asciicircum);
175: addEncoding(0176, Encoding.NAME_asciitilde);
176: addEncoding(0052, Encoding.NAME_asterisk);
177: addEncoding(0100, Encoding.NAME_at);
178: addEncoding(0213, Encoding.NAME_atilde);
179: addEncoding(0142, Encoding.NAME_b);
180: addEncoding(0134, Encoding.NAME_backslash);
181: addEncoding(0174, Encoding.NAME_bar);
182: addEncoding(0173, Encoding.NAME_braceleft);
183: addEncoding(0175, Encoding.NAME_braceright);
184: addEncoding(0133, Encoding.NAME_bracketleft);
185: addEncoding(0135, Encoding.NAME_bracketright);
186: addEncoding(0371, Encoding.NAME_breve);
187: // addEncoding(0246, Encoding.NAME_brokenbar);
188: addEncoding(0245, Encoding.NAME_bullet);
189: addEncoding(0143, Encoding.NAME_c);
190: addEncoding(0377, Encoding.NAME_caron);
191: addEncoding(0215, Encoding.NAME_ccedilla);
192: addEncoding(0374, Encoding.NAME_cedilla);
193: addEncoding(0242, Encoding.NAME_cent);
194: addEncoding(0366, Encoding.NAME_circumflex);
195: addEncoding(0072, Encoding.NAME_colon);
196: addEncoding(0054, Encoding.NAME_comma);
197: addEncoding(0251, Encoding.NAME_copyright);
198: addEncoding(0333, Encoding.NAME_currency);
199: addEncoding(0144, Encoding.NAME_d);
200: addEncoding(0240, Encoding.NAME_dagger);
201: addEncoding(0340, Encoding.NAME_daggerdbl);
202: addEncoding(0241, Encoding.NAME_degree);
203: addEncoding(0254, Encoding.NAME_dieresis);
204: addEncoding(0326, Encoding.NAME_divide);
205: addEncoding(0044, Encoding.NAME_dollar);
206: addEncoding(0372, Encoding.NAME_dotaccent);
207: addEncoding(0365, Encoding.NAME_dotlessi);
208: addEncoding(0145, Encoding.NAME_e);
209: addEncoding(0216, Encoding.NAME_eacute);
210: addEncoding(0220, Encoding.NAME_ecircumflex);
211: addEncoding(0221, Encoding.NAME_edieresis);
212: addEncoding(0217, Encoding.NAME_egrave);
213: addEncoding(0070, Encoding.NAME_eight);
214: addEncoding(0311, Encoding.NAME_ellipsis);
215: addEncoding(0321, Encoding.NAME_emdash);
216: addEncoding(0320, Encoding.NAME_endash);
217: addEncoding(0075, Encoding.NAME_equal);
218: // addEncoding(0360, Encoding.NAME_eth);
219: addEncoding(0041, Encoding.NAME_exclam);
220: addEncoding(0301, Encoding.NAME_exclamdown);
221: addEncoding(0146, Encoding.NAME_f);
222: addEncoding(0336, Encoding.NAME_fi);
223: addEncoding(0065, Encoding.NAME_five);
224: addEncoding(0337, Encoding.NAME_fl);
225: addEncoding(0304, Encoding.NAME_florin);
226: addEncoding(0064, Encoding.NAME_four);
227: addEncoding(0332, Encoding.NAME_fraction);
228: addEncoding(0147, Encoding.NAME_g);
229: addEncoding(0247, Encoding.NAME_germandbls);
230: addEncoding(0140, Encoding.NAME_grave);
231: addEncoding(0076, Encoding.NAME_greater);
232: addEncoding(0307, Encoding.NAME_guillemotleft);
233: addEncoding(0310, Encoding.NAME_guillemotright);
234: addEncoding(0334, Encoding.NAME_guilsinglleft);
235: addEncoding(0335, Encoding.NAME_guilsinglright);
236: addEncoding(0150, Encoding.NAME_h);
237: addEncoding(0375, Encoding.NAME_hungarumlaut);
238: addEncoding(0055, Encoding.NAME_hyphen);
239: addEncoding(0151, Encoding.NAME_i);
240: addEncoding(0222, Encoding.NAME_iacute);
241: addEncoding(0224, Encoding.NAME_icircumflex);
242: addEncoding(0225, Encoding.NAME_idieresis);
243: addEncoding(0223, Encoding.NAME_igrave);
244: addEncoding(0152, Encoding.NAME_j);
245: addEncoding(0153, Encoding.NAME_k);
246: addEncoding(0154, Encoding.NAME_l);
247: addEncoding(0074, Encoding.NAME_less);
248: addEncoding(0302, Encoding.NAME_logicalnot);
249: // addEncoding(0233, Encoding.NAME_lslash);
250: addEncoding(0155, Encoding.NAME_m);
251: addEncoding(0370, Encoding.NAME_macron);
252: // addEncoding(0212, Encoding.NAME_minus);
253: addEncoding(0265, Encoding.NAME_mu);
254: // addEncoding(0327, Encoding.NAME_multiply);
255: addEncoding(0156, Encoding.NAME_n);
256: addEncoding(0071, Encoding.NAME_nine);
257: addEncoding(0226, Encoding.NAME_ntilde);
258: addEncoding(0043, Encoding.NAME_numbersign);
259: addEncoding(0157, Encoding.NAME_o);
260: addEncoding(0227, Encoding.NAME_oacute);
261: addEncoding(0231, Encoding.NAME_ocircumflex);
262: addEncoding(0232, Encoding.NAME_odieresis);
263: addEncoding(0317, Encoding.NAME_oe);
264: addEncoding(0376, Encoding.NAME_ogonek);
265: addEncoding(0230, Encoding.NAME_ograve);
266: addEncoding(0061, Encoding.NAME_one);
267: // addEncoding(0275, Encoding.NAME_onehalf);
268: // addEncoding(0274, Encoding.NAME_onequarter);
269: // addEncoding(0271, Encoding.NAME_onesuperior);
270: addEncoding(0273, Encoding.NAME_ordfeminine);
271: addEncoding(0274, Encoding.NAME_ordmasculine);
272: addEncoding(0277, Encoding.NAME_oslash);
273: addEncoding(0233, Encoding.NAME_otilde);
274: addEncoding(0160, Encoding.NAME_p);
275: addEncoding(0246, Encoding.NAME_paragraph);
276: addEncoding(0050, Encoding.NAME_parenleft);
277: addEncoding(0051, Encoding.NAME_parenright);
278: addEncoding(0045, Encoding.NAME_percent);
279: addEncoding(0056, Encoding.NAME_period);
280: addEncoding(0341, Encoding.NAME_periodcentered);
281: addEncoding(0344, Encoding.NAME_perthousand);
282: addEncoding(0053, Encoding.NAME_plus);
283: addEncoding(0261, Encoding.NAME_plusminus);
284: addEncoding(0161, Encoding.NAME_q);
285: addEncoding(0077, Encoding.NAME_question);
286: addEncoding(0300, Encoding.NAME_questiondown);
287: addEncoding(0042, Encoding.NAME_quotedbl);
288: addEncoding(0343, Encoding.NAME_quotedblbase);
289: addEncoding(0322, Encoding.NAME_quotedblleft);
290: addEncoding(0323, Encoding.NAME_quotedblright);
291: addEncoding(0324, Encoding.NAME_quoteleft);
292: addEncoding(0325, Encoding.NAME_quoteright);
293: addEncoding(0342, Encoding.NAME_quotesinglbase);
294: addEncoding(0047, Encoding.NAME_quotesingle);
295: addEncoding(0162, Encoding.NAME_r);
296: addEncoding(0250, Encoding.NAME_registered);
297: addEncoding(0373, Encoding.NAME_ring);
298: addEncoding(0163, Encoding.NAME_s);
299: // addEncoding(0235, Encoding.NAME_scaron);
300: addEncoding(0244, Encoding.NAME_section);
301: addEncoding(0073, Encoding.NAME_semicolon);
302: addEncoding(0067, Encoding.NAME_seven);
303: addEncoding(0066, Encoding.NAME_six);
304: addEncoding(0057, Encoding.NAME_slash);
305: addEncoding(0040, Encoding.NAME_space);
306: addEncoding(0243, Encoding.NAME_sterling);
307: addEncoding(0164, Encoding.NAME_t);
308: // addEncoding(0376, Encoding.NAME_thorn);
309: addEncoding(0063, Encoding.NAME_three);
310: // addEncoding(0276, Encoding.NAME_threequarters);
311: // addEncoding(0263, Encoding.NAME_threesuperior);
312: addEncoding(0367, Encoding.NAME_tilde);
313: addEncoding(0252, Encoding.NAME_trademark);
314: addEncoding(0062, Encoding.NAME_two);
315: // addEncoding(0262, Encoding.NAME_twosuperior);
316: addEncoding(0165, Encoding.NAME_u);
317: addEncoding(0234, Encoding.NAME_uacute);
318: addEncoding(0236, Encoding.NAME_ucircumflex);
319: addEncoding(0237, Encoding.NAME_udieresis);
320: addEncoding(0235, Encoding.NAME_ugrave);
321: addEncoding(0137, Encoding.NAME_underscore);
322: addEncoding(0166, Encoding.NAME_v);
323: addEncoding(0167, Encoding.NAME_w);
324: addEncoding(0170, Encoding.NAME_x);
325: addEncoding(0171, Encoding.NAME_y);
326: // addEncoding(0375, Encoding.NAME_yacute);
327: addEncoding(0330, Encoding.NAME_ydieresis);
328: addEncoding(0264, Encoding.NAME_yen);
329: addEncoding(0172, Encoding.NAME_z);
330: // addEncoding(0236, Encoding.NAME_zcaron);
331: addEncoding(0060, Encoding.NAME_zero);
332:
333: // additions in the Mac OS Roman vs. MacRoman
334: addEncoding(0255, MacOSRomanEncoding.NAME_notequal);
335: addEncoding(0260, MacOSRomanEncoding.NAME_infinity);
336: addEncoding(0262, MacOSRomanEncoding.NAME_lessequal);
337: addEncoding(0263, MacOSRomanEncoding.NAME_greaterequal);
338: addEncoding(0266, MacOSRomanEncoding.NAME_partialdiff);
339: addEncoding(0267, MacOSRomanEncoding.NAME_summation);
340: addEncoding(0270, MacOSRomanEncoding.NAME_product);
341: addEncoding(0271, MacOSRomanEncoding.NAME_pi);
342: addEncoding(0272, MacOSRomanEncoding.NAME_integral);
343: addEncoding(0275, MacOSRomanEncoding.NAME_Omega);
344: addEncoding(0303, MacOSRomanEncoding.NAME_radical);
345: addEncoding(0305, MacOSRomanEncoding.NAME_approxequal);
346: addEncoding(0306, MacOSRomanEncoding.NAME_Delta);
347: addEncoding(0327, MacOSRomanEncoding.NAME_lozenge);
348: addEncoding(0333, Encoding.NAME_Euro);
349: addEncoding(0360, MacOSRomanEncoding.NAME_apple);
350: }
351: }
|