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