xref: /aoo41x/main/unotools/source/misc/fontcvt.cxx (revision 55221da5)
1b5088357SAndrew Rist /**************************************************************
2*55221da5SMatthias Seidel  *
3b5088357SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4b5088357SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5b5088357SAndrew Rist  * distributed with this work for additional information
6b5088357SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7b5088357SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8b5088357SAndrew Rist  * "License"); you may not use this file except in compliance
9b5088357SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*55221da5SMatthias Seidel  *
11b5088357SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*55221da5SMatthias Seidel  *
13b5088357SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14b5088357SAndrew Rist  * software distributed under the License is distributed on an
15b5088357SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16b5088357SAndrew Rist  * KIND, either express or implied.  See the License for the
17b5088357SAndrew Rist  * specific language governing permissions and limitations
18b5088357SAndrew Rist  * under the License.
19*55221da5SMatthias Seidel  *
20b5088357SAndrew Rist  *************************************************************/
21b5088357SAndrew Rist 
22b5088357SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_unotools.hxx"
26cdf0e10cSrcweir #include <unotools/fontcvt.hxx>
27cdf0e10cSrcweir #include <unotools/fontdefs.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #ifndef _STLP_MAP
30cdf0e10cSrcweir #include <map>
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir #ifndef _STLP_VECTOR
33cdf0e10cSrcweir #include <vector>
34cdf0e10cSrcweir #endif
35cdf0e10cSrcweir #ifndef _STLP_ALGORITHM
36cdf0e10cSrcweir #include <algorithm>
37cdf0e10cSrcweir #endif
38cdf0e10cSrcweir #ifndef _STLP_FUNCTIONAL
39cdf0e10cSrcweir #include <functional>
40cdf0e10cSrcweir #endif
41cdf0e10cSrcweir 
42cdf0e10cSrcweir //=======================================================================
43cdf0e10cSrcweir // note: the character mappings that are only approximations
44cdf0e10cSrcweir //       are marked (with an empty comment)
45cdf0e10cSrcweir 
46cdf0e10cSrcweir static const sal_Unicode aStarBatsTab[224] =
47cdf0e10cSrcweir {
48cdf0e10cSrcweir     // F020
49cdf0e10cSrcweir         0x0020,    0x263a,    0x25cf,    0x274d,
50cdf0e10cSrcweir         0x25a0,    0x25a1,    0xE000,    0x2751,
51cdf0e10cSrcweir         0x2752,    0xE001,    0xE002,    0xE003,
52cdf0e10cSrcweir         0x2756,    0xE004,    0xE005,    0x27a2,
53cdf0e10cSrcweir     // F030
54cdf0e10cSrcweir         0xE006,    0x2794,    0x2713,    0x2612,
55cdf0e10cSrcweir         0x2611,    0x27b2,    0x261b,    0x270d,
56cdf0e10cSrcweir         0x270e,    0xE007,    0x2714,    0xE008,
57cdf0e10cSrcweir         0xE009,    0xE00A,    0x274f,    0x2750,
58cdf0e10cSrcweir     // F040
59cdf0e10cSrcweir         0xE00B,    0xE00C,    0xE00D,    0xE00E,
60cdf0e10cSrcweir         0x2722,    0x2723,    0x2724,    0x2725,
61cdf0e10cSrcweir         0x2733,    0x2734,    0x2735,    0x2736,
62cdf0e10cSrcweir         0x2737,    0x2738,    0x2739,    0x2717,
63cdf0e10cSrcweir     // F050
64cdf0e10cSrcweir         0x2718,    0x2719,    0x271a,    0x271b,
65cdf0e10cSrcweir         0x271c,    0x272b,    0x272c,    0x272d,
66cdf0e10cSrcweir         0x272e,    0x272f,    0x2730,         0,
67cdf0e10cSrcweir         0xE00F,    0x278a,    0x278b,    0x278c,
68cdf0e10cSrcweir     // F060
69cdf0e10cSrcweir         0x278d,    0x278e,    0x278f,    0x2790,
70cdf0e10cSrcweir         0x2791,    0x2792,    0x2793,    0xE010,
71cdf0e10cSrcweir         0x2780,    0x2781,    0x2782,    0x2783,
72cdf0e10cSrcweir         0x2784,    0x2785,    0x2786,    0x2787,
73cdf0e10cSrcweir     // F070
74cdf0e10cSrcweir         0x2788,    0x2789,    0xE011,    0xE012,
75cdf0e10cSrcweir         0x260e,    0xE013,    0xE014,    0xE015,
76cdf0e10cSrcweir         0xE016,    0xE017,    0xE018,    0xE019,
77cdf0e10cSrcweir         0xE01A,    0x261e,    0xE01B,         0,
78cdf0e10cSrcweir     // F080
79cdf0e10cSrcweir         0x20ac,         0,    0x201a,    0x0192,
80cdf0e10cSrcweir         0x201e,    0x2026,    0x2020,    0x2021,
81cdf0e10cSrcweir         0xE01c,    0x2030,    0x0160,    0x2039,
82cdf0e10cSrcweir         0x0152,         0,    0x017d,         0,
83cdf0e10cSrcweir     // F090
84cdf0e10cSrcweir              0,    0x2018,    0x2019,    0x201c,
85cdf0e10cSrcweir         0x201d,    0x2022,    0x2013,    0x2014,
86cdf0e10cSrcweir         0xE01d,    0x2122,    0x0161,    0x203a,
87cdf0e10cSrcweir         0x0153,         0,    0x017e,    0x0178,
88cdf0e10cSrcweir     // F0A0
89cdf0e10cSrcweir              0,    0x21e7,    0x21e8,    0x21e9,
90cdf0e10cSrcweir         0x21e6,    0xE01e,    0xE01f,    0x00a7,
91cdf0e10cSrcweir         0xE020,    0xE021,    0xE022,    0x00ab,
92cdf0e10cSrcweir         0xE023,    0x2639,    0xE024,    0xE025,
93cdf0e10cSrcweir     // F0B0
94cdf0e10cSrcweir         0xE026,    0xE027,    0xE028,    0x21e5,
95cdf0e10cSrcweir         0x21e4,    0x2192,    0x2193,    0x2190,
96cdf0e10cSrcweir         0x2191,    0xE029,    0xE02a,    0x00bb,
97cdf0e10cSrcweir         0xE02b,    0xE02c,    0xE02d,    0xE02e,
98cdf0e10cSrcweir     // F0C0
99cdf0e10cSrcweir         0xE02f,    0xE030,    0xE031,    0xE032,
100cdf0e10cSrcweir         0x25be,    0x25b4,    0x25bf,    0x25b5,
101cdf0e10cSrcweir         0xE033,    0xE034,    0xE035,    0x2702,
102cdf0e10cSrcweir         0x2708,    0x2721,    0x273f,    0x2744,
103cdf0e10cSrcweir     // F0D0
104cdf0e10cSrcweir         0x25d7,    0x2759,    0xE036,    0xE037,
105cdf0e10cSrcweir         0x2762,    0x2663,    0x2665,    0x2660,
106cdf0e10cSrcweir         0x2194,    0x2195,    0x2798,    0x279a,
107cdf0e10cSrcweir         0x27b8,         0,    0x00b6,         0,
108cdf0e10cSrcweir     // F0E0
109cdf0e10cSrcweir         0x00a2,    0x00a4,    0x00a5,    0xE038,
110cdf0e10cSrcweir         0x20a1,    0x20a2,    0x20a3,    0x20a4,
111cdf0e10cSrcweir         0x20a9,    0x20ab,    0x20a8,    0xE039,
112cdf0e10cSrcweir              0,         0,         0,         0,
113cdf0e10cSrcweir     // F0F0
114cdf0e10cSrcweir              0,         0,         0,         0,
115cdf0e10cSrcweir              0,         0,         0,         0,
116cdf0e10cSrcweir              0,         0,         0,         0,
117cdf0e10cSrcweir              0,         0,         0,    0xE03a
118cdf0e10cSrcweir };
119cdf0e10cSrcweir 
120cdf0e10cSrcweir // -----------------------------------------------------------------------
121cdf0e10cSrcweir 
122cdf0e10cSrcweir static const sal_Unicode aStarMathTab[224] =
123cdf0e10cSrcweir {
124cdf0e10cSrcweir     // F020
125cdf0e10cSrcweir         0x0020,    0x0021,    0x0022,    0x0023,
126cdf0e10cSrcweir         0xE080,    0x0025,    0x0026,    0x221e,
127cdf0e10cSrcweir         0x0028,    0x0029,    0x002a,    0x002b,
128cdf0e10cSrcweir         0x002c,    0x002d,    0x002e,    0x002f,
129cdf0e10cSrcweir     // F030
130cdf0e10cSrcweir         0x2224,    0x21d2,    0x21d0,    0x21d4,
131cdf0e10cSrcweir         0xE081,    0xE082,    0x00b0,         0,
132cdf0e10cSrcweir              0,         0,    0x003a,    0x003b,
133cdf0e10cSrcweir         0x003c,    0x003d,    0x003e,    0x00bf,
134cdf0e10cSrcweir     // F040
135cdf0e10cSrcweir         0x2260,    0xE083,    0x2212,    0x2217,
136cdf0e10cSrcweir         0x00d7,    0x22c5,    0x00f7,    0x00b1,
137cdf0e10cSrcweir         0x2213,    0x2295,    0x2296,    0x2297,
138cdf0e10cSrcweir         0x2298,    0x2299,    0x222a,    0x2229,
139cdf0e10cSrcweir     // F050
140cdf0e10cSrcweir         0xE084,    0xE085,    0x2264,    0x2265,
141cdf0e10cSrcweir         0xE086,    0xE087,    0x226a,    0x226b,
142cdf0e10cSrcweir         0x007e,    0x2243,    0x2248,    0x225d,
143cdf0e10cSrcweir         0x2261,    0x221d,    0x2202,    0x2282,
144cdf0e10cSrcweir     // F060
145cdf0e10cSrcweir         0x2283,    0x2286,    0x2287,    0x2284,
146cdf0e10cSrcweir         0x2285,    0x2288,    0x2289,    0x2208,
147cdf0e10cSrcweir         0x2209,    0xE089,    0x2203,    0x220d,
148cdf0e10cSrcweir         0x2135,    0x2111,    0x211c,    0x2118,
149cdf0e10cSrcweir     // F070
150cdf0e10cSrcweir         0xE08a,    0x2221,    0x2222,    0x2223,
151cdf0e10cSrcweir         0x2225,    0x22a5,    0xE08b,    0x22ef,
152cdf0e10cSrcweir         0x22ee,    0x22f0,    0x22f1,    0x22b6,
153cdf0e10cSrcweir         0x22b7,    0xE08c,    0x2216,    0x00ac,
154cdf0e10cSrcweir     // F080
155cdf0e10cSrcweir         0x222b,    0x222c,    0x222d,    0x222e,
156cdf0e10cSrcweir         0x222f,    0x2230,    0x221a,    0xE08d,
157cdf0e10cSrcweir         0xE08e,    0xE08f,    0x2210,    0x220f,
158cdf0e10cSrcweir         0x2211,    0x2207,    0x2200,    0xE090,
159cdf0e10cSrcweir     // F090
160cdf0e10cSrcweir         0xE091,    0xE092,    0xE093,    0xE094,
161cdf0e10cSrcweir         0xE095,    0xE096,    0xE097,    0xE098,
162cdf0e10cSrcweir         0x02d9,    0x00a8,    0xE09b,    0x02da,
163cdf0e10cSrcweir         0x2227,    0x2228,    0x220b,    0x2205,
164cdf0e10cSrcweir     // F0A0
165cdf0e10cSrcweir         0x007b,    0x007d,    0xe09e,    0xe09f,
166cdf0e10cSrcweir         0x2329,    0x232a,    0x005b,    0x005d,
167cdf0e10cSrcweir         0xE0a0,    0x22be,    0xE0a1,    0x2259,
168cdf0e10cSrcweir         0x2254,    0x2255,    0x21b3,    0x2197,
169cdf0e10cSrcweir     // F0B0
170cdf0e10cSrcweir         0x2198,    0x2245,    0x301a,    0x301b,
171cdf0e10cSrcweir         0x2373,    0xE0a5,    0xE0a6,    0x22a4,
172cdf0e10cSrcweir         0x2112,    0x2130,    0x2131,         0,
173cdf0e10cSrcweir         0xE0a7,    0xE0a8,    0xE0a9,    0xE0aa,
174cdf0e10cSrcweir     // F0C0
175cdf0e10cSrcweir         0x2308,    0x230a,    0x2309,    0x230b,
176cdf0e10cSrcweir              0,    0xe0ab,    0xe0ac,    0xe0ad,
177cdf0e10cSrcweir         0xe0ae,    0xe0af,    0xe0b0,    0xe0b1,
178cdf0e10cSrcweir         0xe0b2,    0xe0b3,    0xe0b4,    0xe0b5,
179cdf0e10cSrcweir     // F0D0
180cdf0e10cSrcweir         0xe0b6,    0xe0b7,    0xe0b8,    0xe0b9,
181cdf0e10cSrcweir         0xe0ba,    0xe0bb,    0xe0bc,    0xe0bd,
182cdf0e10cSrcweir         0xe0be,    0xe0bf,    0xe0c0,    0xe0c1,
183cdf0e10cSrcweir         0xe0c2,    0xe0c3,    0xe0c4,    0xe0c5,
184cdf0e10cSrcweir     // F0E0
185cdf0e10cSrcweir         0xe0c6,    0xe0c7,    0xe0c8,    0xe0c9,
186cdf0e10cSrcweir         0xe0ca,    0xe0cb,    0xe0cc,    0xe0cd,
187cdf0e10cSrcweir         0xe0ce,    0xe0cf,    0xe0d0,    0xe0d1,
188cdf0e10cSrcweir         0x03f1,    0xe0d3,    0xe0d4,    0xe0d5,
189cdf0e10cSrcweir     // F0F0
190cdf0e10cSrcweir         0x2113,     0xe0d6,   0x2107,    0x2127,
191cdf0e10cSrcweir         0x210a,     0xe0d9,   0x210f,    0x019b,
192cdf0e10cSrcweir         0xe0db,     0xe0dc,   0xe0dd,    0x2115,
193cdf0e10cSrcweir         0x2124,     0x211a,   0x211d,    0x2102
194cdf0e10cSrcweir };
195cdf0e10cSrcweir 
196cdf0e10cSrcweir // -----------------------------------------------------------------------
197cdf0e10cSrcweir 
198cdf0e10cSrcweir static const sal_Unicode aWingDingsTab[224] =
199cdf0e10cSrcweir {
200cdf0e10cSrcweir     // F020
201cdf0e10cSrcweir         0x0020,    0xe400,    0xe401,    0xe402,
202cdf0e10cSrcweir         0xe403,    0xe404,    0xe405,    0xe406,
203cdf0e10cSrcweir         0xe407,    0xe408,    0xe409,    0xe40a,
204cdf0e10cSrcweir         0xe40b,    0xe40c,    0xe40d,    0xe40e,
205cdf0e10cSrcweir     // F030
206cdf0e10cSrcweir         0xe40f,    0xe410,    0xe411,    0xe412,
207cdf0e10cSrcweir         0xe413,    0xe414,    0xe415,    0xe416,
208cdf0e10cSrcweir         0xe417,    0xe418,    0xe419,    0xe41a,
209cdf0e10cSrcweir         0xe41b,    0xe41c,    0x2707,    0xe41d,
210cdf0e10cSrcweir     // F040
211cdf0e10cSrcweir         0xe41e,    0xe41f,    0xe420,    0xe421,
212cdf0e10cSrcweir         0x261c,    0xe423,    0x261d,    0x261f,
213cdf0e10cSrcweir         0x261f,    0xe424,    0xe425,    0xe426,
214cdf0e10cSrcweir         0xe427,    0xe428,    0xe429,    0xe42a,
215cdf0e10cSrcweir     // F050
216cdf0e10cSrcweir         0xe42b,    0xe42c,    0x263c,    0xe42d,
217cdf0e10cSrcweir         0xe42e,    0xe42f,    0xe430,    0xe431,
218cdf0e10cSrcweir         0xe432,    0xe433,    0x262a,    0x262f,
219cdf0e10cSrcweir         0x0950,    0xe434,    0x2648,    0x2649,
220cdf0e10cSrcweir     // F060
221cdf0e10cSrcweir         0x264a,    0x264b,    0x264c,    0x264d,
222cdf0e10cSrcweir         0x264e,    0x264f,    0x2650,    0x2651,
223cdf0e10cSrcweir         0x2652,    0x2653,    0xe435,    0xe436,
224cdf0e10cSrcweir         0xe437,    0xe438,    0xe439,    0xe43a,
225cdf0e10cSrcweir     // F070
226cdf0e10cSrcweir         0xe43b,    0xe43c,    0xe43d,    0xe43e,
227cdf0e10cSrcweir         0xe43f,    0xe440,    0xe441,    0xe442,
228cdf0e10cSrcweir         0xe443,    0x2353,    0x2318,    0xe444,
229cdf0e10cSrcweir         0xe445,    0xe446,    0xe447,         0,
230cdf0e10cSrcweir     // F080
231cdf0e10cSrcweir         0xe448,    0xe449,    0xe44a,    0xe44b,
232cdf0e10cSrcweir         0xe44c,    0xe44d,    0xe44e,    0xe44f,
233cdf0e10cSrcweir         0xe450,    0xe451,    0xe452,    0xe453,
234cdf0e10cSrcweir         0xe454,    0xe455,    0xe456,    0xe457,
235cdf0e10cSrcweir     // F090
236cdf0e10cSrcweir         0xe458,    0xe459,    0xe45a,    0xe45b,
237cdf0e10cSrcweir         0xe45c,    0xe45d,    0xe45e,    0xe45f,
238cdf0e10cSrcweir         0xe460,    0xe461,    0xe462,    0xe463,
239cdf0e10cSrcweir         0xe464,    0xe465,    0xe466,    0xe467,
240cdf0e10cSrcweir     // F0a0
241cdf0e10cSrcweir         0xe468,    0xe469,    0xe46a,    0xe46b,
242cdf0e10cSrcweir         0xe46c,    0xe46d,    0xe46e,    0xe46f,
243cdf0e10cSrcweir         0xe470,    0xe471,    0xe472,    0xe473,
244cdf0e10cSrcweir         0xe474,    0xe475,    0xe476,    0xe477,
245cdf0e10cSrcweir     // F0b0
246cdf0e10cSrcweir         0xe478,    0xe479,    0xe47a,    0xe47b,
247cdf0e10cSrcweir         0xe47c,    0xe47d,    0xe47e,    0xe47f,
248cdf0e10cSrcweir         0xe480,    0xe481,    0xe482,    0xe483,
249cdf0e10cSrcweir         0xe484,    0xe485,    0xe486,    0xe487,
250cdf0e10cSrcweir     // F0c0
251cdf0e10cSrcweir         0xe488,    0xe489,    0xe48a,    0xe48b,
252cdf0e10cSrcweir         0xe48c,    0xe48d,    0xe48e,    0xe48f,
253cdf0e10cSrcweir         0xe490,    0xe491,    0xe492,    0xe493,
254cdf0e10cSrcweir         0xe494,    0xe495,    0xe496,    0xe497,
255cdf0e10cSrcweir     // F0d0
256cdf0e10cSrcweir         0xe498,    0xe499,    0xe49a,    0xe49b,
257cdf0e10cSrcweir         0xe49c,    0x232b,    0x2326,    0xe49d,
258cdf0e10cSrcweir         0xe49e,    0xe49f,    0xe4a0,    0xe4a1,
259cdf0e10cSrcweir         0xe4a2,    0xe4a3,    0xe4a4,    0xe4a5,
260cdf0e10cSrcweir     // F0e0
261cdf0e10cSrcweir         0xe4a6,    0xe4a7,    0xe4a8,    0xe4a9,
262cdf0e10cSrcweir         0xe4aa,    0xe4ab,    0xe4ac,    0xe4ad,
263cdf0e10cSrcweir         0xe4ae,    0xe4af,    0xe4b0,    0xe4b1,
264cdf0e10cSrcweir         0xe4b2,    0xe4b3,    0xe4b4,    0xe4b5,
265cdf0e10cSrcweir     // F0f0
266cdf0e10cSrcweir         0xe4b6,    0xe4b7,    0xe4b8,    0xe4b9,
267cdf0e10cSrcweir         0xe4ba,    0xe4bb,    0xe4bc,    0xe4bd,
268cdf0e10cSrcweir         0xe4be,    0xe4bf,    0xe4c0,    0xe4c1,
269cdf0e10cSrcweir         0xe4c2,    0xe4c3,    0xe4c4,    0xe4c5
270cdf0e10cSrcweir };
271cdf0e10cSrcweir 
272cdf0e10cSrcweir // -----------------------------------------------------------------------
273cdf0e10cSrcweir 
274cdf0e10cSrcweir static const sal_Unicode aWingDings2Tab[224] =
275cdf0e10cSrcweir {
276cdf0e10cSrcweir     // F020
277cdf0e10cSrcweir         0x0020,    0xe500,    0xe501,    0xe502,
278cdf0e10cSrcweir         0xe503,    0xe504,    0xe505,    0xe506,
279cdf0e10cSrcweir         0xe507,    0xe508,    0xe509,    0xe50a,
280cdf0e10cSrcweir         0xe50b,    0xe50c,    0xe50d,    0xe50e,
281cdf0e10cSrcweir     // F030
282cdf0e10cSrcweir         0xe50f,    0xe510,    0xe511,    0xe512,
283cdf0e10cSrcweir         0xe513,    0xe514,    0xe515,    0xe516,
284cdf0e10cSrcweir         0xe517,    0xe518,    0xe519,    0xe51a,
285cdf0e10cSrcweir         0xe51b,    0xe51c,    0xe51d,    0xe51e,
286cdf0e10cSrcweir     // F040
287cdf0e10cSrcweir         0xe51f,    0xe520,    0xe521,    0xe522,
288cdf0e10cSrcweir         0xe523,    0xe524,    0xe525,    0xe526,
289cdf0e10cSrcweir         0xe527,    0xe528,    0xe529,    0xe52a,
290cdf0e10cSrcweir         0xe52b,    0xe52c,    0xe52d,    0xe52e,
291cdf0e10cSrcweir     // F050
292cdf0e10cSrcweir         0xe52f,    0xe530,    0xe531,    0xe532,
293cdf0e10cSrcweir         0xe533,    0xe534,    0xe535,    0xe536,
294cdf0e10cSrcweir         0xe537,    0x203D,    0x203D,    0x203D,
295cdf0e10cSrcweir         0xe53b,    0xe53c,    0xe53d,    0xe53e,
296cdf0e10cSrcweir     // F060
297cdf0e10cSrcweir         0xe53f,    0xe540,    0xe541,    0xe542,
298cdf0e10cSrcweir         0xe543,    0xe544,    0xe545,    0xe546,
299cdf0e10cSrcweir         0xe547,    0x24EA,    0x2460,    0x2461,
300cdf0e10cSrcweir         0x2462,    0x2463,    0x2464,    0x2465,
301cdf0e10cSrcweir     // F070
302cdf0e10cSrcweir         0x2466,    0x2467,    0x2468,    0x2469,
303cdf0e10cSrcweir         0xE453,    0x278A,    0x278B,    0x278C,
304cdf0e10cSrcweir         0x278D,    0x278E,    0x278F,    0x2790,
305cdf0e10cSrcweir         0x2791,    0x2792,    0x2793,         0,
306cdf0e10cSrcweir     // F080
307cdf0e10cSrcweir         0x2609,    0x25cb,    0x263d,    0x263e,
308cdf0e10cSrcweir         0xe55d,    0xe55e,    0xe55f,    0xe560,
309cdf0e10cSrcweir         0xe561,    0xe562,    0xe563,    0xe564,
310cdf0e10cSrcweir         0xe565,    0xe566,    0xe567,    0xe568,
311cdf0e10cSrcweir     // F090
312cdf0e10cSrcweir         0xe569,    0xe56a,    0xe56b,    0xe56c,
313cdf0e10cSrcweir         0xe56d,    0xe56e,    0xe56f,    0xe570,
314cdf0e10cSrcweir         0xe571,    0xe572,    0xe573,    0xe574,
315cdf0e10cSrcweir         0xe575,    0xe576,    0xe577,    0xe578,
316cdf0e10cSrcweir     // F0a0
317cdf0e10cSrcweir         0xe579,    0xe57a,    0xe57b,    0xe57c,
318cdf0e10cSrcweir         0xe57d,    0xe57e,    0xe57f,    0xe580,
319cdf0e10cSrcweir         0xe581,    0xe582,    0xe583,    0xe584,
320cdf0e10cSrcweir         0xe585,    0xe586,    0xe587,    0xe588,
321cdf0e10cSrcweir     // F0b0
322cdf0e10cSrcweir         0xe589,    0xe58a,    0xe58b,    0xe58c,
323cdf0e10cSrcweir         0xe58d,    0xe58e,    0xe58f,    0xe590,
324cdf0e10cSrcweir         0xe591,    0xe592,    0xe593,    0xe594,
325cdf0e10cSrcweir         0xe595,    0xe596,    0xe597,    0xe598,
326cdf0e10cSrcweir     // F0c0
327cdf0e10cSrcweir         0xe599,    0xe59a,    0xe59b,    0xe59c,
328cdf0e10cSrcweir         0xe59d,    0xe59e,    0xe59f,    0xe5a0,
329cdf0e10cSrcweir         0xe5a1,    0xe5a2,    0xe5a3,    0xe5a4,
330cdf0e10cSrcweir         0xe5a5,    0xe5a6,    0xe5a7,    0xe5a8,
331cdf0e10cSrcweir     // F0d0
332cdf0e10cSrcweir         0xe5a9,    0xe5aa,    0xe5ab,    0xe5ac,
333cdf0e10cSrcweir         0xe5ad,    0xe5ae,    0xe5af,    0xe5b0,
334cdf0e10cSrcweir         0xe5b1,    0xe5b2,    0xe5b3,    0xe5b4,
335cdf0e10cSrcweir         0xe5b5,    0xe5b6,    0xe5b7,    0xe5b8,
336cdf0e10cSrcweir     // F0e0
337cdf0e10cSrcweir         0xe5b9,    0xe5ba,    0xe5bb,    0xe5bc,
338cdf0e10cSrcweir         0xe5bd,    0xe5be,    0xe5bf,    0xe5c0,
339cdf0e10cSrcweir         0xe5c1,    0xe5c2,    0xe5c3,    0xe5c4,
340cdf0e10cSrcweir         0xe5c5,    0xe5c6,    0xe5c7,    0xe5c8,
341cdf0e10cSrcweir     // F0f0
342cdf0e10cSrcweir         0xe5c9,    0,    0xe5cb,    0xe5cc,
343cdf0e10cSrcweir         0xe5cd,    0xe5ce,    0xe5cf,    0xe5d0,
344cdf0e10cSrcweir         0x203b,    0x2042,         0,         0,
345cdf0e10cSrcweir              0,         0,         0,         0
346cdf0e10cSrcweir };
347cdf0e10cSrcweir 
348cdf0e10cSrcweir // -----------------------------------------------------------------------
349cdf0e10cSrcweir 
350cdf0e10cSrcweir static const sal_Unicode aWingDings3Tab[224] =
351cdf0e10cSrcweir {
352cdf0e10cSrcweir     // F020
353cdf0e10cSrcweir         0x0020,    0xe600,    0xe601,    0xe602,
354cdf0e10cSrcweir         0xe603,    0x2196,    0xe604,    0x2199,
355cdf0e10cSrcweir         0xe605,    0xe606,    0xe607,    0xe608,
356cdf0e10cSrcweir         0xe609,    0xe60a,    0xe60b,    0x21de,
357cdf0e10cSrcweir     // F030
358cdf0e10cSrcweir         0x21df,    0xe60c,    0xe60d,    0xe60e,
359cdf0e10cSrcweir         0x21e2,    0x21e1,    0x21e3,    0x21af,
360cdf0e10cSrcweir         0x21b5,    0xe60f,    0xe610,    0xe611,
361cdf0e10cSrcweir         0xe612,    0xe613,    0xe614,    0xe615,
362cdf0e10cSrcweir     // F040
363cdf0e10cSrcweir         0xe616,    0xe617,    0xe618,    0xe619,
364cdf0e10cSrcweir         0x21c4,    0x21c5,    0xe61a,    0xe61b,
365cdf0e10cSrcweir         0x21c7,    0x21c9,    0x21c8,    0x21ca,
366cdf0e10cSrcweir         0x21b6,    0x21b7,    0xe61c,    0xe61d,
367cdf0e10cSrcweir     // F050
368cdf0e10cSrcweir         0x21bb,    0x21ba,    0xe61e,    0x2324,
369cdf0e10cSrcweir         0x2303,    0x2325,    0x2334,    0xe61f,
370cdf0e10cSrcweir         0x21ea,    0xe620,    0xe621,    0xe622,
371cdf0e10cSrcweir         0xe623,    0xe624,    0xe625,    0xe626,
372cdf0e10cSrcweir     // F060
373cdf0e10cSrcweir         0xe627,    0xe628,    0xe629,    0xe62a,
374cdf0e10cSrcweir         0xe62b,    0xe62c,    0xe62d,    0xe62e,
375cdf0e10cSrcweir         0xe62f,    0xe630,    0xe631,    0xe632,
376cdf0e10cSrcweir         0xe633,    0xe634,    0xe635,    0xe636,
377cdf0e10cSrcweir     // F070
378cdf0e10cSrcweir         0xe637,    0xe638,    0x25b3,    0x25bd,
379cdf0e10cSrcweir         0x25c0,    0x25b6,    0x25c1,    0x25b7,
380cdf0e10cSrcweir         0x25e3,    0xe639,    0x25e4,    0x25e5,
381cdf0e10cSrcweir         0x25c2,    0x25b8,    0xe63a,         0,
382cdf0e10cSrcweir     // F080
383cdf0e10cSrcweir         0xe63b,    0xe63c,    0xe63d,    0xe63e,
384cdf0e10cSrcweir         0xe63f,    0xe640,    0xe641,    0xe642,
385cdf0e10cSrcweir         0xe643,    0xe644,    0xe645,    0xe646,
386cdf0e10cSrcweir         0xe647,    0xe648,    0xe649,    0xe64a,
387cdf0e10cSrcweir     // F090
388cdf0e10cSrcweir         0xe64b,    0xe64c,    0xe64d,    0xe64e,
389cdf0e10cSrcweir         0xe64f,    0xe650,    0xe651,    0xe652,
390cdf0e10cSrcweir         0xe653,    0xe654,    0xe655,    0xe656,
391cdf0e10cSrcweir         0xe657,    0xe658,    0xe659,    0xe65a,
392cdf0e10cSrcweir     // F0a0
393cdf0e10cSrcweir         0xe65b,    0xe65c,    0xe65d,    0xe65e,
394cdf0e10cSrcweir         0xe65f,    0xe660,    0xe661,    0xe662,
395cdf0e10cSrcweir         0xe663,    0xe664,    0xe665,    0xe666,
396cdf0e10cSrcweir         0xe667,    0xe668,    0xe669,    0xe66a,
397cdf0e10cSrcweir     // F0b0
398cdf0e10cSrcweir         0xe66b,    0xe66c,    0xe66d,    0xe66e,
399cdf0e10cSrcweir         0xe66f,    0xe670,    0xe671,    0xe672,
400cdf0e10cSrcweir         0xe673,    0xe674,    0xe675,    0xe676,
401cdf0e10cSrcweir         0xe677,    0xe678,    0xe679,    0xe67a,
402cdf0e10cSrcweir     // F0c0
403cdf0e10cSrcweir         0xe67b,    0xe67c,    0xe67d,    0xe67e,
404cdf0e10cSrcweir         0xe67f,    0xe680,    0xe681,    0xe682,
405cdf0e10cSrcweir         0xe683,    0xe684,    0xe685,    0xe686,
406cdf0e10cSrcweir         0xe687,    0xe688,    0xe689,    0xe68a,
407cdf0e10cSrcweir     // F0d0
408cdf0e10cSrcweir         0xe68b,    0xe68c,    0xe68d,    0xe68e,
409cdf0e10cSrcweir         0xe68f,    0xe690,    0xe691,    0xe692,
410cdf0e10cSrcweir         0xe693,    0xe694,    0xe695,    0xe696,
411cdf0e10cSrcweir         0xe697,    0xe698,    0xe699,    0xe69a,
412cdf0e10cSrcweir     // F0e0
413cdf0e10cSrcweir         0xe69b,    0xe69c,    0xe69d,    0xe69e,
414cdf0e10cSrcweir         0xe69f,    0xe6a0,    0xe6a1,    0xe6a2,
415cdf0e10cSrcweir         0xe6a3,    0xe6a4,    0xe6a5,    0xe6a6,
416cdf0e10cSrcweir         0xe6a7,    0xe6a8,    0xe6a9,    0xe6aa,
417cdf0e10cSrcweir     // F0f0
418cdf0e10cSrcweir         0xe6ab,         0,         0,         0,
419cdf0e10cSrcweir              0,         0,         0,         0,
420cdf0e10cSrcweir              0,         0,         0,         0,
421cdf0e10cSrcweir              0,         0,         0,         0
422cdf0e10cSrcweir };
423cdf0e10cSrcweir 
424cdf0e10cSrcweir // -----------------------------------------------------------------------
425cdf0e10cSrcweir 
426cdf0e10cSrcweir static const sal_Unicode aWebDingsTab[224] =
427cdf0e10cSrcweir {
428cdf0e10cSrcweir     // F020
429cdf0e10cSrcweir         0x0020,    0xe300,    0xe301,    0xe302,
430cdf0e10cSrcweir         0xe303,    0xe304,    0xe305,    0xe306,
431cdf0e10cSrcweir         0xe307,    0xe308,    0xe309,    0xe30a,
432cdf0e10cSrcweir         0xe30b,    0xe30c,    0xe30d,    0xe30e,
433cdf0e10cSrcweir     // F030
434cdf0e10cSrcweir         0xe30f,    0xe310,    0xe311,    0xe312,
435cdf0e10cSrcweir         0xe313,    0xe314,    0xe315,    0xe316,
436cdf0e10cSrcweir         0xe317,    0xe318,    0xe319,    0xe31a,
437cdf0e10cSrcweir         0xe31b,    0xe31c,    0xe31d,    0xe31e,
438cdf0e10cSrcweir     // F040
439cdf0e10cSrcweir         0xe31f,    0xe320,    0xe321,    0xe322,
440cdf0e10cSrcweir         0xe323,    0xe324,    0xe325,    0xe326,
441cdf0e10cSrcweir         0xe327,    0xe328,    0xe329,    0xe32a,
442cdf0e10cSrcweir         0xe32b,    0xe32c,    0xe32d,    0xe32e,
443cdf0e10cSrcweir     // F050
444cdf0e10cSrcweir         0xe32f,    0xe330,    0xe331,    0xe332,
445cdf0e10cSrcweir         0xe333,    0xe334,    0xe335,    0xe336,
446cdf0e10cSrcweir         0xe337,    0xe338,    0xe339,    0xe33a,
447cdf0e10cSrcweir         0xe33b,    0xe33c,    0xe33d,    0xe33e,
448cdf0e10cSrcweir     // F060
449cdf0e10cSrcweir         0xe33f,    0xe340,    0xe341,    0xe342,
450cdf0e10cSrcweir         0xe343,    0xe344,    0xe345,    0xe346,
451cdf0e10cSrcweir         0xe347,    0xe348,    0xe349,    0xe34a,
452cdf0e10cSrcweir         0xe34b,    0xe34c,    0xe34d,    0xe34e,
453cdf0e10cSrcweir     // F070
454cdf0e10cSrcweir         0xe34f,    0xe350,    0xe351,    0xe352,
455cdf0e10cSrcweir         0xe353,    0xe354,    0xe355,    0xe356,
456cdf0e10cSrcweir         0xe357,    0xe358,    0xe359,    0xe35a,
457cdf0e10cSrcweir         0xe35b,    0xe35c,    0xe35d,         0,
458cdf0e10cSrcweir     // F080
459cdf0e10cSrcweir         0xe35e,    0xe35f,    0xe360,    0xe361,
460cdf0e10cSrcweir         0xe362,    0xe363,    0xe364,    0xe365,
461cdf0e10cSrcweir         0xe366,    0xe367,    0xe368,    0xe369,
462cdf0e10cSrcweir         0xe36a,    0xe36b,    0xe36c,    0xe36d,
463cdf0e10cSrcweir     // F090
464cdf0e10cSrcweir         0xe36e,    0xe36f,    0xe370,    0xe371,
465cdf0e10cSrcweir         0xe372,    0xe373,    0xe374,    0xe375,
466cdf0e10cSrcweir         0xe376,    0xe377,    0xe378,    0xe379,
467cdf0e10cSrcweir         0xe37a,    0xe37b,    0xe37c,    0xe37d,
468cdf0e10cSrcweir     // F0a0
469cdf0e10cSrcweir         0xe37e,    0xe37f,    0xe380,    0xe381,
470cdf0e10cSrcweir         0xe382,    0xe383,    0xe384,    0xe385,
471cdf0e10cSrcweir         0xe386,    0xe387,    0xe388,    0xe389,
472cdf0e10cSrcweir         0xe38a,    0xe38b,    0xe38c,    0xe38d,
473cdf0e10cSrcweir     // F0b0
474cdf0e10cSrcweir         0xe38e,    0xe38f,    0xe390,    0xe391,
475cdf0e10cSrcweir         0xe392,    0xe393,    0xe394,    0xe395,
476cdf0e10cSrcweir         0xe396,    0xe397,    0xe398,    0xe399,
477cdf0e10cSrcweir         0xe39a,    0xe39b,    0xe39c,    0xe39d,
478cdf0e10cSrcweir     // F0c0
479cdf0e10cSrcweir         0xe39e,    0xe39f,    0xe3a0,    0xe3a1,
480cdf0e10cSrcweir         0xe3a2,    0xe3a3,    0xe3a4,    0xe3a5,
481cdf0e10cSrcweir         0xe3a6,    0xe3a7,    0xe3a8,    0xe3a9,
482cdf0e10cSrcweir         0xe3aa,    0xe3ab,    0xe3ac,    0xe3ad,
483cdf0e10cSrcweir     // F0d0
484cdf0e10cSrcweir         0xe3ae,    0xe3af,    0xe3b0,    0xe3b1,
485cdf0e10cSrcweir         0xe3b2,    0xe3b3,    0xe3b4,    0xe3b5,
486cdf0e10cSrcweir         0xe3b6,    0xe3b7,    0xe3b8,    0xe3b9,
487cdf0e10cSrcweir         0xe3ba,    0xe3bb,    0xe3bc,    0xe3bd,
488cdf0e10cSrcweir     // F0e0
489cdf0e10cSrcweir         0xe3be,    0xe3bf,    0xe3c0,    0xe3c1,
490cdf0e10cSrcweir         0xe3c2,    0xe3c3,    0xe3c4,    0xe3c5,
491cdf0e10cSrcweir         0xe3c6,    0xe3c7,    0xe3c8,    0xe3c9,
492cdf0e10cSrcweir         0xe3ca,    0xe3cb,    0xe3cd,    0xe3ce,
493cdf0e10cSrcweir     // F0f0
494cdf0e10cSrcweir         0xe3cf,    0xe3d0,    0xe3d1,    0xe3d2,
495cdf0e10cSrcweir         0xe3d3,    0xe3d4,    0xe3d5,    0xe3d6,
496cdf0e10cSrcweir         0xe3d7,    0xe3d8,    0xe3d9,    0xe3da,
497cdf0e10cSrcweir         0xe3db,    0xe3dc,    0xe3dd,    0xe3de
498cdf0e10cSrcweir };
499cdf0e10cSrcweir 
500cdf0e10cSrcweir // -----------------------------------------------------------------------
501cdf0e10cSrcweir 
502cdf0e10cSrcweir static const sal_Unicode aAdobeSymbolTab[224] =
503cdf0e10cSrcweir {
504cdf0e10cSrcweir //TODO:
505cdf0e10cSrcweir     // F020
506cdf0e10cSrcweir         0x0020,    0xe100,    0xe101,    0xe102,
507cdf0e10cSrcweir         0xe103,    0xe104,    0xe16a,    0xe105,
508cdf0e10cSrcweir         0xe106,    0xe107,    0xe108,    0xe109,
509cdf0e10cSrcweir         0xe10a,    0xe10b,    0xe10c,    0xe10d,
510cdf0e10cSrcweir     // F030
511cdf0e10cSrcweir         0x0030,    0x0031,    0x0032,    0x0033,
512cdf0e10cSrcweir         0x0034,    0x0035,    0x0036,    0x0037,
513cdf0e10cSrcweir         0x0038,    0x0039,    0xe10e,    0xe10f,
514cdf0e10cSrcweir         0xe110,    0xe111,    0xe112,    0x003f,
515cdf0e10cSrcweir     // F040
516cdf0e10cSrcweir         0xe113,    0x0391,    0x0392,    0x03a7,
517cdf0e10cSrcweir         0x0394,    0x0395,    0x03a6,    0x0393,
518cdf0e10cSrcweir         0x0397,    0x0399,    0x03d1,    0x039a,
519cdf0e10cSrcweir         0x039b,    0x039c,    0x039d,    0x039f,
520cdf0e10cSrcweir     // F050
521cdf0e10cSrcweir         0x03a0,    0x0398,    0x03a1,    0x03a3,
522cdf0e10cSrcweir         0x03a4,    0x03a5,    0x03c2,    0x03a9,
523cdf0e10cSrcweir         0x039e,    0x03a8,    0x0396,    0xe114,
524cdf0e10cSrcweir         0x2234,    0xe115,    0xe116,    0x005f,
525cdf0e10cSrcweir     // F060
526cdf0e10cSrcweir         0x00af,    0x03b1,    0x03b2,    0x03c7,
527cdf0e10cSrcweir         0x03b4,    0x03b5,    0x03d5,    0x03b3,
528cdf0e10cSrcweir         0x03b7,    0x03b9,    0x03c6,    0x03ba,
529cdf0e10cSrcweir         0x03bb,    0x03bc,    0x03bd,    0x03bf,
530cdf0e10cSrcweir     // F070
531cdf0e10cSrcweir         0x03c0,    0x03b8,    0x03c1,    0x03c3,
532cdf0e10cSrcweir         0x03c4,    0x03c5,    0x03d6,    0x03c9,
533cdf0e10cSrcweir         0x03be,    0x03c8,    0x03b6,    0xe117,
534cdf0e10cSrcweir         0x007c,    0xe118,    0xe119,         0,
535cdf0e10cSrcweir     // F080
536cdf0e10cSrcweir              0,         0,         0,         0,
537cdf0e10cSrcweir              0,         0,         0,         0,
538cdf0e10cSrcweir              0,         0,         0,         0,
539cdf0e10cSrcweir              0,         0,         0,         0,
540cdf0e10cSrcweir     // F090
541cdf0e10cSrcweir              0,         0,         0,         0,
542cdf0e10cSrcweir              0,         0,         0,         0,
543cdf0e10cSrcweir              0,         0,         0,         0,
544cdf0e10cSrcweir              0,         0,         0,         0,
545cdf0e10cSrcweir     // F0a0
546cdf0e10cSrcweir         0xe11a,    0x03d2,    0x0384,    0xe11b,
547cdf0e10cSrcweir         0x2215,    0xe11c,    0xe11d,    0xe11e,
548cdf0e10cSrcweir         0x2666,    0xe11f,    0xe120,    0xe121,
549cdf0e10cSrcweir         0xe122,    0xe123,    0xe124,    0xe125,
550cdf0e10cSrcweir     // F0b0
551cdf0e10cSrcweir         0xe126,    0xe127,    0x2033,    0xe128,
552cdf0e10cSrcweir         0xe129,    0xe12a,    0xe12b,    0xe12c,
553cdf0e10cSrcweir         0xe12d,    0xe12e,    0xe12f,    0xe130,
554cdf0e10cSrcweir         0xe131,    0x2502,    0x2500,    0x21b2,
555cdf0e10cSrcweir     // F0c0
556cdf0e10cSrcweir         0xe132,    0xe133,    0xe134,    0xe135,
557cdf0e10cSrcweir         0xe136,    0xe137,    0xe138,    0xe139,
558cdf0e10cSrcweir         0xe13a,    0xe13b,    0xe13c,    0xe13d,
559cdf0e10cSrcweir         0xe13e,    0xe13f,    0xe140,    0xe141,
560cdf0e10cSrcweir     // F0d0
561cdf0e10cSrcweir         0x2220,    0xe142,    0x00ae,    0x00a9,
562cdf0e10cSrcweir         0xe143,    0xe144,    0xe145,    0xe146,
563cdf0e10cSrcweir         0xe147,    0xe148,    0xe149,    0xe14a,
564cdf0e10cSrcweir         0xe14b,    0x21d1,    0xe14c,    0x21d3,
565cdf0e10cSrcweir     // F0e0
566cdf0e10cSrcweir         0x25ca,    0xe14d,    0xe14e,    0xe14f,
567cdf0e10cSrcweir         0xe150,    0xe151,    0xe152,    0xe153,
568cdf0e10cSrcweir         0xe154,    0xe155,    0xe156,    0xe157,
569cdf0e10cSrcweir         0xe158,    0xe159,    0xe15a,    0xe15b,
570cdf0e10cSrcweir     // F0f0
571cdf0e10cSrcweir              0,    0xe15c,    0xe15d,    0xe15e,
572cdf0e10cSrcweir         0xe15f,    0xe160,    0xe161,    0xe162,
573cdf0e10cSrcweir         0xe163,    0xe164,    0xe165,    0xe166,
574cdf0e10cSrcweir         0xe167,    0xe168,    0xe169,         0,
575cdf0e10cSrcweir };
576cdf0e10cSrcweir 
577cdf0e10cSrcweir // -----------------------------------------------------------------------
578cdf0e10cSrcweir 
579cdf0e10cSrcweir static const sal_Unicode aMonotypeSortsTab[224] =
580cdf0e10cSrcweir {
581cdf0e10cSrcweir     // F020
582cdf0e10cSrcweir         0x0020,    0x2701,    0xe200,    0x2703,
583cdf0e10cSrcweir         0x2704,    0xe201,    0x2706,    0xe202,
584cdf0e10cSrcweir         0xe203,    0xe203,    0xe204,    0xe205,
585cdf0e10cSrcweir         0x270c,    0xe206,    0xe207,    0xe208,
586cdf0e10cSrcweir     // F030
587cdf0e10cSrcweir         0x2710,    0x2711,    0x2712,    0xe209,
588cdf0e10cSrcweir         0xe20a,    0x2715,    0x2716,    0xe20b,
589cdf0e10cSrcweir         0xe20c,    0xe20d,    0xe20e,    0xe20f,
590cdf0e10cSrcweir         0xe210,    0x271d,    0x271e,    0x271f,
591cdf0e10cSrcweir     // F040
592cdf0e10cSrcweir         0x2720,    0xe211,    0xe212,    0xe213,
593cdf0e10cSrcweir         0xe214,    0xe215,    0x2726,    0x2727,
594cdf0e10cSrcweir         0x2605,    0x2729,    0x272a,    0xe216,
595cdf0e10cSrcweir         0xe217,    0xe218,    0xe219,    0xe21a,
596cdf0e10cSrcweir     // F050
597cdf0e10cSrcweir         0xe21b,    0xe21c,    0x2732,    0xe21d,
598cdf0e10cSrcweir         0xe21e,    0xe21f,    0xe220,    0xe221,
599cdf0e10cSrcweir         0xe222,    0xe223,    0x273a,    0x273b,
600cdf0e10cSrcweir         0x273c,    0x273d,    0x273e,    0xe224,
601cdf0e10cSrcweir     // F060
602cdf0e10cSrcweir         0x2740,    0x2741,    0x2742,    0x2743,
603cdf0e10cSrcweir         0xe225,    0x2745,    0x2746,    0x2747,
604cdf0e10cSrcweir         0x2748,    0x2749,    0x274a,    0x274b,
605cdf0e10cSrcweir         0xe226,    0xe227,    0xe228,    0xe229,
606cdf0e10cSrcweir     // F070
607cdf0e10cSrcweir         0xe22a,    0xe22b,    0xe22c,    0x25b2,
608cdf0e10cSrcweir         0x25bc,    0xe22d,    0xe22e,    0xe22f,
609cdf0e10cSrcweir         0x2758,    0xe230,    0x275a,    0x275b,
610cdf0e10cSrcweir         0x275c,    0x275d,    0x275e,         0,
611cdf0e10cSrcweir     // F080
612cdf0e10cSrcweir         0xe231,    0xe232,    0xe233,    0xe234,
613cdf0e10cSrcweir         0xe235,    0xe236,    0xe237,    0xe238,
614cdf0e10cSrcweir         0xe239,    0xe23a,    0xe23b,    0xe23c,
615cdf0e10cSrcweir         0xe23d,    0xe23e,         0,         0,
616cdf0e10cSrcweir     // F090
617cdf0e10cSrcweir              0,         0,         0,         0,
618cdf0e10cSrcweir              0,         0,         0,         0,
619cdf0e10cSrcweir              0,         0,         0,         0,
620cdf0e10cSrcweir              0,         0,         0,         0,
621cdf0e10cSrcweir     // F0a0
622cdf0e10cSrcweir              0,    0xe23f,    0xe240,    0x2763,
623cdf0e10cSrcweir         0x2764,    0x2765,    0x2766,    0x2767,
624cdf0e10cSrcweir         0xe241,    0xe242,    0xe243,    0xe244,
625cdf0e10cSrcweir         0x2460,    0x2461,    0x2462,    0x2463,
626cdf0e10cSrcweir     // F0b0
627cdf0e10cSrcweir         0x2464,    0x2465,    0x2466,    0x2467,
628cdf0e10cSrcweir         0x2468,    0x2469,    0x2776,    0x2777,
629cdf0e10cSrcweir         0x2778,    0x2779,    0x277a,    0x277b,
630cdf0e10cSrcweir         0x277c,    0x277d,    0x277e,    0x277f,
631cdf0e10cSrcweir     // F0c0
632cdf0e10cSrcweir         0xe245,    0xe246,    0xe247,    0xe248,
633cdf0e10cSrcweir         0xe249,    0xe24a,    0xe24b,    0xe24c,
634cdf0e10cSrcweir         0xe24d,    0xe24e,    0xe24f,    0xe250,
635cdf0e10cSrcweir         0xe251,    0xe252,    0xe253,    0xe254,
636cdf0e10cSrcweir     // F0d0
637cdf0e10cSrcweir         0xe255,    0xe256,    0xe257,    0xe258,
638cdf0e10cSrcweir         0xe259,    0xe25a,    0xe25b,    0xe25c,
639cdf0e10cSrcweir         0xe25d,    0x2799,    0xe25e,    0x279b,
640cdf0e10cSrcweir         0x279c,    0x279d,    0x279e,    0x279f,
641cdf0e10cSrcweir     // F0e0
642cdf0e10cSrcweir         0x27a0,    0x27a1,    0xe25f,    0x27a3,
643cdf0e10cSrcweir         0x27a4,    0x27a5,    0x27a6,    0x27a7,
644cdf0e10cSrcweir         0x27a8,    0x27a9,    0x27aa,    0x27ab,
645cdf0e10cSrcweir         0x27ac,    0x27ad,    0x27ae,    0x27af,
646cdf0e10cSrcweir     // F0f0
647cdf0e10cSrcweir              0,    0x27b1,    0xe260,    0x27b3,
648cdf0e10cSrcweir         0x27b4,    0x27b5,    0x27b6,    0x27b7,
649cdf0e10cSrcweir         0xe261,    0x27b9,    0x27ba,    0x27bb,
650cdf0e10cSrcweir         0x27bc,    0x27bd,    0x27be,         0,
651cdf0e10cSrcweir };
652cdf0e10cSrcweir 
653cdf0e10cSrcweir // -----------------------------------------------------------------------
654cdf0e10cSrcweir 
655cdf0e10cSrcweir /*
656cdf0e10cSrcweir static const sal_Unicode aMonotypeSorts2Tab[224] =
657cdf0e10cSrcweir {
658cdf0e10cSrcweir //TODO:
659cdf0e10cSrcweir     // F020
660cdf0e10cSrcweir              0,         0,         0,         0,
661cdf0e10cSrcweir              0,         0,         0,         0,
662cdf0e10cSrcweir              0,         0,         0,         0,
663cdf0e10cSrcweir              0,         0,         0,         0,
664cdf0e10cSrcweir     // F030
665cdf0e10cSrcweir              0,         0,         0,         0,
666cdf0e10cSrcweir              0,         0,         0,         0,
667cdf0e10cSrcweir              0,         0,         0,         0,
668cdf0e10cSrcweir              0,         0,         0,         0,
669cdf0e10cSrcweir     // F040
670cdf0e10cSrcweir              0,         0,         0,         0,
671cdf0e10cSrcweir              0,         0,         0,         0,
672cdf0e10cSrcweir              0,         0,         0,         0,
673cdf0e10cSrcweir              0,         0,         0,         0,
674cdf0e10cSrcweir     // F050
675cdf0e10cSrcweir              0,         0,         0,         0,
676cdf0e10cSrcweir              0,         0,         0,         0,
677cdf0e10cSrcweir              0,         0,         0,         0,
678cdf0e10cSrcweir              0,         0,         0,         0,
679cdf0e10cSrcweir     // F060
680cdf0e10cSrcweir              0,         0,         0,         0,
681cdf0e10cSrcweir              0,         0,         0,         0,
682cdf0e10cSrcweir              0,         0,         0,         0,
683cdf0e10cSrcweir              0,         0,         0,         0,
684cdf0e10cSrcweir     // F070
685cdf0e10cSrcweir              0,         0,         0,         0,
686cdf0e10cSrcweir              0,         0,         0,         0,
687cdf0e10cSrcweir              0,         0,         0,         0,
688cdf0e10cSrcweir              0,         0,         0,         0,
689cdf0e10cSrcweir     // F080
690cdf0e10cSrcweir              0,         0,         0,         0,
691cdf0e10cSrcweir              0,         0,         0,         0,
692cdf0e10cSrcweir              0,         0,         0,         0,
693cdf0e10cSrcweir              0,         0,         0,         0,
694cdf0e10cSrcweir     // F090
695cdf0e10cSrcweir              0,         0,         0,         0,
696cdf0e10cSrcweir              0,         0,         0,         0,
697cdf0e10cSrcweir              0,         0,         0,         0,
698cdf0e10cSrcweir              0,         0,         0,         0,
699cdf0e10cSrcweir     // F0a0
700cdf0e10cSrcweir              0,         0,         0,         0,
701cdf0e10cSrcweir              0,         0,         0,         0,
702cdf0e10cSrcweir              0,         0,         0,         0,
703cdf0e10cSrcweir              0,         0,         0,         0,
704cdf0e10cSrcweir     // F0b0
705cdf0e10cSrcweir              0,         0,         0,         0,
706cdf0e10cSrcweir              0,         0,         0,         0,
707cdf0e10cSrcweir              0,         0,         0,         0,
708cdf0e10cSrcweir              0,         0,         0,         0,
709cdf0e10cSrcweir     // F0c0
710cdf0e10cSrcweir              0,         0,         0,         0,
711cdf0e10cSrcweir              0,         0,         0,         0,
712cdf0e10cSrcweir              0,         0,         0,         0,
713cdf0e10cSrcweir              0,         0,         0,         0,
714cdf0e10cSrcweir     // F0d0
715cdf0e10cSrcweir              0,         0,         0,         0,
716cdf0e10cSrcweir              0,         0,         0,         0,
717cdf0e10cSrcweir              0,         0,         0,         0,
718cdf0e10cSrcweir              0,         0,         0,         0,
719cdf0e10cSrcweir     // F0e0
720cdf0e10cSrcweir              0,         0,         0,         0,
721cdf0e10cSrcweir              0,         0,         0,         0,
722cdf0e10cSrcweir              0,         0,         0,         0,
723cdf0e10cSrcweir              0,         0,         0,         0,
724cdf0e10cSrcweir     // F0f0
725cdf0e10cSrcweir              0,         0,         0,         0,
726cdf0e10cSrcweir              0,         0,         0,         0,
727cdf0e10cSrcweir              0,         0,         0,         0,
728cdf0e10cSrcweir              0,         0,         0,         0,
729cdf0e10cSrcweir };
730cdf0e10cSrcweir */
731cdf0e10cSrcweir 
732cdf0e10cSrcweir static const sal_Unicode aMTExtraTab[224] =
733cdf0e10cSrcweir {
734cdf0e10cSrcweir     // F020
735cdf0e10cSrcweir         0x0020,         0,         0,    0xE095,
736cdf0e10cSrcweir         0xE091,    0xE096,    0x02D9,         0,
737cdf0e10cSrcweir         0xE093,         0,         0,         0,
738cdf0e10cSrcweir              0,         0,         0,         0,
739cdf0e10cSrcweir     // F030
740cdf0e10cSrcweir              0,         0,         0,         0,
741cdf0e10cSrcweir              0,         0,         0,         0,
742cdf0e10cSrcweir              0,         0,         0,         0,
743cdf0e10cSrcweir         0x25C1,         0,    0x25B7,         0,
744cdf0e10cSrcweir     // F040
745cdf0e10cSrcweir              0,         0,    0x2210,    0x019b,
746cdf0e10cSrcweir              0,         0,         0,         0,
747cdf0e10cSrcweir              0,    0x2229,         0,    0xE08B,
748cdf0e10cSrcweir         0x22EF,    0x22EE,    0x22F0,    0x22F1,
749cdf0e10cSrcweir     // F050
750cdf0e10cSrcweir              0,         0,         0,         0,
751cdf0e10cSrcweir              0,         0,         0,         0,
752cdf0e10cSrcweir              0,         0,         0,         0,
753cdf0e10cSrcweir              0,         0,         0,         0,
754cdf0e10cSrcweir     // F060
755cdf0e10cSrcweir         0xE095,         0,    0xE25C,    0xE4BA,
756cdf0e10cSrcweir              0,         0,    0x210F,         0,
757cdf0e10cSrcweir              0,         0,         0,         0,
758cdf0e10cSrcweir         0x2113,    0x2213,         0,    0x00B0,
759cdf0e10cSrcweir     // F070
760cdf0e10cSrcweir              0,         0,    0xE098,         0,
761cdf0e10cSrcweir              0,    0xE097,         0,         0,
762cdf0e10cSrcweir              0,         0,         0,    0xE081,
763cdf0e10cSrcweir              0,    0xE082,         0,         0,
764cdf0e10cSrcweir     // F080
765cdf0e10cSrcweir              0,         0,         0,         0,
766cdf0e10cSrcweir              0,         0,         0,         0,
767cdf0e10cSrcweir              0,         0,         0,         0,
768cdf0e10cSrcweir              0,         0,         0,         0,
769cdf0e10cSrcweir     // F090
770cdf0e10cSrcweir              0,         0,         0,         0,
771cdf0e10cSrcweir              0,         0,         0,         0,
772cdf0e10cSrcweir              0,         0,         0,         0,
773cdf0e10cSrcweir              0,         0,         0,         0,
774cdf0e10cSrcweir     // F0a0
775cdf0e10cSrcweir              0,         0,         0,         0,
776cdf0e10cSrcweir              0,         0,         0,         0,
777cdf0e10cSrcweir              0,         0,         0,         0,
778cdf0e10cSrcweir              0,         0,         0,         0,
779cdf0e10cSrcweir     // F0b0
780cdf0e10cSrcweir              0,         0,         0,         0,
781cdf0e10cSrcweir              0,         0,         0,         0,
782cdf0e10cSrcweir              0,         0,         0,         0,
783cdf0e10cSrcweir              0,         0,         0,         0,
784cdf0e10cSrcweir     // F0c0
785cdf0e10cSrcweir              0,         0,         0,         0,
786cdf0e10cSrcweir              0,         0,         0,         0,
787cdf0e10cSrcweir              0,         0,         0,         0,
788cdf0e10cSrcweir              0,         0,         0,         0,
789cdf0e10cSrcweir     // F0d0
790cdf0e10cSrcweir              0,         0,         0,         0,
791cdf0e10cSrcweir              0,         0,         0,         0,
792cdf0e10cSrcweir              0,         0,         0,         0,
793cdf0e10cSrcweir              0,         0,         0,         0,
794cdf0e10cSrcweir     // F0e0
795cdf0e10cSrcweir              0,         0,         0,         0,
796cdf0e10cSrcweir              0,         0,         0,         0,
797cdf0e10cSrcweir              0,         0,         0,         0,
798cdf0e10cSrcweir              0,         0,         0,         0,
799cdf0e10cSrcweir     // F0f0
800cdf0e10cSrcweir              0,         0,         0,         0,
801cdf0e10cSrcweir              0,         0,         0,         0,
802cdf0e10cSrcweir              0,         0,         0,         0,
803cdf0e10cSrcweir              0,         0,         0,         0
804cdf0e10cSrcweir };
805cdf0e10cSrcweir 
806cdf0e10cSrcweir 
807cdf0e10cSrcweir //=======================================================================
808cdf0e10cSrcweir 
ImplStarSymbolToStarBats(sal_Unicode c)809cdf0e10cSrcweir static sal_Unicode ImplStarSymbolToStarBats( sal_Unicode c )
810cdf0e10cSrcweir {
811cdf0e10cSrcweir     switch ( c )
812cdf0e10cSrcweir     {
813cdf0e10cSrcweir         case 0x00A2: c = 0xF0E0; break;
814cdf0e10cSrcweir         case 0x00A4: c = 0xF0E1; break;
815cdf0e10cSrcweir         case 0x00A5: c = 0xF0E2; break;
816cdf0e10cSrcweir         case 0x00A7: c = 0xF0A7; break;
817cdf0e10cSrcweir         case 0x00AB: c = 0xF0AB; break;
818cdf0e10cSrcweir         case 0x00B6: c = 0xF0DE; break;
819cdf0e10cSrcweir         case 0x00BB: c = 0xF0BB; break;
820cdf0e10cSrcweir 
821cdf0e10cSrcweir         case 0x0152: c = 0xF08C; break;
822cdf0e10cSrcweir         case 0x0153: c = 0xF09C; break;
823cdf0e10cSrcweir         case 0x0160: c = 0xF08A; break;
824cdf0e10cSrcweir         case 0x0161: c = 0xF09A; break;
825cdf0e10cSrcweir         case 0x0178: c = 0xF09F; break;
826cdf0e10cSrcweir         case 0x017D: c = 0xF08E; break;
827cdf0e10cSrcweir         case 0x017E: c = 0xF09E; break;
828cdf0e10cSrcweir 
829cdf0e10cSrcweir         case 0x0192: c = 0xF083; break;
830cdf0e10cSrcweir         case 0x02C6: c = 0xF088; break;
831cdf0e10cSrcweir         case 0x02DC: c = 0xF098; break;
832cdf0e10cSrcweir         case 0x2013: c = 0xF096; break;
833cdf0e10cSrcweir         case 0x2014: c = 0xF097; break;
834cdf0e10cSrcweir         case 0x2018: c = 0xF091; break;
835cdf0e10cSrcweir 
836cdf0e10cSrcweir         case 0x2019: c = 0xF092; break;
837cdf0e10cSrcweir         case 0x201A: c = 0xF082; break;
838cdf0e10cSrcweir         case 0x201C: c = 0xF093; break;
839cdf0e10cSrcweir         case 0x201D: c = 0xF094; break;
840cdf0e10cSrcweir         case 0x201E: c = 0xF084; break;
841cdf0e10cSrcweir         case 0x2020: c = 0xF086; break;
842cdf0e10cSrcweir 
843cdf0e10cSrcweir         case 0x2021: c = 0xF087; break;
844cdf0e10cSrcweir         case 0x2022: c = 0xF095; break;
845cdf0e10cSrcweir         case 0x2026: c = 0xF085; break;
846cdf0e10cSrcweir         case 0x2030: c = 0xF089; break;
847cdf0e10cSrcweir         case 0x2039: c = 0xF08B; break;
848cdf0e10cSrcweir         case 0x203A: c = 0xF09B; break;
849cdf0e10cSrcweir 
850cdf0e10cSrcweir         case 0x20A1: c = 0xF0E4; break;
851cdf0e10cSrcweir         case 0x20A2: c = 0xF0E5; break;
852cdf0e10cSrcweir         case 0x20A3: c = 0xF0E6; break;
853cdf0e10cSrcweir         case 0x20A4: c = 0xF0E7; break;
854cdf0e10cSrcweir         case 0x20A8: c = 0xF0EA; break;
855cdf0e10cSrcweir         case 0x20A9: c = 0xF0E8; break;
856cdf0e10cSrcweir         case 0x20AB: c = 0xF0E9; break;
857cdf0e10cSrcweir         case 0x20AC: c = 0xF080; break;
858cdf0e10cSrcweir 
859cdf0e10cSrcweir         case 0x2122: c = 0xF099; break;
860cdf0e10cSrcweir         case 0x2190: c = 0xF0B7; break;
861cdf0e10cSrcweir         case 0x2191: c = 0xF0B8; break;
862cdf0e10cSrcweir         case 0x2192: c = 0xF0B5; break;
863cdf0e10cSrcweir         case 0x2193: c = 0xF0B6; break;
864cdf0e10cSrcweir         case 0x2194: c = 0xF0D8; break;
865cdf0e10cSrcweir         case 0x2195: c = 0xF0D9; break;
866cdf0e10cSrcweir 
867cdf0e10cSrcweir         case 0x21E4: c = 0xF0B4; break;
868cdf0e10cSrcweir         case 0x21E5: c = 0xF0B3; break;
869cdf0e10cSrcweir         case 0x21E6: c = 0xF0A4; break;
870cdf0e10cSrcweir         case 0x21E7: c = 0xF0B2; break;
871cdf0e10cSrcweir         case 0x21E8: c = 0xF0AF; break;
872cdf0e10cSrcweir         case 0x21E9: c = 0xF0A3; break;
873cdf0e10cSrcweir 
874cdf0e10cSrcweir         case 0x25A0: c = 0xF024; break;
875cdf0e10cSrcweir         case 0x25A1: c = 0xF025; break;
876cdf0e10cSrcweir         case 0x25B4: c = 0xF0C5; break;
877cdf0e10cSrcweir         case 0x25B5: c = 0xF0C7; break;
878cdf0e10cSrcweir         case 0x25BE: c = 0xF0C4; break;
879cdf0e10cSrcweir         case 0x25BF: c = 0xF0C6; break;
880cdf0e10cSrcweir         case 0x25C6: c = 0xF043; break;
881cdf0e10cSrcweir         case 0x25CF: c = 0xF022; break;
882cdf0e10cSrcweir         case 0x25D7: c = 0xF0D0; break;
883cdf0e10cSrcweir 
884cdf0e10cSrcweir         case 0x260E: c = 0xF074; break;
885cdf0e10cSrcweir         case 0x2611: c = 0xF034; break;
886cdf0e10cSrcweir         case 0x2612: c = 0xF033; break;
887cdf0e10cSrcweir         case 0x261B: c = 0xF036; break;
888cdf0e10cSrcweir         case 0x261E: c = 0xF07D; break;
889cdf0e10cSrcweir         case 0x2639: c = 0xF0AD; break;
890cdf0e10cSrcweir         case 0x263A: c = 0xF021; break;
891cdf0e10cSrcweir 
892cdf0e10cSrcweir         case 0x2702: c = 0xF0CB; break;
893cdf0e10cSrcweir         case 0x2708: c = 0xF0CC; break;
894cdf0e10cSrcweir         case 0x270D: c = 0xF07E; break;
895cdf0e10cSrcweir         case 0x270E: c = 0xF038; break;
896cdf0e10cSrcweir 
897cdf0e10cSrcweir         case 0x2713: c = 0xF039; break;
898cdf0e10cSrcweir         case 0x2714: c = 0xF03A; break;
899cdf0e10cSrcweir         case 0x2717: c = 0xF04F; break;
900cdf0e10cSrcweir         case 0x2718: c = 0xF050; break;
901cdf0e10cSrcweir         case 0x2719: c = 0xF051; break;
902cdf0e10cSrcweir         case 0x271A: c = 0xF052; break;
903cdf0e10cSrcweir         case 0x271B: c = 0xF053; break;
904cdf0e10cSrcweir         case 0x271C: c = 0xF054; break;
905cdf0e10cSrcweir 
906cdf0e10cSrcweir         case 0x2721: c = 0xF0CD; break;
907cdf0e10cSrcweir         case 0x2722: c = 0xF044; break;
908cdf0e10cSrcweir         case 0x2723: c = 0xF045; break;
909cdf0e10cSrcweir         case 0x2724: c = 0xF046; break;
910cdf0e10cSrcweir         case 0x2725: c = 0xF047; break;
911cdf0e10cSrcweir         case 0x272B: c = 0xF055; break;
912cdf0e10cSrcweir         case 0x272C: c = 0xF056; break;
913cdf0e10cSrcweir         case 0x272D: c = 0xF057; break;
914cdf0e10cSrcweir         case 0x272E: c = 0xF058; break;
915cdf0e10cSrcweir         case 0x272F: c = 0xF059; break;
916cdf0e10cSrcweir 
917cdf0e10cSrcweir         case 0x2730: c = 0xF05A; break;
918cdf0e10cSrcweir         case 0x2733: c = 0xF048; break;
919cdf0e10cSrcweir         case 0x2734: c = 0xF049; break;
920cdf0e10cSrcweir         case 0x2735: c = 0xF04A; break;
921cdf0e10cSrcweir         case 0x2736: c = 0xF04B; break;
922cdf0e10cSrcweir         case 0x2737: c = 0xF04C; break;
923cdf0e10cSrcweir         case 0x2738: c = 0xF04D; break;
924cdf0e10cSrcweir         case 0x2739: c = 0xF04E; break;
925cdf0e10cSrcweir         case 0x273F: c = 0xF0CE; break;
926cdf0e10cSrcweir 
927cdf0e10cSrcweir         case 0x2744: c = 0xF0CF; break;
928cdf0e10cSrcweir         case 0x274D: c = 0xF023; break;
929cdf0e10cSrcweir         case 0x274F: c = 0xF03E; break;
930cdf0e10cSrcweir         case 0x2750: c = 0xF03F; break;
931cdf0e10cSrcweir         case 0x2751: c = 0xF027; break;
932cdf0e10cSrcweir         case 0x2752: c = 0xF028; break;
933cdf0e10cSrcweir         case 0x2756: c = 0xF02C; break;
934cdf0e10cSrcweir         case 0x2759: c = 0xF0D1; break;
935cdf0e10cSrcweir         case 0x2762: c = 0xF0D4; break;
936cdf0e10cSrcweir 
937cdf0e10cSrcweir         case 0x2780: c = 0xF068; break;
938cdf0e10cSrcweir         case 0x2781: c = 0xF069; break;
939cdf0e10cSrcweir         case 0x2782: c = 0xF06A; break;
940cdf0e10cSrcweir         case 0x2783: c = 0xF06B; break;
941cdf0e10cSrcweir         case 0x2784: c = 0xF06C; break;
942cdf0e10cSrcweir         case 0x2785: c = 0xF06D; break;
943cdf0e10cSrcweir         case 0x2786: c = 0xF06E; break;
944cdf0e10cSrcweir         case 0x2787: c = 0xF06F; break;
945cdf0e10cSrcweir         case 0x2788: c = 0xF070; break;
946cdf0e10cSrcweir         case 0x2789: c = 0xF071; break;
947cdf0e10cSrcweir         case 0x278A: c = 0xF05D; break;
948cdf0e10cSrcweir         case 0x278B: c = 0xF05E; break;
949cdf0e10cSrcweir         case 0x278C: c = 0xF05F; break;
950cdf0e10cSrcweir         case 0x278D: c = 0xF060; break;
951cdf0e10cSrcweir         case 0x278E: c = 0xF061; break;
952cdf0e10cSrcweir         case 0x278F: c = 0xF062; break;
953cdf0e10cSrcweir 
954cdf0e10cSrcweir         case 0x2790: c = 0xF063; break;
955cdf0e10cSrcweir         case 0x2791: c = 0xF064; break;
956cdf0e10cSrcweir         case 0x2792: c = 0xF065; break;
957cdf0e10cSrcweir         case 0x2793: c = 0xF066; break;
958cdf0e10cSrcweir         case 0x2794: c = 0xF031; break;
959cdf0e10cSrcweir         case 0x2798: c = 0xF0DA; break;
960cdf0e10cSrcweir         case 0x279A: c = 0xF0DB; break;
961cdf0e10cSrcweir 
962cdf0e10cSrcweir         case 0x27A2: c = 0xF02F; break;
963cdf0e10cSrcweir         case 0x27B2: c = 0xF035; break;
964cdf0e10cSrcweir         case 0x27B8: c = 0xF0DC; break;
965cdf0e10cSrcweir 
966cdf0e10cSrcweir         case 0xE000: c = 0xF000+38; break;
967cdf0e10cSrcweir         case 0xE001: c = 0xF000+41; break;
968cdf0e10cSrcweir         case 0xE002: c = 0xF000+42; break;
969cdf0e10cSrcweir         case 0xE003: c = 0xF000+43; break;
970cdf0e10cSrcweir         case 0xE004: c = 0xF000+45; break;
971cdf0e10cSrcweir         case 0xE005: c = 0xF000+46; break;
972cdf0e10cSrcweir         case 0xE006: c = 0xF000+48; break;
973cdf0e10cSrcweir         case 0xE007: c = 0xF000+57; break;
974cdf0e10cSrcweir 
975cdf0e10cSrcweir         case 0xE008: c = 0xF000+59; break;
976cdf0e10cSrcweir         case 0xE009: c = 0xF000+60; break;
977cdf0e10cSrcweir         case 0xE00a: c = 0xF000+61; break;
978cdf0e10cSrcweir         case 0xE00b: c = 0xF000+64; break;
979cdf0e10cSrcweir         case 0xE00c: c = 0xF000+65; break;
980cdf0e10cSrcweir         case 0xE00d: c = 0xF000+66; break;
981cdf0e10cSrcweir         case 0xE00e: c = 0xF000+67; break;
982cdf0e10cSrcweir         case 0xE00f: c = 0xF000+92; break;
983cdf0e10cSrcweir 
984cdf0e10cSrcweir         case 0xE010: c = 0xF000+103; break;
985cdf0e10cSrcweir         case 0xE011: c = 0xF000+114; break;
986cdf0e10cSrcweir         case 0xE012: c = 0xF000+115; break;
987cdf0e10cSrcweir         case 0xE013: c = 0xF000+117; break;
988cdf0e10cSrcweir         case 0xE014: c = 0xF000+118; break;
989cdf0e10cSrcweir         case 0xE015: c = 0xF000+119; break;
990cdf0e10cSrcweir         case 0xE016: c = 0xF000+120; break;
991cdf0e10cSrcweir         case 0xE017: c = 0xF000+121; break;
992cdf0e10cSrcweir 
993cdf0e10cSrcweir         case 0xE018: c = 0xF000+122; break;
994cdf0e10cSrcweir         case 0xE019: c = 0xF000+123; break;
995cdf0e10cSrcweir         case 0xE01a: c = 0xF000+124; break;
996cdf0e10cSrcweir         case 0xE01b: c = 0xF000+126; break;
997cdf0e10cSrcweir         case 0xE01c: c = 0xF000+136; break;
998cdf0e10cSrcweir         case 0xE01d: c = 0xF000+155; break;
999cdf0e10cSrcweir         case 0xE01e: c = 0xF000+165; break;
1000cdf0e10cSrcweir         case 0xE01f: c = 0xF000+166; break;
1001cdf0e10cSrcweir 
1002cdf0e10cSrcweir         case 0xE020: c = 0xF000+168; break;
1003cdf0e10cSrcweir         case 0xE021: c = 0xF000+169; break;
1004cdf0e10cSrcweir         case 0xE022: c = 0xF000+170; break;
1005cdf0e10cSrcweir         case 0xE023: c = 0xF000+172; break;
1006cdf0e10cSrcweir         case 0xE024: c = 0xF000+174; break;
1007cdf0e10cSrcweir         case 0xE025: c = 0xF000+175; break;
1008cdf0e10cSrcweir         case 0xE026: c = 0xF000+176; break;
1009cdf0e10cSrcweir         case 0xE027: c = 0xF000+177; break;
1010cdf0e10cSrcweir 
1011cdf0e10cSrcweir         case 0xE028: c = 0xF000+178; break;
1012cdf0e10cSrcweir         case 0xE029: c = 0xF000+185; break;
1013cdf0e10cSrcweir         case 0xE02a: c = 0xF000+186; break;
1014cdf0e10cSrcweir         case 0xE02b: c = 0xF000+188; break;
1015cdf0e10cSrcweir         case 0xE02c: c = 0xF000+189; break;
1016cdf0e10cSrcweir         case 0xE02d: c = 0xF000+190; break;
1017cdf0e10cSrcweir         case 0xE02e: c = 0xF000+191; break;
1018cdf0e10cSrcweir         case 0xE02f: c = 0xF000+192; break;
1019cdf0e10cSrcweir 
1020cdf0e10cSrcweir         case 0xE030: c = 0xF000+193; break;
1021cdf0e10cSrcweir         case 0xE031: c = 0xF000+194; break;
1022cdf0e10cSrcweir         case 0xE032: c = 0xF000+195; break;
1023cdf0e10cSrcweir         case 0xE033: c = 0xF000+200; break;
1024cdf0e10cSrcweir         case 0xE034: c = 0xF000+201; break;
1025cdf0e10cSrcweir         case 0xE035: c = 0xF000+202; break;
1026cdf0e10cSrcweir         case 0xE036: c = 0xF000+210; break;
1027cdf0e10cSrcweir         case 0xE037: c = 0xF000+211; break;
1028cdf0e10cSrcweir 
1029cdf0e10cSrcweir         case 0xE038: c = 0xF000+227; break;
1030cdf0e10cSrcweir         case 0xE039: c = 0xF000+235; break;
1031cdf0e10cSrcweir         case 0xE03a: c = 0xF000+255; break;
1032cdf0e10cSrcweir 
1033cdf0e10cSrcweir         default: c = 0; break;
1034cdf0e10cSrcweir     }
1035cdf0e10cSrcweir 
1036cdf0e10cSrcweir     return c;
1037cdf0e10cSrcweir }
1038cdf0e10cSrcweir 
1039cdf0e10cSrcweir enum SymbolFont
1040cdf0e10cSrcweir {
1041cdf0e10cSrcweir     Symbol=1, Wingdings=2, MonotypeSorts=4, Webdings=8, Wingdings2=16,
1042cdf0e10cSrcweir     Wingdings3=32, MTExtra=64, TimesNewRoman=128
1043cdf0e10cSrcweir };
1044cdf0e10cSrcweir 
1045cdf0e10cSrcweir const char *aSymbolNames[] =
1046cdf0e10cSrcweir {
1047cdf0e10cSrcweir     "Symbol", "Wingdings", "Monotype Sorts", "Webdings", "Wingdings 2",
1048cdf0e10cSrcweir     "Wingdings 3", "MT Extra", "Times New Roman"
1049cdf0e10cSrcweir };
1050cdf0e10cSrcweir 
1051cdf0e10cSrcweir struct SymbolEntry
1052cdf0e10cSrcweir {
1053cdf0e10cSrcweir     sal_uInt8 cIndex;
1054cdf0e10cSrcweir     enum SymbolFont eFont;
1055cdf0e10cSrcweir };
1056cdf0e10cSrcweir 
1057cdf0e10cSrcweir class StarSymbolToMSMultiFontImpl : public StarSymbolToMSMultiFont
1058cdf0e10cSrcweir {
1059cdf0e10cSrcweir private:
1060cdf0e10cSrcweir     ::std::multimap<sal_Unicode, SymbolEntry> maMagicMap;
1061cdf0e10cSrcweir public:
1062cdf0e10cSrcweir     StarSymbolToMSMultiFontImpl(bool bPerfectOnly);
1063cdf0e10cSrcweir     String ConvertChar(sal_Unicode &rChar);
1064cdf0e10cSrcweir     String ConvertString(String &rString, xub_StrLen& rIndex);
1065cdf0e10cSrcweir };
1066cdf0e10cSrcweir 
1067cdf0e10cSrcweir struct ExtraTable { sal_Unicode cStar; sal_uInt8 cMS;};
1068cdf0e10cSrcweir 
1069cdf0e10cSrcweir ExtraTable aWingDingsExtraTab[] =
1070cdf0e10cSrcweir {
1071cdf0e10cSrcweir     {0x25cf, 0x6C}, {0x2714, 0xFC}, {0x2717, 0xFB}, {0x2794, 0xE8},
1072cdf0e10cSrcweir     {0x27a2, 0xD8}, {0xe000, 0x6F}, {0xe001, 0x73}, {0xe002, 0x74},
1073cdf0e10cSrcweir     {0xe003, 0x75}, {0xe004, 0x77}, {0xe005, 0xA6}, {0xe006, 0xE0},
1074cdf0e10cSrcweir     {0xe007, 0xFC}, {0xe008, 0x6C}, {0xe009, 0x6D}, {0xe00a, 0x6E},
1075cdf0e10cSrcweir     {0xe00b, 0x72}, {0xe00c, 0x75}, {0xe00d, 0x76}, {0xe00e, 0x74},
1076cdf0e10cSrcweir     {0xe00f, 0x8B}, {0xe010, 0x80}, {0xe011, 0x2B}, {0xe012, 0x3A},
1077cdf0e10cSrcweir     {0xe013, 0x5D}, {0xe014, 0x29}, {0xe015, 0x3A}, {0xe016, 0x3C},
1078cdf0e10cSrcweir     {0xe017, 0x38}, {0xe018, 0x3A}, {0xe019, 0x2A}, {0xe01a, 0x2B},
1079cdf0e10cSrcweir     {0xe01b, 0x3F}, {0xe01c, 0x9F}, {0xe01d, 0x80}, {0xe01e, 0x8B},
1080cdf0e10cSrcweir     {0xe023, 0x4A}, {0xe025, 0xF0}, {0xe026, 0xF2}, {0xe027, 0xEF},
1081cdf0e10cSrcweir     {0xe028, 0xF1}, {0xe029, 0x52}, {0xe02a, 0x29}, {0xe02b, 0xE0},
1082cdf0e10cSrcweir     {0xe02c, 0xE2}, {0xe02d, 0xDF}, {0xe02e, 0xE1}, {0xe02f, 0xAC},
1083cdf0e10cSrcweir     {0xe030, 0xAD}, {0xe031, 0xAE}, {0xe032, 0x7C}, {0xe033, 0x43},
1084cdf0e10cSrcweir     {0xe034, 0x4D}, {0xe0aa, 0x71}, {0xe422, 0x44}
1085cdf0e10cSrcweir };
1086cdf0e10cSrcweir 
1087cdf0e10cSrcweir ExtraTable aSymbolExtraTab2[] =
1088cdf0e10cSrcweir {
1089cdf0e10cSrcweir     {0x0020, 0x20}, {0x00A0, 0x20}, {0x0021, 0x21}, {0x2200, 0x22},
1090cdf0e10cSrcweir     {0x0023, 0x23}, {0x2203, 0x24}, {0x0025, 0x25}, {0x0026, 0x26},
1091cdf0e10cSrcweir     {0x220B, 0x27}, {0x0028, 0x28}, {0x0029, 0x29}, {0x2217, 0x2A},
1092cdf0e10cSrcweir     {0x002B, 0x2B}, {0x002C, 0x2C}, {0x2212, 0x2D}, {0x002E, 0x2E},
1093cdf0e10cSrcweir     {0x002F, 0x2F}, {0x003A, 0x3A}, {0x003B, 0x3B}, {0x003C, 0x3C},
1094cdf0e10cSrcweir     {0x003D, 0x3D}, {0x003E, 0x3E}, {0x2245, 0x40}, {0x2206, 0x44},
1095cdf0e10cSrcweir     {0x2126, 0x57}, {0x005B, 0x5B}, {0x005D, 0x5D}, {0x22A5, 0x5E},
1096cdf0e10cSrcweir     {0x03C6, 0x66}, {0x03D5, 0x6A}, {0x00B5, 0x6D}, {0x007B, 0x7B},
1097cdf0e10cSrcweir     {0x007C, 0x7C}, {0x007D, 0x7D}, {0x223C, 0x7E}, {0x20AC, 0xA0},
1098cdf0e10cSrcweir     {0x2032, 0xA2}, {0x2264, 0xA3}, {0x2044, 0xA4}, {0x221E, 0xA5},
1099cdf0e10cSrcweir     {0x0192, 0xA6}, {0x2663, 0xA7}, {0x2665, 0xA9}, {0x2660, 0xAA},
1100cdf0e10cSrcweir     {0x2194, 0xAB}, {0x2190, 0xAC}, {0x2191, 0xAD}, {0x2192, 0xAE},
1101cdf0e10cSrcweir     {0x2193, 0xAF}, {0x00B0, 0xB0}, {0x00B1, 0xB1}, {0x2265, 0xB3},
1102cdf0e10cSrcweir     {0x00D7, 0xB4}, {0x221D, 0xB5}, {0x2202, 0xB6}, {0x2022, 0xB7},
1103cdf0e10cSrcweir     {0x00F7, 0xB8}, {0x2260, 0xB9}, {0x2261, 0xBA}, {0x2248, 0xBB},
1104cdf0e10cSrcweir     {0x2026, 0xBC}, {0x21B5, 0xBF}, {0x2135, 0xC0}, {0x2111, 0xC1},
1105cdf0e10cSrcweir     {0x211C, 0xC2}, {0x2118, 0xC3}, {0x2297, 0xC4}, {0x2295, 0xC5},
1106cdf0e10cSrcweir     {0x2205, 0xC6}, {0x2229, 0xC7}, {0x222A, 0xC8}, {0x2283, 0xC9},
1107cdf0e10cSrcweir     {0x2287, 0xCA}, {0x2284, 0xCB}, {0x2282, 0xCC}, {0x2286, 0xCD},
1108cdf0e10cSrcweir     {0x2208, 0xCE}, {0x2209, 0xCF}, {0x2207, 0xD1}, {0x220F, 0xD5},
1109cdf0e10cSrcweir     {0x221A, 0xD6}, {0x22C5, 0xD7}, {0x00AC, 0xD8}, {0x2227, 0xD9},
1110cdf0e10cSrcweir     {0x2228, 0xDA}, {0x21D4, 0xDB}, {0x21D0, 0xDC}, {0x21D2, 0xDE},
1111cdf0e10cSrcweir     {0x2329, 0xE1}, {0x2211, 0xE5}, {0x232A, 0xF1}, {0x222B, 0xF2},
1112cdf0e10cSrcweir     {0x2320, 0xF3}, {0x2321, 0xF5}, {0x2013, 0x2D}
1113cdf0e10cSrcweir };
1114cdf0e10cSrcweir 
1115cdf0e10cSrcweir ExtraTable aSymbolExtraTab[] =
1116cdf0e10cSrcweir {
1117cdf0e10cSrcweir     {0xe021, 0xD3}, {0xe024, 0xD2}, {0xe035, 0x20}, {0xe036, 0x28},
1118cdf0e10cSrcweir     {0xe037, 0x29}, {0xe039, 0x20}, {0xe083, 0x2B}, {0xe084, 0x3C},
1119cdf0e10cSrcweir     {0xe085, 0x3E}, {0xe086, 0xA3}, {0xe087, 0xB3}, {0xe089, 0xCE},
1120cdf0e10cSrcweir     {0xe08a, 0xA6}, {0xe08c, 0xAE}, {0xe08d, 0xD6}, {0xe08e, 0xD6},
1121cdf0e10cSrcweir     {0xe08f, 0xD6}, {0xe094, 0xA2}, {0xe09e, 0x28}, {0xe09f, 0x29},
1122cdf0e10cSrcweir     {0xe0a0, 0xD0}, {0xe0a6, 0xA2}, {0xe0a7, 0x7C}, {0xe0a8, 0x2F},
1123cdf0e10cSrcweir     {0xe0ab, 0x7C}, {0xe0ac, 0x47}, {0xe0ad, 0x44}, {0xe0ae, 0x51},
1124cdf0e10cSrcweir     {0xe0af, 0x4C}, {0xe0b0, 0x58}, {0xe0b1, 0x50}, {0xe0b2, 0x53},
1125cdf0e10cSrcweir     {0xe0b3, 0x55}, {0xe0b4, 0x46}, {0xe0b5, 0x59}, {0xe0b6, 0x57},
1126cdf0e10cSrcweir     {0xe0b7, 0x61}, {0xe0b8, 0x62}, {0xe0b9, 0x67}, {0xe0ba, 0x64},
1127cdf0e10cSrcweir     {0xe0bb, 0x65}, {0xe0bc, 0x7A}, {0xe0bd, 0x68}, {0xe0be, 0x71},
1128cdf0e10cSrcweir     {0xe0bf, 0x69}, {0xe0c0, 0x6B}, {0xe0c1, 0x6C}, {0xe0c2, 0x6D},
1129cdf0e10cSrcweir     {0xe0c3, 0x6E}, {0xe0c4, 0x78}, {0xe0c5, 0x6F}, {0xe0c6, 0x70},
1130cdf0e10cSrcweir     {0xe0c7, 0x72}, {0xe0c8, 0x73}, {0xe0c9, 0x74}, {0xe0ca, 0x75},
1131cdf0e10cSrcweir     {0xe0cb, 0x66}, {0xe0cc, 0x63}, {0xe0cd, 0x79}, {0xe0ce, 0x77},
1132cdf0e10cSrcweir     {0xe0cf, 0x65}, {0xe0d0, 0x4A}, {0xe0d1, 0x76}, {0xe0d3, 0x56},
1133cdf0e10cSrcweir     {0xe0d4, 0x6A}, {0xe0d5, 0xB6}, {0xe0d6, 0x69}, {0xe0db, 0xAC},
1134cdf0e10cSrcweir     {0xe0dc, 0xAD}, {0xe0dd, 0xAF}
1135cdf0e10cSrcweir };
1136cdf0e10cSrcweir 
1137cdf0e10cSrcweir ExtraTable aTNRExtraTab[] =
1138cdf0e10cSrcweir {
1139cdf0e10cSrcweir     {0xe021, 0xA9},
1140cdf0e10cSrcweir     {0xe022, 0x40},
1141cdf0e10cSrcweir     {0xe024, 0xAE},
1142cdf0e10cSrcweir     {0xe035, 0x20},
1143cdf0e10cSrcweir     {0xe036, '('},
1144cdf0e10cSrcweir     {0xe037, ')'},
1145cdf0e10cSrcweir     {0xe039, 0x20},
1146cdf0e10cSrcweir     {0xe03a, 0x80},
1147cdf0e10cSrcweir     {0xe080, 0x89},
1148cdf0e10cSrcweir     {0xe083, '+'},
1149cdf0e10cSrcweir     {0xe084, '<'},
1150cdf0e10cSrcweir     {0xe085, '>'},
1151cdf0e10cSrcweir     {0xe0a9, '\\'}
1152cdf0e10cSrcweir };
1153cdf0e10cSrcweir 
StarSymbolToMSMultiFontImpl(bool bPerfectOnly)1154cdf0e10cSrcweir StarSymbolToMSMultiFontImpl::StarSymbolToMSMultiFontImpl(bool bPerfectOnly)
1155cdf0e10cSrcweir {
1156cdf0e10cSrcweir     struct ConvertTable
1157cdf0e10cSrcweir     {
1158cdf0e10cSrcweir         enum SymbolFont meFont;
1159cdf0e10cSrcweir         const sal_Unicode* pTab;
1160cdf0e10cSrcweir     };
1161cdf0e10cSrcweir 
1162cdf0e10cSrcweir     //In order of preference
1163cdf0e10cSrcweir     const ConvertTable aConservativeTable[] =
1164cdf0e10cSrcweir     {
1165cdf0e10cSrcweir         {Symbol,         aAdobeSymbolTab},
1166cdf0e10cSrcweir         {Wingdings,      aWingDingsTab},
1167cdf0e10cSrcweir         {MonotypeSorts,  aMonotypeSortsTab},
1168cdf0e10cSrcweir         {Webdings,       aWebDingsTab},
1169cdf0e10cSrcweir         {Wingdings2,     aWingDings2Tab},
1170cdf0e10cSrcweir         {Wingdings3,     aWingDings3Tab},
1171cdf0e10cSrcweir         {MTExtra,        aMTExtraTab}
1172cdf0e10cSrcweir     };
1173cdf0e10cSrcweir 
1174cdf0e10cSrcweir     struct ExtendedConvertTable
1175cdf0e10cSrcweir     {
1176cdf0e10cSrcweir         enum SymbolFont meFont;
1177cdf0e10cSrcweir         const ExtraTable *mpTable;
1178cdf0e10cSrcweir         size_t mnSize;
1179cdf0e10cSrcweir         ExtendedConvertTable(SymbolFont eFont, const ExtraTable *pTable,
1180cdf0e10cSrcweir             size_t nSize)
1181cdf0e10cSrcweir             : meFont(eFont), mpTable(pTable), mnSize(nSize) {}
1182cdf0e10cSrcweir     };
1183cdf0e10cSrcweir 
1184cdf0e10cSrcweir     //Reverse map from a given starsymbol char to exact matches in ms symbol
1185cdf0e10cSrcweir     //fonts.
1186cdf0e10cSrcweir     int nEntries = sizeof(aConservativeTable) / sizeof(aConservativeTable[0]);
1187cdf0e10cSrcweir     int i;
1188cdf0e10cSrcweir     for (i = 0; i < nEntries; ++i)
1189cdf0e10cSrcweir     {
1190cdf0e10cSrcweir         const ConvertTable& r = aConservativeTable[i];
1191cdf0e10cSrcweir         SymbolEntry aEntry;
1192cdf0e10cSrcweir         aEntry.eFont = r.meFont;
1193cdf0e10cSrcweir         for (aEntry.cIndex = 0xFF; aEntry.cIndex >= 0x20; --aEntry.cIndex)
1194cdf0e10cSrcweir         {
1195cdf0e10cSrcweir             if (sal_Unicode cChar = r.pTab[aEntry.cIndex-0x20])
1196cdf0e10cSrcweir                 maMagicMap.insert(
1197cdf0e10cSrcweir                     ::std::multimap<sal_Unicode, SymbolEntry>::value_type(
1198cdf0e10cSrcweir                     cChar, aEntry));
1199cdf0e10cSrcweir         }
1200cdf0e10cSrcweir     }
1201cdf0e10cSrcweir 
1202cdf0e10cSrcweir     //In order of preference
1203cdf0e10cSrcweir     const ExtendedConvertTable aAgressiveTable[] =
1204cdf0e10cSrcweir     {
1205cdf0e10cSrcweir         ExtendedConvertTable(Symbol, aSymbolExtraTab2,
1206cdf0e10cSrcweir             sizeof(aSymbolExtraTab2)),
1207cdf0e10cSrcweir         ExtendedConvertTable(Symbol, aSymbolExtraTab,
1208cdf0e10cSrcweir             sizeof(aSymbolExtraTab)),
1209cdf0e10cSrcweir         ExtendedConvertTable(Wingdings, aWingDingsExtraTab,
1210cdf0e10cSrcweir             sizeof(aWingDingsExtraTab)),
1211cdf0e10cSrcweir         ExtendedConvertTable(TimesNewRoman, aTNRExtraTab,
1212cdf0e10cSrcweir             sizeof(aTNRExtraTab))
1213cdf0e10cSrcweir     };
1214cdf0e10cSrcweir 
1215cdf0e10cSrcweir      //Allow extra conversions that are not perfect, but "good enough"
1216cdf0e10cSrcweir     if (!bPerfectOnly)
1217cdf0e10cSrcweir         nEntries = sizeof(aAgressiveTable) / sizeof(aAgressiveTable[0]);
1218cdf0e10cSrcweir     else
1219cdf0e10cSrcweir         nEntries = 1;
1220cdf0e10cSrcweir 
1221cdf0e10cSrcweir     for (i = 0; i < nEntries; ++i)
1222cdf0e10cSrcweir     {
1223cdf0e10cSrcweir         const ExtendedConvertTable& r = aAgressiveTable[i];
1224cdf0e10cSrcweir         SymbolEntry aEntry;
1225cdf0e10cSrcweir         aEntry.eFont = r.meFont;
1226cdf0e10cSrcweir         for (int j = r.mnSize / sizeof(r.mpTable[0]); j >=0; --j)
1227cdf0e10cSrcweir         {
1228cdf0e10cSrcweir             aEntry.cIndex = r.mpTable[j].cMS;
1229cdf0e10cSrcweir             maMagicMap.insert(
1230cdf0e10cSrcweir                 ::std::multimap<sal_Unicode, SymbolEntry>::value_type(
1231cdf0e10cSrcweir                 r.mpTable[j].cStar, aEntry));
1232cdf0e10cSrcweir         }
1233cdf0e10cSrcweir     }
1234cdf0e10cSrcweir }
1235cdf0e10cSrcweir 
SymbolFontToString(int nResult)1236cdf0e10cSrcweir const char *SymbolFontToString(int nResult)
1237cdf0e10cSrcweir {
1238cdf0e10cSrcweir     const char **ppName = aSymbolNames;
1239cdf0e10cSrcweir     int nI = Symbol;
1240cdf0e10cSrcweir     while (nI <= nResult)
1241cdf0e10cSrcweir     {
1242cdf0e10cSrcweir         if (!(nI & nResult))
1243cdf0e10cSrcweir             nI = nI << 1;
1244cdf0e10cSrcweir         else
1245cdf0e10cSrcweir             break;
1246cdf0e10cSrcweir         ppName++;
1247cdf0e10cSrcweir     }
1248cdf0e10cSrcweir     return *ppName;
1249cdf0e10cSrcweir }
1250cdf0e10cSrcweir 
ConvertChar(sal_Unicode & rChar)1251cdf0e10cSrcweir String StarSymbolToMSMultiFontImpl::ConvertChar(sal_Unicode &rChar)
1252cdf0e10cSrcweir {
1253cdf0e10cSrcweir     String sRet;
1254cdf0e10cSrcweir 
1255cdf0e10cSrcweir     ::std::multimap<sal_Unicode, SymbolEntry>::const_iterator aResult =
1256cdf0e10cSrcweir         maMagicMap.find(rChar);
1257cdf0e10cSrcweir 
1258cdf0e10cSrcweir     if (aResult != maMagicMap.end())
1259cdf0e10cSrcweir     {
1260cdf0e10cSrcweir         const SymbolEntry &rEntry = (*aResult).second;
1261cdf0e10cSrcweir     	sRet.AssignAscii(SymbolFontToString(rEntry.eFont));
1262cdf0e10cSrcweir         rChar = rEntry.cIndex;
1263cdf0e10cSrcweir     }
1264cdf0e10cSrcweir 
1265cdf0e10cSrcweir     return sRet;
1266cdf0e10cSrcweir }
1267cdf0e10cSrcweir 
ConvertString(String & rString,xub_StrLen & rIndex)1268cdf0e10cSrcweir String StarSymbolToMSMultiFontImpl::ConvertString(String &rString,
1269cdf0e10cSrcweir     xub_StrLen& rIndex)
1270cdf0e10cSrcweir {
1271cdf0e10cSrcweir     typedef ::std::multimap<sal_Unicode, SymbolEntry>::iterator MI;
1272cdf0e10cSrcweir     typedef ::std::pair<MI, MI> Result;
1273cdf0e10cSrcweir 
1274cdf0e10cSrcweir     String sRet;
1275cdf0e10cSrcweir 
1276cdf0e10cSrcweir     xub_StrLen nLen = rString.Len();
1277cdf0e10cSrcweir     if (rIndex >= nLen)
1278cdf0e10cSrcweir         return sRet;
1279cdf0e10cSrcweir 
1280cdf0e10cSrcweir     int nTotal = 0, nResult = 0;
1281cdf0e10cSrcweir     ::std::vector<Result> aPossibilities;
1282cdf0e10cSrcweir     aPossibilities.reserve(nLen - rIndex);
1283cdf0e10cSrcweir     xub_StrLen nStart = rIndex;
1284cdf0e10cSrcweir     do
1285cdf0e10cSrcweir     {
1286cdf0e10cSrcweir         Result aResult = maMagicMap.equal_range(rString.GetChar(rIndex));
1287cdf0e10cSrcweir         int nBitfield = 0;
1288cdf0e10cSrcweir         for (MI aIndex = aResult.first; aIndex != aResult.second; ++aIndex)
1289cdf0e10cSrcweir             nBitfield |= aIndex->second.eFont;
1290cdf0e10cSrcweir 
1291cdf0e10cSrcweir         if (!nTotal)
1292cdf0e10cSrcweir             nTotal = nBitfield;
1293cdf0e10cSrcweir         else
1294cdf0e10cSrcweir         {
1295cdf0e10cSrcweir             if (nTotal != nBitfield)    //Allow a series of failures
1296cdf0e10cSrcweir             {
1297cdf0e10cSrcweir                 nTotal &= nBitfield;
1298cdf0e10cSrcweir                 if (!nTotal)
1299cdf0e10cSrcweir                     break;
1300cdf0e10cSrcweir             }
1301cdf0e10cSrcweir         }
1302cdf0e10cSrcweir         nResult = nTotal;
1303cdf0e10cSrcweir         if (nResult)    //Don't bother storing a series of failures
1304cdf0e10cSrcweir             aPossibilities.push_back(aResult);
1305cdf0e10cSrcweir         ++rIndex;
1306cdf0e10cSrcweir     }while(rIndex < nLen);
1307cdf0e10cSrcweir 
1308cdf0e10cSrcweir     if (nResult)
1309cdf0e10cSrcweir     {
1310cdf0e10cSrcweir         int nI = Symbol;
1311cdf0e10cSrcweir         while (nI <= nResult)
1312cdf0e10cSrcweir         {
1313cdf0e10cSrcweir             if (!(nI & nResult))
1314cdf0e10cSrcweir                 nI = nI << 1;
1315cdf0e10cSrcweir             else
1316cdf0e10cSrcweir                 break;
1317cdf0e10cSrcweir         }
1318cdf0e10cSrcweir         sRet.AssignAscii(SymbolFontToString(nI));
1319cdf0e10cSrcweir 
1320cdf0e10cSrcweir         xub_StrLen nSize = sal::static_int_cast<xub_StrLen>(aPossibilities.size());
1321cdf0e10cSrcweir         for(xub_StrLen nPos = 0; nPos < nSize; ++nPos)
1322cdf0e10cSrcweir         {
1323cdf0e10cSrcweir             const Result &rResult = aPossibilities[nPos];
1324cdf0e10cSrcweir 
1325cdf0e10cSrcweir             for (MI aIndex = rResult.first; aIndex != rResult.second; ++aIndex)
1326cdf0e10cSrcweir             {
1327cdf0e10cSrcweir                 if (aIndex->second.eFont == nI)
1328cdf0e10cSrcweir                 {
1329cdf0e10cSrcweir                     rString.SetChar(nPos+nStart, aIndex->second.cIndex);
1330cdf0e10cSrcweir                     break;
1331cdf0e10cSrcweir                 }
1332cdf0e10cSrcweir             }
1333cdf0e10cSrcweir         }
1334cdf0e10cSrcweir     }
1335cdf0e10cSrcweir 
1336cdf0e10cSrcweir     return sRet;
1337cdf0e10cSrcweir }
1338cdf0e10cSrcweir 
CreateStarSymbolToMSMultiFont(bool bPerfectOnly)1339cdf0e10cSrcweir StarSymbolToMSMultiFont *CreateStarSymbolToMSMultiFont(bool bPerfectOnly)
1340cdf0e10cSrcweir {
1341cdf0e10cSrcweir     return new StarSymbolToMSMultiFontImpl(bPerfectOnly);
1342cdf0e10cSrcweir }
1343cdf0e10cSrcweir 
1344cdf0e10cSrcweir //=======================================================================
1345cdf0e10cSrcweir 
RecodeChar(sal_Unicode cChar) const1346cdf0e10cSrcweir sal_Unicode ConvertChar::RecodeChar( sal_Unicode cChar ) const
1347cdf0e10cSrcweir {
1348cdf0e10cSrcweir     sal_Unicode cRetVal = 0;
1349cdf0e10cSrcweir     if( mpCvtFunc )
1350cdf0e10cSrcweir     {
1351cdf0e10cSrcweir         // use a conversion function for recoding
1352cdf0e10cSrcweir         cRetVal = mpCvtFunc( cChar );
1353cdf0e10cSrcweir     }
1354cdf0e10cSrcweir     else
1355cdf0e10cSrcweir     {
1356cdf0e10cSrcweir         // use a conversion table for recoding
1357cdf0e10cSrcweir         sal_Unicode cIndex = cChar;
1358cdf0e10cSrcweir         // allow symbol aliasing
1359cdf0e10cSrcweir         if( cIndex & 0xFF00 )
1360cdf0e10cSrcweir             cIndex -= 0xF000;
1361cdf0e10cSrcweir         // recode the symbol
1362cdf0e10cSrcweir         if( cIndex>=0x0020 && cIndex<=0x00FF )
1363cdf0e10cSrcweir             cRetVal = mpCvtTab[ cIndex - 0x0020 ];
1364cdf0e10cSrcweir     }
1365cdf0e10cSrcweir 
1366cdf0e10cSrcweir     return cRetVal ? cRetVal : cChar;
1367cdf0e10cSrcweir }
1368cdf0e10cSrcweir 
1369cdf0e10cSrcweir // -----------------------------------------------------------------------
1370cdf0e10cSrcweir 
1371cdf0e10cSrcweir // recode the string assuming the character codes are symbol codes
1372cdf0e10cSrcweir // from an traditional symbol font (i.e. U+F020..U+F0FF)
RecodeString(String & rStr,xub_StrLen nIndex,xub_StrLen nLen) const1373cdf0e10cSrcweir void ConvertChar::RecodeString( String& rStr, xub_StrLen nIndex, xub_StrLen nLen ) const
1374cdf0e10cSrcweir {
1375cdf0e10cSrcweir     sal_uLong nLastIndex = (sal_uLong)nIndex + nLen;
1376cdf0e10cSrcweir     if( nLastIndex > rStr.Len() )
1377cdf0e10cSrcweir         nLastIndex = rStr.Len();
1378cdf0e10cSrcweir 
1379cdf0e10cSrcweir     for(; nIndex < nLastIndex; ++nIndex )
1380cdf0e10cSrcweir     {
1381cdf0e10cSrcweir         sal_Unicode cOrig = rStr.GetChar( nIndex );
1382cdf0e10cSrcweir         // only recode symbols and their U+00xx aliases
1383cdf0e10cSrcweir         if( ((cOrig < 0x0020) || (cOrig > 0x00FF))
1384cdf0e10cSrcweir         &&  ((cOrig < 0xF020) || (cOrig > 0xF0FF)) )
1385cdf0e10cSrcweir             continue;
1386cdf0e10cSrcweir 
1387cdf0e10cSrcweir         // recode a symbol
1388cdf0e10cSrcweir         sal_Unicode cNew = RecodeChar( cOrig );
1389cdf0e10cSrcweir         if( cOrig != cNew )
1390cdf0e10cSrcweir             rStr.SetChar( nIndex, cNew );
1391cdf0e10cSrcweir     }
1392cdf0e10cSrcweir }
1393cdf0e10cSrcweir 
1394cdf0e10cSrcweir //=======================================================================
1395cdf0e10cSrcweir 
1396cdf0e10cSrcweir struct RecodeTable { const char* pOrgName; ConvertChar aCvt;};
1397cdf0e10cSrcweir 
1398cdf0e10cSrcweir static RecodeTable aRecodeTable[] =
1399cdf0e10cSrcweir {
1400cdf0e10cSrcweir     // the first two entries must be StarMath and StarBats; do not reorder!
1401*55221da5SMatthias Seidel     // reason: grep -F for FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS
1402cdf0e10cSrcweir     {"starbats",        {aStarBatsTab,  "StarSymbol", NULL}},
1403cdf0e10cSrcweir     {"starmath",        {aStarMathTab,  "StarSymbol", NULL}},
1404cdf0e10cSrcweir 
1405cdf0e10cSrcweir     {"symbol",          {aAdobeSymbolTab, "StarSymbol", NULL}},
1406cdf0e10cSrcweir     {"standardsymbols", {aAdobeSymbolTab, "StarSymbol", NULL}},
1407cdf0e10cSrcweir     {"standardsymbolsl",{aAdobeSymbolTab, "StarSymbol", NULL}},
1408cdf0e10cSrcweir 
1409cdf0e10cSrcweir     {"monotypesorts",   {aMonotypeSortsTab, "StarSymbol", NULL}},
1410cdf0e10cSrcweir //  {"monotypesorts2",  {aMonotypeSorts2Tab, "StarSymbol", NULL}}
1411cdf0e10cSrcweir     {"zapfdingbats",    {aMonotypeSortsTab, "StarSymbol", NULL}},  //ZapfDingbats=MonotypeSorts-X?
1412cdf0e10cSrcweir     {"itczapfdingbats", {aMonotypeSortsTab, "StarSymbol", NULL}},
1413cdf0e10cSrcweir     {"dingbats",        {aMonotypeSortsTab, "StarSymbol", NULL}},
1414cdf0e10cSrcweir 
1415cdf0e10cSrcweir     {"webdings",        {aWebDingsTab,   "StarSymbol", NULL}},
1416cdf0e10cSrcweir     {"wingdings",       {aWingDingsTab,  "StarSymbol", NULL}},
1417cdf0e10cSrcweir     {"wingdings2",      {aWingDings2Tab, "StarSymbol", NULL}},
1418cdf0e10cSrcweir     {"wingdings3",      {aWingDings3Tab, "StarSymbol", NULL}},
1419cdf0e10cSrcweir     {"mtextra",         {aMTExtraTab, "StarSymbol", NULL}}
1420cdf0e10cSrcweir };
1421cdf0e10cSrcweir 
1422cdf0e10cSrcweir static ConvertChar aImplStarSymbolCvt = { NULL, "StarBats", ImplStarSymbolToStarBats };
1423cdf0e10cSrcweir 
1424cdf0e10cSrcweir // -----------------------------------------------------------------------
1425cdf0e10cSrcweir 
GetRecodeData(const String & rOrgFontName,const String & rMapFontName)1426cdf0e10cSrcweir const ConvertChar* ConvertChar::GetRecodeData( const String& rOrgFontName, const String& rMapFontName )
1427cdf0e10cSrcweir {
1428cdf0e10cSrcweir     const ConvertChar* pCvt = NULL;
1429cdf0e10cSrcweir     String aOrgName( rOrgFontName );
1430cdf0e10cSrcweir     GetEnglishSearchFontName( aOrgName );
1431cdf0e10cSrcweir     String aMapName( rMapFontName );
1432cdf0e10cSrcweir     GetEnglishSearchFontName( aMapName );
1433cdf0e10cSrcweir 
1434cdf0e10cSrcweir     if( aMapName.EqualsAscii( "starsymbol" )
1435cdf0e10cSrcweir      || aMapName.EqualsAscii( "opensymbol" ) )
1436cdf0e10cSrcweir     {
1437cdf0e10cSrcweir         int nEntries = sizeof(aRecodeTable) / sizeof(aRecodeTable[0]);
1438cdf0e10cSrcweir         for( int i = 0; i < nEntries; ++i)
1439cdf0e10cSrcweir         {
1440cdf0e10cSrcweir             RecodeTable& r = aRecodeTable[i];
1441cdf0e10cSrcweir             if( aOrgName.EqualsAscii( r.pOrgName ) )
1442cdf0e10cSrcweir                 { pCvt = &r.aCvt; break; }
1443cdf0e10cSrcweir         }
1444cdf0e10cSrcweir     }
1445cdf0e10cSrcweir     else if( aMapName.EqualsAscii( "starbats" ) )
1446cdf0e10cSrcweir     {
1447cdf0e10cSrcweir         if( aOrgName.EqualsAscii( "starsymbol" ) )
1448cdf0e10cSrcweir             pCvt = &aImplStarSymbolCvt;
1449cdf0e10cSrcweir         else if( aOrgName.EqualsAscii( "opensymbol" ) )
1450cdf0e10cSrcweir             pCvt = &aImplStarSymbolCvt;
1451cdf0e10cSrcweir     }
1452cdf0e10cSrcweir 
1453cdf0e10cSrcweir     return pCvt;
1454cdf0e10cSrcweir }
1455cdf0e10cSrcweir 
1456cdf0e10cSrcweir //=======================================================================
1457cdf0e10cSrcweir 
CreateFontToSubsFontConverter(const String & rOrgName,sal_uLong nFlags)1458cdf0e10cSrcweir FontToSubsFontConverter CreateFontToSubsFontConverter(
1459cdf0e10cSrcweir     const String& rOrgName, sal_uLong nFlags )
1460cdf0e10cSrcweir {
1461cdf0e10cSrcweir     const ConvertChar* pCvt = NULL;
1462cdf0e10cSrcweir 
1463cdf0e10cSrcweir     String aName = rOrgName;
1464cdf0e10cSrcweir     GetEnglishSearchFontName( aName );
1465cdf0e10cSrcweir 
1466cdf0e10cSrcweir     if ( nFlags & FONTTOSUBSFONT_IMPORT )
1467cdf0e10cSrcweir     {
1468cdf0e10cSrcweir         int nEntries = sizeof(aRecodeTable) / sizeof(aRecodeTable[0]);
1469cdf0e10cSrcweir         if ( nFlags & FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS ) // only StarMath+StarBats
1470cdf0e10cSrcweir             nEntries = 2;
1471cdf0e10cSrcweir         for( int i = 0; i < nEntries; ++i )
1472cdf0e10cSrcweir         {
1473cdf0e10cSrcweir             RecodeTable& r = aRecodeTable[i];
1474cdf0e10cSrcweir             if( aName.EqualsAscii( r.pOrgName ) )
1475cdf0e10cSrcweir                 { pCvt = &r.aCvt; break; }
1476cdf0e10cSrcweir         }
1477cdf0e10cSrcweir     }
1478cdf0e10cSrcweir     else
1479cdf0e10cSrcweir     {
1480cdf0e10cSrcweir         // TODO: FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS
1481cdf0e10cSrcweir         if( aName.EqualsAscii( "starsymbol" ) )       pCvt = &aImplStarSymbolCvt;
1482cdf0e10cSrcweir         else if( aName.EqualsAscii( "opensymbol" ) )  pCvt = &aImplStarSymbolCvt;
1483cdf0e10cSrcweir     }
1484cdf0e10cSrcweir 
1485cdf0e10cSrcweir     return (FontToSubsFontConverter)pCvt;
1486cdf0e10cSrcweir }
1487cdf0e10cSrcweir 
1488cdf0e10cSrcweir // -----------------------------------------------------------------------
1489cdf0e10cSrcweir 
DestroyFontToSubsFontConverter(FontToSubsFontConverter)1490cdf0e10cSrcweir void DestroyFontToSubsFontConverter( FontToSubsFontConverter )
1491cdf0e10cSrcweir {
1492cdf0e10cSrcweir     // nothing to do for now, because we use static ImplCvtChars
1493cdf0e10cSrcweir }
1494cdf0e10cSrcweir 
1495cdf0e10cSrcweir // -----------------------------------------------------------------------
1496cdf0e10cSrcweir 
ConvertFontToSubsFontChar(FontToSubsFontConverter hConverter,sal_Unicode cChar)1497cdf0e10cSrcweir sal_Unicode ConvertFontToSubsFontChar(
1498cdf0e10cSrcweir     FontToSubsFontConverter hConverter, sal_Unicode cChar )
1499cdf0e10cSrcweir {
1500cdf0e10cSrcweir     if ( hConverter )
1501cdf0e10cSrcweir         return ((ConvertChar*)hConverter)->RecodeChar( cChar );
1502cdf0e10cSrcweir     else
1503cdf0e10cSrcweir         return cChar;
1504cdf0e10cSrcweir }
1505cdf0e10cSrcweir 
1506cdf0e10cSrcweir // -----------------------------------------------------------------------
1507cdf0e10cSrcweir 
GetFontToSubsFontName(FontToSubsFontConverter hConverter)1508cdf0e10cSrcweir String GetFontToSubsFontName( FontToSubsFontConverter hConverter )
1509cdf0e10cSrcweir {
1510cdf0e10cSrcweir     if ( !hConverter )
1511cdf0e10cSrcweir         return String();
1512cdf0e10cSrcweir 
1513cdf0e10cSrcweir     const char* pName = ((ConvertChar*)hConverter)->mpSubsFontName;
1514cdf0e10cSrcweir     return String::CreateFromAscii( pName );
1515cdf0e10cSrcweir }
1516cdf0e10cSrcweir 
1517