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 MacRomanEncoding
036: */
037: public class MacRomanEncoding extends MappedEncoding {
038: static public MacRomanEncoding UNIQUE = new MacRomanEncoding();
039:
040: public MacRomanEncoding() {
041: super ();
042: initialize();
043: }
044:
045: /*
046: * (non-Javadoc)
047: *
048: * @see de.intarsys.pdf.encoding.Encoding#getCosObject()
049: */
050: public COSObject getCosObject() {
051: return CN_MacRomanEncoding;
052: }
053:
054: /*
055: * (non-Javadoc)
056: *
057: * @see de.intarsys.pdf.encoding.Encoding#getName()
058: */
059: public String getName() {
060: return "MacRomanEncoding";
061: }
062:
063: /*
064: * (non-Javadoc)
065: *
066: * @see de.intarsys.pdf.font.MappedEncoding#initialize()
067: */
068: protected void initialize() {
069: addEncoding(0101, Encoding.NAME_A);
070: addEncoding(0256, Encoding.NAME_AE);
071: addEncoding(0347, Encoding.NAME_Aacute);
072: addEncoding(0345, Encoding.NAME_Acircumflex);
073: addEncoding(0200, Encoding.NAME_Adieresis);
074: addEncoding(0313, Encoding.NAME_Agrave);
075: addEncoding(0201, Encoding.NAME_Aring);
076: addEncoding(0314, Encoding.NAME_Atilde);
077: addEncoding(0102, Encoding.NAME_B);
078: addEncoding(0103, Encoding.NAME_C);
079: addEncoding(0202, Encoding.NAME_Ccedilla);
080: addEncoding(0104, Encoding.NAME_D);
081: addEncoding(0105, Encoding.NAME_E);
082: addEncoding(0203, Encoding.NAME_Eacute);
083: addEncoding(0346, Encoding.NAME_Ecircumflex);
084: addEncoding(0350, Encoding.NAME_Edieresis);
085: addEncoding(0351, Encoding.NAME_Egrave);
086: // addEncoding(0320,Encoding.NAME_Eth);
087: // addEncoding(0240,Encoding.NAME_Euro);
088: addEncoding(0106, Encoding.NAME_F);
089: addEncoding(0107, Encoding.NAME_G);
090: addEncoding(0110, Encoding.NAME_H);
091: addEncoding(0111, Encoding.NAME_I);
092: addEncoding(0352, Encoding.NAME_Iacute);
093: addEncoding(0353, Encoding.NAME_Icircumflex);
094: addEncoding(0354, Encoding.NAME_Idieresis);
095: addEncoding(0355, Encoding.NAME_Igrave);
096: addEncoding(0112, Encoding.NAME_J);
097: addEncoding(0113, Encoding.NAME_K);
098: addEncoding(0114, Encoding.NAME_L);
099: // addEncoding(0225,Encoding.NAME_Lslash);
100: addEncoding(0115, Encoding.NAME_M);
101: addEncoding(0116, Encoding.NAME_N);
102: addEncoding(0204, Encoding.NAME_Ntilde);
103: addEncoding(0117, Encoding.NAME_O);
104: addEncoding(0316, Encoding.NAME_OE);
105: addEncoding(0356, Encoding.NAME_Oacute);
106: addEncoding(0357, Encoding.NAME_Ocircumflex);
107: addEncoding(0205, Encoding.NAME_Odieresis);
108: addEncoding(0361, Encoding.NAME_Ograve);
109: addEncoding(0257, Encoding.NAME_Oslash);
110: addEncoding(0315, Encoding.NAME_Otilde);
111: addEncoding(0120, Encoding.NAME_P);
112: addEncoding(0121, Encoding.NAME_Q);
113: addEncoding(0122, Encoding.NAME_R);
114: addEncoding(0123, Encoding.NAME_S);
115: // addEncoding(0227,Encoding.NAME_Scaron);
116: addEncoding(0124, Encoding.NAME_T);
117: // addEncoding(0336,Encoding.NAME_Thorn);
118: addEncoding(0125, Encoding.NAME_U);
119: addEncoding(0362, Encoding.NAME_Uacute);
120: addEncoding(0363, Encoding.NAME_Ucircumflex);
121: addEncoding(0206, Encoding.NAME_Udieresis);
122: addEncoding(0364, Encoding.NAME_Ugrave);
123: addEncoding(0126, Encoding.NAME_V);
124: addEncoding(0127, Encoding.NAME_W);
125: addEncoding(0130, Encoding.NAME_X);
126: addEncoding(0131, Encoding.NAME_Y);
127: // addEncoding(0335,Encoding.NAME_Yacute);
128: addEncoding(0331, Encoding.NAME_Ydieresis);
129: addEncoding(0132, Encoding.NAME_Z);
130: // addEncoding(0231,Encoding.NAME_Zcaron);
131: addEncoding(0141, Encoding.NAME_a);
132: addEncoding(0207, Encoding.NAME_aacute);
133: addEncoding(0211, Encoding.NAME_acircumflex);
134: addEncoding(0253, Encoding.NAME_acute);
135: addEncoding(0212, Encoding.NAME_adieresis);
136: addEncoding(0276, Encoding.NAME_ae);
137: addEncoding(0210, Encoding.NAME_agrave);
138: addEncoding(0046, Encoding.NAME_ampersand);
139: addEncoding(0214, Encoding.NAME_aring);
140: addEncoding(0136, Encoding.NAME_asciicircum);
141: addEncoding(0176, Encoding.NAME_asciitilde);
142: addEncoding(0052, Encoding.NAME_asterisk);
143: addEncoding(0100, Encoding.NAME_at);
144: addEncoding(0213, Encoding.NAME_atilde);
145: addEncoding(0142, Encoding.NAME_b);
146: addEncoding(0134, Encoding.NAME_backslash);
147: addEncoding(0174, Encoding.NAME_bar);
148: addEncoding(0173, Encoding.NAME_braceleft);
149: addEncoding(0175, Encoding.NAME_braceright);
150: addEncoding(0133, Encoding.NAME_bracketleft);
151: addEncoding(0135, Encoding.NAME_bracketright);
152: addEncoding(0371, Encoding.NAME_breve);
153: // addEncoding(0246,Encoding.NAME_brokenbar);
154: addEncoding(0245, Encoding.NAME_bullet);
155: addEncoding(0143, Encoding.NAME_c);
156: addEncoding(0377, Encoding.NAME_caron);
157: addEncoding(0215, Encoding.NAME_ccedilla);
158: addEncoding(0374, Encoding.NAME_cedilla);
159: addEncoding(0242, Encoding.NAME_cent);
160: addEncoding(0366, Encoding.NAME_circumflex);
161: addEncoding(0072, Encoding.NAME_colon);
162: addEncoding(0054, Encoding.NAME_comma);
163: addEncoding(0251, Encoding.NAME_copyright);
164: addEncoding(0333, Encoding.NAME_currency);
165: addEncoding(0144, Encoding.NAME_d);
166: addEncoding(0240, Encoding.NAME_dagger);
167: addEncoding(0340, Encoding.NAME_daggerdbl);
168: addEncoding(0241, Encoding.NAME_degree);
169: addEncoding(0254, Encoding.NAME_dieresis);
170: addEncoding(0326, Encoding.NAME_divide);
171: addEncoding(0044, Encoding.NAME_dollar);
172: addEncoding(0372, Encoding.NAME_dotaccent);
173: addEncoding(0365, Encoding.NAME_dotlessi);
174: addEncoding(0145, Encoding.NAME_e);
175: addEncoding(0216, Encoding.NAME_eacute);
176: addEncoding(0220, Encoding.NAME_ecircumflex);
177: addEncoding(0221, Encoding.NAME_edieresis);
178: addEncoding(0217, Encoding.NAME_egrave);
179: addEncoding(0070, Encoding.NAME_eight);
180: addEncoding(0311, Encoding.NAME_ellipsis);
181: addEncoding(0321, Encoding.NAME_emdash);
182: addEncoding(0320, Encoding.NAME_endash);
183: addEncoding(0075, Encoding.NAME_equal);
184: // addEncoding(0360,Encoding.NAME_eth);
185: addEncoding(0041, Encoding.NAME_exclam);
186: addEncoding(0301, Encoding.NAME_exclamdown);
187: addEncoding(0146, Encoding.NAME_f);
188: addEncoding(0336, Encoding.NAME_fi);
189: addEncoding(0065, Encoding.NAME_five);
190: addEncoding(0337, Encoding.NAME_fl);
191: addEncoding(0304, Encoding.NAME_florin);
192: addEncoding(0064, Encoding.NAME_four);
193: addEncoding(0332, Encoding.NAME_fraction);
194: addEncoding(0147, Encoding.NAME_g);
195: addEncoding(0247, Encoding.NAME_germandbls);
196: addEncoding(0140, Encoding.NAME_grave);
197: addEncoding(0076, Encoding.NAME_greater);
198: addEncoding(0307, Encoding.NAME_guillemotleft);
199: addEncoding(0310, Encoding.NAME_guillemotright);
200: addEncoding(0334, Encoding.NAME_guilsinglleft);
201: addEncoding(0335, Encoding.NAME_guilsinglright);
202: addEncoding(0150, Encoding.NAME_h);
203: addEncoding(0375, Encoding.NAME_hungarumlaut);
204: addEncoding(0055, Encoding.NAME_hyphen);
205: addEncoding(0151, Encoding.NAME_i);
206: addEncoding(0222, Encoding.NAME_iacute);
207: addEncoding(0224, Encoding.NAME_icircumflex);
208: addEncoding(0225, Encoding.NAME_idieresis);
209: addEncoding(0223, Encoding.NAME_igrave);
210: addEncoding(0152, Encoding.NAME_j);
211: addEncoding(0153, Encoding.NAME_k);
212: addEncoding(0154, Encoding.NAME_l);
213: addEncoding(0074, Encoding.NAME_less);
214: addEncoding(0302, Encoding.NAME_logicalnot);
215: // addEncoding(0233,Encoding.NAME_lslash);
216: addEncoding(0155, Encoding.NAME_m);
217: addEncoding(0370, Encoding.NAME_macron);
218: // addEncoding(0212,Encoding.NAME_minus);
219: addEncoding(0265, Encoding.NAME_mu);
220: // addEncoding(0327,Encoding.NAME_multiply);
221: addEncoding(0156, Encoding.NAME_n);
222: addEncoding(0071, Encoding.NAME_nine);
223: addEncoding(0226, Encoding.NAME_ntilde);
224: addEncoding(0043, Encoding.NAME_numbersign);
225: addEncoding(0157, Encoding.NAME_o);
226: addEncoding(0227, Encoding.NAME_oacute);
227: addEncoding(0231, Encoding.NAME_ocircumflex);
228: addEncoding(0232, Encoding.NAME_odieresis);
229: addEncoding(0317, Encoding.NAME_oe);
230: addEncoding(0376, Encoding.NAME_ogonek);
231: addEncoding(0230, Encoding.NAME_ograve);
232: addEncoding(0061, Encoding.NAME_one);
233: // addEncoding(0275,Encoding.NAME_onehalf);
234: // addEncoding(0274,Encoding.NAME_onequarter);
235: // addEncoding(0271,Encoding.NAME_onesuperior);
236: addEncoding(0273, Encoding.NAME_ordfeminine);
237: addEncoding(0274, Encoding.NAME_ordmasculine);
238: addEncoding(0277, Encoding.NAME_oslash);
239: addEncoding(0233, Encoding.NAME_otilde);
240: addEncoding(0160, Encoding.NAME_p);
241: addEncoding(0246, Encoding.NAME_paragraph);
242: addEncoding(0050, Encoding.NAME_parenleft);
243: addEncoding(0051, Encoding.NAME_parenright);
244: addEncoding(0045, Encoding.NAME_percent);
245: addEncoding(0056, Encoding.NAME_period);
246: addEncoding(0341, Encoding.NAME_periodcentered);
247: addEncoding(0344, Encoding.NAME_perthousand);
248: addEncoding(0053, Encoding.NAME_plus);
249: addEncoding(0261, Encoding.NAME_plusminus);
250: addEncoding(0161, Encoding.NAME_q);
251: addEncoding(0077, Encoding.NAME_question);
252: addEncoding(0300, Encoding.NAME_questiondown);
253: addEncoding(0042, Encoding.NAME_quotedbl);
254: addEncoding(0343, Encoding.NAME_quotedblbase);
255: addEncoding(0322, Encoding.NAME_quotedblleft);
256: addEncoding(0323, Encoding.NAME_quotedblright);
257: addEncoding(0324, Encoding.NAME_quoteleft);
258: addEncoding(0325, Encoding.NAME_quoteright);
259: addEncoding(0342, Encoding.NAME_quotesinglbase);
260: addEncoding(0047, Encoding.NAME_quotesingle);
261: addEncoding(0162, Encoding.NAME_r);
262: addEncoding(0250, Encoding.NAME_registered);
263: addEncoding(0373, Encoding.NAME_ring);
264: addEncoding(0163, Encoding.NAME_s);
265: // addEncoding(0235,Encoding.NAME_scaron);
266: addEncoding(0244, Encoding.NAME_section);
267: addEncoding(0073, Encoding.NAME_semicolon);
268: addEncoding(0067, Encoding.NAME_seven);
269: addEncoding(0066, Encoding.NAME_six);
270: addEncoding(0057, Encoding.NAME_slash);
271: // alternative: nonbreaking space; add first so reverse mapping will be
272: // overwritten by proper value later
273: addEncoding(0312, Encoding.NAME_space);
274: addEncoding(0040, Encoding.NAME_space);
275: addEncoding(0243, Encoding.NAME_sterling);
276: addEncoding(0164, Encoding.NAME_t);
277: // addEncoding(0376,Encoding.NAME_thorn);
278: addEncoding(0063, Encoding.NAME_three);
279: // addEncoding(0276,Encoding.NAME_threequarters);
280: // addEncoding(0263,Encoding.NAME_threesuperior);
281: addEncoding(0367, Encoding.NAME_tilde);
282: addEncoding(0252, Encoding.NAME_trademark);
283: addEncoding(0062, Encoding.NAME_two);
284: // addEncoding(0262,Encoding.NAME_twosuperior);
285: addEncoding(0165, Encoding.NAME_u);
286: addEncoding(0234, Encoding.NAME_uacute);
287: addEncoding(0236, Encoding.NAME_ucircumflex);
288: addEncoding(0237, Encoding.NAME_udieresis);
289: addEncoding(0235, Encoding.NAME_ugrave);
290: addEncoding(0137, Encoding.NAME_underscore);
291: addEncoding(0166, Encoding.NAME_v);
292: addEncoding(0167, Encoding.NAME_w);
293: addEncoding(0170, Encoding.NAME_x);
294: addEncoding(0171, Encoding.NAME_y);
295: // addEncoding(0375,Encoding.NAME_yacute);
296: addEncoding(0330, Encoding.NAME_ydieresis);
297: addEncoding(0264, Encoding.NAME_yen);
298: addEncoding(0172, Encoding.NAME_z);
299: // addEncoding(0236,Encoding.NAME_zcaron);
300: addEncoding(0060, Encoding.NAME_zero);
301: }
302: }
|