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