|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 ** |
|
7 ** This file is part of the test suite of the Qt Toolkit. |
|
8 ** |
|
9 ** $QT_BEGIN_LICENSE:LGPL$ |
|
10 ** No Commercial Usage |
|
11 ** This file contains pre-release code and may not be distributed. |
|
12 ** You may use this file in accordance with the terms and conditions |
|
13 ** contained in the Technology Preview License Agreement accompanying |
|
14 ** this package. |
|
15 ** |
|
16 ** GNU Lesser General Public License Usage |
|
17 ** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 ** General Public License version 2.1 as published by the Free Software |
|
19 ** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 ** packaging of this file. Please review the following information to |
|
21 ** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 ** |
|
24 ** In addition, as a special exception, Nokia gives you certain additional |
|
25 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 ** |
|
28 ** If you have questions regarding the use of this file, please contact |
|
29 ** Nokia at qt-info@nokia.com. |
|
30 ** |
|
31 ** |
|
32 ** |
|
33 ** |
|
34 ** |
|
35 ** |
|
36 ** |
|
37 ** |
|
38 ** $QT_END_LICENSE$ |
|
39 ** |
|
40 ****************************************************************************/ |
|
41 |
|
42 |
|
43 |
|
44 #ifdef Q_WS_X11 |
|
45 #define private public |
|
46 #endif |
|
47 |
|
48 // cannot do private -> public on windows since it seems to mess up some stl headers |
|
49 #include <qfont.h> |
|
50 |
|
51 #ifdef Q_WS_X11 |
|
52 #undef private |
|
53 #endif |
|
54 |
|
55 #include <QtTest/QtTest> |
|
56 |
|
57 |
|
58 |
|
59 #if defined(Q_WS_X11) |
|
60 #define private public |
|
61 #include <private/qtextengine_p.h> |
|
62 #include <qtextlayout.h> |
|
63 #undef private |
|
64 #endif |
|
65 |
|
66 #include <qfontdatabase.h> |
|
67 #include <qfontinfo.h> |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 //TESTED_CLASS= |
|
74 //TESTED_FILES= gui/text/qscriptengine.cpp |
|
75 |
|
76 // This test depends on the fonts in the following package being installed: |
|
77 // http://people.freedesktop.org/~hausmann/harfbuzz-test-fonts-0.1.tar.bz2 |
|
78 |
|
79 class tst_QTextScriptEngine : public QObject |
|
80 { |
|
81 Q_OBJECT |
|
82 |
|
83 public: |
|
84 tst_QTextScriptEngine(); |
|
85 virtual ~tst_QTextScriptEngine(); |
|
86 |
|
87 |
|
88 public slots: |
|
89 void init(); |
|
90 void cleanup(); |
|
91 private slots: |
|
92 void devanagari(); |
|
93 void bengali(); |
|
94 void gurmukhi(); |
|
95 // gujarati missing |
|
96 void oriya(); |
|
97 void tamil(); |
|
98 void telugu(); |
|
99 void kannada(); |
|
100 void malayalam(); |
|
101 void sinhala(); |
|
102 |
|
103 void khmer(); |
|
104 void linearB(); |
|
105 }; |
|
106 |
|
107 tst_QTextScriptEngine::tst_QTextScriptEngine() |
|
108 { |
|
109 } |
|
110 |
|
111 tst_QTextScriptEngine::~tst_QTextScriptEngine() |
|
112 { |
|
113 } |
|
114 |
|
115 void tst_QTextScriptEngine::init() |
|
116 { |
|
117 } |
|
118 |
|
119 void tst_QTextScriptEngine::cleanup() |
|
120 { |
|
121 } |
|
122 |
|
123 struct ShapeTable { |
|
124 unsigned short unicode[16]; |
|
125 unsigned short glyphs[16]; |
|
126 }; |
|
127 |
|
128 #if defined(Q_WS_X11) |
|
129 static bool shaping( const QFont &f, const ShapeTable *s) |
|
130 { |
|
131 QString str = QString::fromUtf16( s->unicode ); |
|
132 QTextLayout layout(str, f); |
|
133 QTextEngine *e = layout.d; |
|
134 e->itemize(); |
|
135 e->shape(0); |
|
136 |
|
137 int nglyphs = 0; |
|
138 const unsigned short *g = s->glyphs; |
|
139 while ( *g ) { |
|
140 nglyphs++; |
|
141 g++; |
|
142 } |
|
143 |
|
144 if( nglyphs != e->layoutData->items[0].num_glyphs ) |
|
145 goto error; |
|
146 |
|
147 for (int i = 0; i < nglyphs; ++i) { |
|
148 if ((e->layoutData->glyphLayout.glyphs[i] & 0xffffff) != s->glyphs[i]) |
|
149 goto error; |
|
150 } |
|
151 return true; |
|
152 error: |
|
153 str = ""; |
|
154 const unsigned short *uc = s->unicode; |
|
155 while (*uc) { |
|
156 str += QString("%1 ").arg(*uc, 4, 16); |
|
157 ++uc; |
|
158 } |
|
159 qDebug("%s: shaping of string %s failed, nglyphs=%d, expected %d", |
|
160 f.family().toLatin1().constData(), |
|
161 str.toLatin1().constData(), |
|
162 e->layoutData->items[0].num_glyphs, nglyphs); |
|
163 |
|
164 str = ""; |
|
165 int i = 0; |
|
166 while (i < e->layoutData->items[0].num_glyphs) { |
|
167 str += QString("%1 ").arg(e->layoutData->glyphLayout.glyphs[i], 4, 16); |
|
168 ++i; |
|
169 } |
|
170 qDebug(" glyph result = %s", str.toLatin1().constData()); |
|
171 return false; |
|
172 } |
|
173 #endif |
|
174 |
|
175 void tst_QTextScriptEngine::devanagari() |
|
176 { |
|
177 #if defined(Q_WS_X11) |
|
178 { |
|
179 if (QFontDatabase().families(QFontDatabase::Devanagari).contains("Raghindi")) { |
|
180 QFont f("Raghindi"); |
|
181 const ShapeTable shape_table [] = { |
|
182 // Ka |
|
183 { { 0x0915, 0x0 }, |
|
184 { 0x0080, 0x0 } }, |
|
185 // Ka Halant |
|
186 { { 0x0915, 0x094d, 0x0 }, |
|
187 { 0x0080, 0x0051, 0x0 } }, |
|
188 // Ka Halant Ka |
|
189 { { 0x0915, 0x094d, 0x0915, 0x0 }, |
|
190 { 0x00c8, 0x0080, 0x0 } }, |
|
191 // Ka MatraI |
|
192 { { 0x0915, 0x093f, 0x0 }, |
|
193 { 0x01d1, 0x0080, 0x0 } }, |
|
194 // Ra Halant Ka |
|
195 { { 0x0930, 0x094d, 0x0915, 0x0 }, |
|
196 { 0x0080, 0x005b, 0x0 } }, |
|
197 // Ra Halant Ka MatraI |
|
198 { { 0x0930, 0x094d, 0x0915, 0x093f, 0x0 }, |
|
199 { 0x01d1, 0x0080, 0x005b, 0x0 } }, |
|
200 // MatraI |
|
201 { { 0x093f, 0x0 }, |
|
202 { 0x01d4, 0x029c, 0x0 } }, |
|
203 // Ka Nukta |
|
204 { { 0x0915, 0x093c, 0x0 }, |
|
205 { 0x00a4, 0x0 } }, |
|
206 // Ka Halant Ra |
|
207 { { 0x0915, 0x094d, 0x0930, 0x0 }, |
|
208 { 0x0110, 0x0 } }, |
|
209 // Ka Halant Ra Halant Ka |
|
210 { { 0x0915, 0x094d, 0x0930, 0x094d, 0x0915, 0x0 }, |
|
211 { 0x0158, 0x0080, 0x0 } }, |
|
212 { { 0x0930, 0x094d, 0x200d, 0x0 }, |
|
213 { 0x00e2, 0x0 } }, |
|
214 { { 0x0915, 0x094d, 0x0930, 0x094d, 0x200d, 0x0 }, |
|
215 { 0x0158, 0x0 } }, |
|
216 |
|
217 { {0}, {0} } |
|
218 }; |
|
219 |
|
220 |
|
221 const ShapeTable *s = shape_table; |
|
222 while (s->unicode[0]) { |
|
223 QVERIFY( shaping(f, s) ); |
|
224 ++s; |
|
225 } |
|
226 } else { |
|
227 QSKIP("couln't find Raghindi", SkipAll); |
|
228 } |
|
229 } |
|
230 |
|
231 { |
|
232 if (QFontDatabase().families(QFontDatabase::Devanagari).contains("Mangal")) { |
|
233 QFont f("Mangal"); |
|
234 const ShapeTable shape_table [] = { |
|
235 // Ka |
|
236 { { 0x0915, 0x0 }, |
|
237 { 0x0080, 0x0 } }, |
|
238 // Ka Halant |
|
239 { { 0x0915, 0x094d, 0x0 }, |
|
240 { 0x0080, 0x0051, 0x0 } }, |
|
241 // Ka Halant Ka |
|
242 { { 0x0915, 0x094d, 0x0915, 0x0 }, |
|
243 { 0x00c8, 0x0080, 0x0 } }, |
|
244 // Ka MatraI |
|
245 { { 0x0915, 0x093f, 0x0 }, |
|
246 { 0x01d1, 0x0080, 0x0 } }, |
|
247 // Ra Halant Ka |
|
248 { { 0x0930, 0x094d, 0x0915, 0x0 }, |
|
249 { 0x0080, 0x005b, 0x0 } }, |
|
250 // Ra Halant Ka MatraI |
|
251 { { 0x0930, 0x094d, 0x0915, 0x093f, 0x0 }, |
|
252 { 0x01d1, 0x0080, 0x005b, 0x0 } }, |
|
253 // MatraI |
|
254 { { 0x093f, 0x0 }, |
|
255 { 0x01d4, 0x029c, 0x0 } }, |
|
256 // Ka Nukta |
|
257 { { 0x0915, 0x093c, 0x0 }, |
|
258 { 0x00a4, 0x0 } }, |
|
259 // Ka Halant Ra |
|
260 { { 0x0915, 0x094d, 0x0930, 0x0 }, |
|
261 { 0x0110, 0x0 } }, |
|
262 // Ka Halant Ra Halant Ka |
|
263 { { 0x0915, 0x094d, 0x0930, 0x094d, 0x0915, 0x0 }, |
|
264 { 0x0158, 0x0080, 0x0 } }, |
|
265 |
|
266 { { 0x92b, 0x94d, 0x930, 0x0 }, |
|
267 { 0x125, 0x0 } }, |
|
268 { { 0x92b, 0x93c, 0x94d, 0x930, 0x0 }, |
|
269 { 0x149, 0x0 } }, |
|
270 { {0}, {0} } |
|
271 }; |
|
272 |
|
273 const ShapeTable *s = shape_table; |
|
274 while (s->unicode[0]) { |
|
275 QVERIFY( shaping(f, s) ); |
|
276 ++s; |
|
277 } |
|
278 } else { |
|
279 QSKIP("couldn't find mangal", SkipAll); |
|
280 } |
|
281 } |
|
282 #else |
|
283 QSKIP("X11 specific test", SkipAll); |
|
284 #endif |
|
285 } |
|
286 |
|
287 void tst_QTextScriptEngine::bengali() |
|
288 { |
|
289 #if defined(Q_WS_X11) |
|
290 { |
|
291 if (QFontDatabase().families(QFontDatabase::Bengali).contains("Akaash")) { |
|
292 QFont f("Akaash"); |
|
293 const ShapeTable shape_table [] = { |
|
294 // Ka |
|
295 { { 0x0995, 0x0 }, |
|
296 { 0x0151, 0x0 } }, |
|
297 // Ka Halant |
|
298 { { 0x0995, 0x09cd, 0x0 }, |
|
299 { 0x0151, 0x017d, 0x0 } }, |
|
300 // Ka Halant Ka |
|
301 { { 0x0995, 0x09cd, 0x0995, 0x0 }, |
|
302 { 0x019b, 0x0 } }, |
|
303 // Ka MatraI |
|
304 { { 0x0995, 0x09bf, 0x0 }, |
|
305 { 0x0173, 0x0151, 0x0 } }, |
|
306 // Ra Halant Ka |
|
307 { { 0x09b0, 0x09cd, 0x0995, 0x0 }, |
|
308 { 0x0151, 0x0276, 0x0 } }, |
|
309 // Ra Halant Ka MatraI |
|
310 { { 0x09b0, 0x09cd, 0x0995, 0x09bf, 0x0 }, |
|
311 { 0x0173, 0x0151, 0x0276, 0x0 } }, |
|
312 // Ka Nukta |
|
313 { { 0x0995, 0x09bc, 0x0 }, |
|
314 { 0x0151, 0x0171, 0x0 } }, |
|
315 // Ka Halant Ra |
|
316 { { 0x0995, 0x09cd, 0x09b0, 0x0 }, |
|
317 { 0x01f4, 0x0 } }, |
|
318 // Ka Halant Ra Halant Ka |
|
319 { { 0x0995, 0x09cd, 0x09b0, 0x09cd, 0x0995, 0x0 }, |
|
320 { 0x025c, 0x0276, 0x0151, 0x0 } }, |
|
321 // Ya + Halant |
|
322 { { 0x09af, 0x09cd, 0x0 }, |
|
323 { 0x016a, 0x017d, 0x0 } }, |
|
324 // Da Halant Ya -> Da Ya-Phala |
|
325 { { 0x09a6, 0x09cd, 0x09af, 0x0 }, |
|
326 { 0x01e5, 0x0 } }, |
|
327 // A Halant Ya -> A Ya-phala |
|
328 { { 0x0985, 0x09cd, 0x09af, 0x0 }, |
|
329 { 0x0145, 0x01cf, 0x0 } }, |
|
330 // Na Halant Ka |
|
331 { { 0x09a8, 0x09cd, 0x0995, 0x0 }, |
|
332 { 0x026f, 0x0151, 0x0 } }, |
|
333 // Na Halant ZWNJ Ka |
|
334 { { 0x09a8, 0x09cd, 0x200c, 0x0995, 0x0 }, |
|
335 { 0x0164, 0x017d, 0x0151, 0x0 } }, |
|
336 // Na Halant ZWJ Ka |
|
337 { { 0x09a8, 0x09cd, 0x200d, 0x0995, 0x0 }, |
|
338 { 0x026f, 0x0151, 0x0 } }, |
|
339 // Ka Halant ZWNJ Ka |
|
340 { { 0x0995, 0x09cd, 0x200c, 0x0995, 0x0 }, |
|
341 { 0x0151, 0x017d, 0x0151, 0x0 } }, |
|
342 // Ka Halant ZWJ Ka |
|
343 { { 0x0995, 0x09cd, 0x200d, 0x0995, 0x0 }, |
|
344 { 0x025c, 0x0151, 0x0 } }, |
|
345 // Na Halant Ra |
|
346 { { 0x09a8, 0x09cd, 0x09b0, 0x0 }, |
|
347 { 0x0207, 0x0 } }, |
|
348 // Na Halant ZWNJ Ra |
|
349 { { 0x09a8, 0x09cd, 0x200c, 0x09b0, 0x0 }, |
|
350 { 0x0164, 0x017d, 0x016b, 0x0 } }, |
|
351 // Na Halant ZWJ Ra |
|
352 { { 0x09a8, 0x09cd, 0x200d, 0x09b0, 0x0 }, |
|
353 { 0x026f, 0x016b, 0x0 } }, |
|
354 // Na Halant Ba |
|
355 { { 0x09a8, 0x09cd, 0x09ac, 0x0 }, |
|
356 { 0x022f, 0x0 } }, |
|
357 // Na Halant ZWNJ Ba |
|
358 { { 0x09a8, 0x09cd, 0x200c, 0x09ac, 0x0 }, |
|
359 { 0x0164, 0x017d, 0x0167, 0x0 } }, |
|
360 // Na Halant ZWJ Ba |
|
361 { { 0x09a8, 0x09cd, 0x200d, 0x09ac, 0x0 }, |
|
362 { 0x026f, 0x0167, 0x0 } }, |
|
363 // Na Halant Dha |
|
364 { { 0x09a8, 0x09cd, 0x09a7, 0x0 }, |
|
365 { 0x01d3, 0x0 } }, |
|
366 // Na Halant ZWNJ Dha |
|
367 { { 0x09a8, 0x09cd, 0x200c, 0x09a7, 0x0 }, |
|
368 { 0x0164, 0x017d, 0x0163, 0x0 } }, |
|
369 // Na Halant ZWJ Dha |
|
370 { { 0x09a8, 0x09cd, 0x200d, 0x09a7, 0x0 }, |
|
371 { 0x026f, 0x0163, 0x0 } }, |
|
372 // Ra Halant Ka MatraAU |
|
373 { { 0x09b0, 0x09cd, 0x0995, 0x09cc, 0x0 }, |
|
374 { 0x0179, 0x0151, 0x0276, 0x017e, 0x0 } }, |
|
375 // Ra Halant Ba Halant Ba |
|
376 { { 0x09b0, 0x09cd, 0x09ac, 0x09cd, 0x09ac, 0x0 }, |
|
377 { 0x0232, 0x0276, 0x0 } }, |
|
378 { { 0x9b0, 0x9cd, 0x995, 0x9be, 0x982, 0x0 }, |
|
379 { 0x151, 0x276, 0x172, 0x143, 0x0 } }, |
|
380 { { 0x9b0, 0x9cd, 0x995, 0x9be, 0x983, 0x0 }, |
|
381 { 0x151, 0x276, 0x172, 0x144, 0x0 } }, |
|
382 // test decomposed two parts matras |
|
383 { { 0x995, 0x9c7, 0x9be, 0x0 }, |
|
384 { 0x179, 0x151, 0x172, 0x0 } }, |
|
385 { { 0x995, 0x9c7, 0x9d7, 0x0 }, |
|
386 { 0x179, 0x151, 0x17e, 0x0 } }, |
|
387 { {0}, {0} } |
|
388 }; |
|
389 |
|
390 |
|
391 const ShapeTable *s = shape_table; |
|
392 while (s->unicode[0]) { |
|
393 QVERIFY( shaping(f, s) ); |
|
394 ++s; |
|
395 } |
|
396 } else { |
|
397 QSKIP("couln't find Akaash", SkipAll); |
|
398 } |
|
399 } |
|
400 { |
|
401 if (QFontDatabase().families(QFontDatabase::Bengali).contains("Mukti Narrow")) { |
|
402 QFont f("Mukti Narrow"); |
|
403 const ShapeTable shape_table [] = { |
|
404 // Ka |
|
405 { { 0x0995, 0x0 }, |
|
406 { 0x0073, 0x0 } }, |
|
407 // Ka Halant |
|
408 { { 0x0995, 0x09cd, 0x0 }, |
|
409 { 0x00b9, 0x0 } }, |
|
410 // Ka Halant Ka |
|
411 { { 0x0995, 0x09cd, 0x0995, 0x0 }, |
|
412 { 0x0109, 0x0 } }, |
|
413 // Ka MatraI |
|
414 { { 0x0995, 0x09bf, 0x0 }, |
|
415 { 0x0095, 0x0073, 0x0 } }, |
|
416 // Ra Halant Ka |
|
417 { { 0x09b0, 0x09cd, 0x0995, 0x0 }, |
|
418 { 0x0073, 0x00e1, 0x0 } }, |
|
419 // Ra Halant Ka MatraI |
|
420 { { 0x09b0, 0x09cd, 0x0995, 0x09bf, 0x0 }, |
|
421 { 0x0095, 0x0073, 0x00e1, 0x0 } }, |
|
422 // MatraI |
|
423 { { 0x09bf, 0x0 }, |
|
424 { 0x0095, 0x01c8, 0x0 } }, |
|
425 // Ka Nukta |
|
426 { { 0x0995, 0x09bc, 0x0 }, |
|
427 { 0x0073, 0x0093, 0x0 } }, |
|
428 // Ka Halant Ra |
|
429 { { 0x0995, 0x09cd, 0x09b0, 0x0 }, |
|
430 { 0x00e5, 0x0 } }, |
|
431 // Ka Halant Ra Halant Ka |
|
432 { { 0x995, 0x9cd, 0x9b0, 0x9cd, 0x995, 0x0 }, |
|
433 { 0x234, 0x24e, 0x73, 0x0 } }, |
|
434 // Ya + Halant |
|
435 { { 0x09af, 0x09cd, 0x0 }, |
|
436 { 0x00d2, 0x0 } }, |
|
437 // Da Halant Ya -> Da Ya-Phala |
|
438 { { 0x09a6, 0x09cd, 0x09af, 0x0 }, |
|
439 { 0x0084, 0x00e2, 0x0 } }, |
|
440 // A Halant Ya -> A Ya-phala |
|
441 { { 0x0985, 0x09cd, 0x09af, 0x0 }, |
|
442 { 0x0067, 0x00e2, 0x0 } }, |
|
443 // Na Halant Ka |
|
444 { { 0x09a8, 0x09cd, 0x0995, 0x0 }, |
|
445 { 0x0188, 0x0 } }, |
|
446 // Na Halant ZWNJ Ka |
|
447 { { 0x9a8, 0x9cd, 0x200c, 0x995, 0x0 }, |
|
448 { 0xcc, 0x73, 0x0 } }, |
|
449 // Na Halant ZWJ Ka |
|
450 { { 0x9a8, 0x9cd, 0x200d, 0x995, 0x0 }, |
|
451 { 0x247, 0x73, 0x0 } }, |
|
452 // Ka Halant ZWNJ Ka |
|
453 { { 0x9a8, 0x9cd, 0x200d, 0x995, 0x0 }, |
|
454 { 0x247, 0x73, 0x0 } }, |
|
455 // Ka Halant ZWJ Ka |
|
456 { { 0x9a8, 0x9cd, 0x200d, 0x995, 0x0 }, |
|
457 { 0x247, 0x73, 0x0 } }, |
|
458 // Na Halant Ra |
|
459 { { 0x09a8, 0x09cd, 0x09b0, 0x0 }, |
|
460 { 0x00f8, 0x0 } }, |
|
461 // Na Halant ZWNJ Ra |
|
462 { { 0x09a8, 0x09cd, 0x200c, 0x09b0, 0x0 }, |
|
463 { 0xcc, 0x8d, 0x0 } }, |
|
464 // Na Halant ZWJ Ra |
|
465 { { 0x9a8, 0x9cd, 0x200d, 0x9b0, 0x0 }, |
|
466 { 0x247, 0x8d, 0x0 } }, |
|
467 // Na Halant Ba |
|
468 { { 0x09a8, 0x09cd, 0x09ac, 0x0 }, |
|
469 { 0x0139, 0x0 } }, |
|
470 // Na Halant ZWNJ Ba |
|
471 { { 0x9a8, 0x9cd, 0x200c, 0x9ac, 0x0 }, |
|
472 { 0xcc, 0x89, 0x0 } }, |
|
473 // Na Halant ZWJ Ba |
|
474 { { 0x9a8, 0x9cd, 0x200d, 0x9ac, 0x0 }, |
|
475 { 0x247, 0x89, 0x0 } }, |
|
476 // Na Halant Dha |
|
477 { { 0x09a8, 0x09cd, 0x09a7, 0x0 }, |
|
478 { 0x0145, 0x0 } }, |
|
479 // Na Halant ZWNJ Dha |
|
480 { { 0x09a8, 0x09cd, 0x200c, 0x09a7, 0x0 }, |
|
481 { 0xcc, 0x85, 0x0 } }, |
|
482 // Na Halant ZWJ Dha |
|
483 { { 0x09a8, 0x09cd, 0x200d, 0x09a7, 0x0 }, |
|
484 { 0x247, 0x85, 0x0 } }, |
|
485 // Ra Halant Ka MatraAU |
|
486 { { 0x9b0, 0x9cd, 0x995, 0x9cc, 0x0 }, |
|
487 { 0x232, 0x73, 0xe1, 0xa0, 0x0 } }, |
|
488 // Ra Halant Ba Halant Ba |
|
489 { { 0x09b0, 0x09cd, 0x09ac, 0x09cd, 0x09ac, 0x0 }, |
|
490 { 0x013b, 0x00e1, 0x0 } }, |
|
491 |
|
492 { {0}, {0} } |
|
493 }; |
|
494 |
|
495 |
|
496 const ShapeTable *s = shape_table; |
|
497 while (s->unicode[0]) { |
|
498 QVERIFY( shaping(f, s) ); |
|
499 ++s; |
|
500 } |
|
501 } else { |
|
502 QSKIP("couln't find Mukti", SkipAll); |
|
503 } |
|
504 } |
|
505 { |
|
506 if (QFontDatabase().families(QFontDatabase::Bengali).contains("Likhan")) { |
|
507 QFont f("Likhan"); |
|
508 const ShapeTable shape_table [] = { |
|
509 { { 0x9a8, 0x9cd, 0x9af, 0x0 }, |
|
510 { 0x1ca, 0x0 } }, |
|
511 { { 0x09b8, 0x09cd, 0x09af, 0x0 }, |
|
512 { 0x020e, 0x0 } }, |
|
513 { { 0x09b6, 0x09cd, 0x09af, 0x0 }, |
|
514 { 0x01f4, 0x0 } }, |
|
515 { { 0x09b7, 0x09cd, 0x09af, 0x0 }, |
|
516 { 0x01fe, 0x0 } }, |
|
517 { { 0x09b0, 0x09cd, 0x09a8, 0x09cd, 0x200d, 0x0 }, |
|
518 { 0x10b, 0x167, 0x0 } }, |
|
519 |
|
520 { {0}, {0} } |
|
521 }; |
|
522 |
|
523 |
|
524 const ShapeTable *s = shape_table; |
|
525 while (s->unicode[0]) { |
|
526 QVERIFY( shaping(f, s) ); |
|
527 ++s; |
|
528 } |
|
529 } else { |
|
530 QSKIP("couln't find Likhan", SkipAll); |
|
531 } |
|
532 } |
|
533 #else |
|
534 QSKIP("X11 specific test", SkipAll); |
|
535 #endif |
|
536 } |
|
537 |
|
538 void tst_QTextScriptEngine::gurmukhi() |
|
539 { |
|
540 #if defined(Q_WS_X11) |
|
541 { |
|
542 if (QFontDatabase().families(QFontDatabase::Gurmukhi).contains("Lohit Punjabi")) { |
|
543 QFont f("Lohit Punjabi"); |
|
544 const ShapeTable shape_table [] = { |
|
545 { { 0xA15, 0xA4D, 0xa39, 0x0 }, |
|
546 { 0x3b, 0x8b, 0x0 } }, |
|
547 { {0}, {0} } |
|
548 }; |
|
549 |
|
550 |
|
551 const ShapeTable *s = shape_table; |
|
552 while (s->unicode[0]) { |
|
553 QVERIFY( shaping(f, s) ); |
|
554 ++s; |
|
555 } |
|
556 } else { |
|
557 QSKIP("couln't find Lohit Punjabi", SkipAll); |
|
558 } |
|
559 } |
|
560 #endif |
|
561 } |
|
562 |
|
563 void tst_QTextScriptEngine::oriya() |
|
564 { |
|
565 #if defined(Q_WS_X11) |
|
566 { |
|
567 if (QFontDatabase().families(QFontDatabase::Oriya).contains("utkal")) { |
|
568 QFont f("utkal"); |
|
569 const ShapeTable shape_table [] = { |
|
570 { { 0xb15, 0xb4d, 0xb24, 0xb4d, 0xb30, 0x0 }, |
|
571 { 0x150, 0x125, 0x0 } }, |
|
572 { { 0xb24, 0xb4d, 0xb24, 0xb4d, 0xb2c, 0x0 }, |
|
573 { 0x151, 0x120, 0x0 } }, |
|
574 { { 0xb28, 0xb4d, 0xb24, 0xb4d, 0xb2c, 0x0 }, |
|
575 { 0x152, 0x120, 0x0 } }, |
|
576 { { 0xb28, 0xb4d, 0xb24, 0xb4d, 0xb2c, 0x0 }, |
|
577 { 0x152, 0x120, 0x0 } }, |
|
578 { { 0xb28, 0xb4d, 0xb24, 0xb4d, 0xb30, 0x0 }, |
|
579 { 0x176, 0x0 } }, |
|
580 { { 0xb38, 0xb4d, 0xb24, 0xb4d, 0xb30, 0x0 }, |
|
581 { 0x177, 0x0 } }, |
|
582 { { 0xb28, 0xb4d, 0xb24, 0xb4d, 0xb30, 0xb4d, 0xb2f, 0x0 }, |
|
583 { 0x176, 0x124, 0x0 } }, |
|
584 { {0}, {0} } |
|
585 |
|
586 }; |
|
587 |
|
588 const ShapeTable *s = shape_table; |
|
589 while (s->unicode[0]) { |
|
590 QVERIFY( shaping(f, s) ); |
|
591 ++s; |
|
592 } |
|
593 } else { |
|
594 QSKIP("couln't find utkal", SkipAll); |
|
595 } |
|
596 } |
|
597 #else |
|
598 QSKIP("X11 specific test", SkipAll); |
|
599 #endif |
|
600 } |
|
601 |
|
602 |
|
603 void tst_QTextScriptEngine::tamil() |
|
604 { |
|
605 #if defined(Q_WS_X11) |
|
606 { |
|
607 if (QFontDatabase().families(QFontDatabase::Tamil).contains("AkrutiTml1")) { |
|
608 QFont f("AkrutiTml1"); |
|
609 const ShapeTable shape_table [] = { |
|
610 { { 0x0b95, 0x0bc2, 0x0 }, |
|
611 { 0x004e, 0x0 } }, |
|
612 { { 0x0bae, 0x0bc2, 0x0 }, |
|
613 { 0x009e, 0x0 } }, |
|
614 { { 0x0b9a, 0x0bc2, 0x0 }, |
|
615 { 0x0058, 0x0 } }, |
|
616 { { 0x0b99, 0x0bc2, 0x0 }, |
|
617 { 0x0053, 0x0 } }, |
|
618 { { 0x0bb0, 0x0bc2, 0x0 }, |
|
619 { 0x00a8, 0x0 } }, |
|
620 { { 0x0ba4, 0x0bc2, 0x0 }, |
|
621 { 0x008e, 0x0 } }, |
|
622 { { 0x0b9f, 0x0bc2, 0x0 }, |
|
623 { 0x0062, 0x0 } }, |
|
624 { { 0x0b95, 0x0bc6, 0x0 }, |
|
625 { 0x000a, 0x0031, 0x0 } }, |
|
626 { { 0x0b95, 0x0bca, 0x0 }, |
|
627 { 0x000a, 0x0031, 0x0007, 0x0 } }, |
|
628 { { 0x0b95, 0x0bc6, 0x0bbe, 0x0 }, |
|
629 { 0x000a, 0x0031, 0x007, 0x0 } }, |
|
630 { { 0x0b95, 0x0bcd, 0x0bb7, 0x0 }, |
|
631 { 0x0049, 0x0 } }, |
|
632 { { 0x0b95, 0x0bcd, 0x0bb7, 0x0bca, 0x0 }, |
|
633 { 0x000a, 0x0049, 0x007, 0x0 } }, |
|
634 { { 0x0b95, 0x0bcd, 0x0bb7, 0x0bc6, 0x0bbe, 0x0 }, |
|
635 { 0x000a, 0x0049, 0x007, 0x0 } }, |
|
636 { { 0x0b9f, 0x0bbf, 0x0 }, |
|
637 { 0x005f, 0x0 } }, |
|
638 { { 0x0b9f, 0x0bc0, 0x0 }, |
|
639 { 0x0060, 0x0 } }, |
|
640 { { 0x0bb2, 0x0bc0, 0x0 }, |
|
641 { 0x00ab, 0x0 } }, |
|
642 { { 0x0bb2, 0x0bbf, 0x0 }, |
|
643 { 0x00aa, 0x0 } }, |
|
644 { { 0x0bb0, 0x0bcd, 0x0 }, |
|
645 { 0x00a4, 0x0 } }, |
|
646 { { 0x0bb0, 0x0bbf, 0x0 }, |
|
647 { 0x00a5, 0x0 } }, |
|
648 { { 0x0bb0, 0x0bc0, 0x0 }, |
|
649 { 0x00a6, 0x0 } }, |
|
650 { { 0x0b83, 0x0 }, |
|
651 { 0x0025, 0x0 } }, |
|
652 { { 0x0b83, 0x0b95, 0x0 }, |
|
653 { 0x0025, 0x0031, 0x0 } }, |
|
654 { { 0xb95, 0xbc6, 0xbbe, 0x0 }, |
|
655 { 0xa, 0x31, 0x7, 0x0 } }, |
|
656 { { 0xb95, 0xbc7, 0xbbe, 0x0 }, |
|
657 { 0xb, 0x31, 0x7, 0x0 } }, |
|
658 { { 0xb95, 0xbc6, 0xbd7, 0x0 }, |
|
659 { 0xa, 0x31, 0x40, 0x0 } }, |
|
660 |
|
661 { {0}, {0} } |
|
662 }; |
|
663 |
|
664 |
|
665 const ShapeTable *s = shape_table; |
|
666 while (s->unicode[0]) { |
|
667 QVERIFY( shaping(f, s) ); |
|
668 ++s; |
|
669 } |
|
670 } else { |
|
671 QSKIP("couln't find AkrutiTml1", SkipAll); |
|
672 } |
|
673 } |
|
674 #else |
|
675 QSKIP("X11 specific test", SkipAll); |
|
676 #endif |
|
677 } |
|
678 |
|
679 |
|
680 void tst_QTextScriptEngine::telugu() |
|
681 { |
|
682 #if defined(Q_WS_X11) |
|
683 { |
|
684 if (QFontDatabase().families(QFontDatabase::Telugu).contains("Pothana2000")) { |
|
685 QFont f("Pothana2000"); |
|
686 const ShapeTable shape_table [] = { |
|
687 { { 0xc15, 0xc4d, 0x0 }, |
|
688 { 0xbb, 0x0 } }, |
|
689 { { 0xc15, 0xc4d, 0xc37, 0x0 }, |
|
690 { 0x4b, 0x0 } }, |
|
691 { { 0xc15, 0xc4d, 0xc37, 0xc4d, 0x0 }, |
|
692 { 0xe0, 0x0 } }, |
|
693 { { 0xc15, 0xc4d, 0xc37, 0xc4d, 0xc23, 0x0 }, |
|
694 { 0x4b, 0x91, 0x0 } }, |
|
695 { { 0xc15, 0xc4d, 0xc30, 0x0 }, |
|
696 { 0x5a, 0xb2, 0x0 } }, |
|
697 { { 0xc15, 0xc4d, 0xc30, 0xc4d, 0x0 }, |
|
698 { 0xbb, 0xb2, 0x0 } }, |
|
699 { { 0xc15, 0xc4d, 0xc30, 0xc4d, 0xc15, 0x0 }, |
|
700 { 0x5a, 0xb2, 0x83, 0x0 } }, |
|
701 { { 0xc15, 0xc4d, 0xc30, 0xc3f, 0x0 }, |
|
702 { 0xe2, 0xb2, 0x0 } }, |
|
703 { { 0xc15, 0xc4d, 0xc15, 0xc48, 0x0 }, |
|
704 { 0xe6, 0xb3, 0x83, 0x0 } }, |
|
705 { { 0xc15, 0xc4d, 0xc30, 0xc48, 0x0 }, |
|
706 { 0xe6, 0xb3, 0x9f, 0x0 } }, |
|
707 { { 0xc15, 0xc46, 0xc56, 0x0 }, |
|
708 { 0xe6, 0xb3, 0x0 } }, |
|
709 { {0}, {0} } |
|
710 |
|
711 }; |
|
712 |
|
713 const ShapeTable *s = shape_table; |
|
714 while (s->unicode[0]) { |
|
715 QVERIFY( shaping(f, s) ); |
|
716 ++s; |
|
717 } |
|
718 } else { |
|
719 QSKIP("couln't find Pothana2000", SkipAll); |
|
720 } |
|
721 } |
|
722 #else |
|
723 QSKIP("X11 specific test", SkipAll); |
|
724 #endif |
|
725 } |
|
726 |
|
727 |
|
728 void tst_QTextScriptEngine::kannada() |
|
729 { |
|
730 #if defined(Q_WS_X11) |
|
731 { |
|
732 if (QFontDatabase().families(QFontDatabase::Kannada).contains("Sampige")) { |
|
733 QFont f("Sampige"); |
|
734 const ShapeTable shape_table [] = { |
|
735 { { 0x0ca8, 0x0ccd, 0x0ca8, 0x0 }, |
|
736 { 0x0049, 0x00ba, 0x0 } }, |
|
737 { { 0x0ca8, 0x0ccd, 0x0ca1, 0x0 }, |
|
738 { 0x0049, 0x00b3, 0x0 } }, |
|
739 { { 0x0caf, 0x0cc2, 0x0 }, |
|
740 { 0x004f, 0x005d, 0x0 } }, |
|
741 { { 0x0ce0, 0x0 }, |
|
742 { 0x006a, 0x0 } }, |
|
743 { { 0x0ce6, 0x0ce7, 0x0ce8, 0x0 }, |
|
744 { 0x006b, 0x006c, 0x006d, 0x0 } }, |
|
745 { { 0x0cb5, 0x0ccb, 0x0 }, |
|
746 { 0x015f, 0x0067, 0x0 } }, |
|
747 { { 0x0cb0, 0x0ccd, 0x0cae, 0x0 }, |
|
748 { 0x004e, 0x0082, 0x0 } }, |
|
749 { { 0x0cb0, 0x0ccd, 0x0c95, 0x0 }, |
|
750 { 0x0036, 0x0082, 0x0 } }, |
|
751 { { 0x0c95, 0x0ccd, 0x0cb0, 0x0 }, |
|
752 { 0x0036, 0x00c1, 0x0 } }, |
|
753 { { 0x0cb0, 0x0ccd, 0x200d, 0x0c95, 0x0 }, |
|
754 { 0x0050, 0x00a7, 0x0 } }, |
|
755 |
|
756 { {0}, {0} } |
|
757 }; |
|
758 |
|
759 |
|
760 const ShapeTable *s = shape_table; |
|
761 while (s->unicode[0]) { |
|
762 QVERIFY( shaping(f, s) ); |
|
763 ++s; |
|
764 } |
|
765 } else { |
|
766 QSKIP("couln't find Sampige", SkipAll); |
|
767 } |
|
768 } |
|
769 { |
|
770 if (QFontDatabase().families(QFontDatabase::Kannada).contains("Tunga")) { |
|
771 QFont f("Tunga"); |
|
772 const ShapeTable shape_table [] = { |
|
773 { { 0x0cb7, 0x0cc6, 0x0 }, |
|
774 { 0x00b0, 0x006c, 0x0 } }, |
|
775 { { 0x0cb7, 0x0ccd, 0x0 }, |
|
776 { 0x0163, 0x0 } }, |
|
777 { { 0xc95, 0xcbf, 0xcd5, 0x0 }, |
|
778 { 0x114, 0x73, 0x0 } }, |
|
779 { { 0xc95, 0xcc6, 0xcd5, 0x0 }, |
|
780 { 0x90, 0x6c, 0x73, 0x0 } }, |
|
781 { { 0xc95, 0xcc6, 0xcd6, 0x0 }, |
|
782 { 0x90, 0x6c, 0x74, 0x0 } }, |
|
783 { { 0xc95, 0xcc6, 0xcc2, 0x0 }, |
|
784 { 0x90, 0x6c, 0x69, 0x0 } }, |
|
785 { { 0xc95, 0xcca, 0xcd5, 0x0 }, |
|
786 { 0x90, 0x6c, 0x69, 0x73, 0x0 } }, |
|
787 { {0}, {0} } |
|
788 }; |
|
789 |
|
790 |
|
791 const ShapeTable *s = shape_table; |
|
792 while (s->unicode[0]) { |
|
793 QVERIFY( shaping(f, s) ); |
|
794 ++s; |
|
795 } |
|
796 } else { |
|
797 QSKIP("couln't find Tunga", SkipAll); |
|
798 } |
|
799 } |
|
800 #else |
|
801 QSKIP("X11 specific test", SkipAll); |
|
802 #endif |
|
803 } |
|
804 |
|
805 |
|
806 |
|
807 void tst_QTextScriptEngine::malayalam() |
|
808 { |
|
809 #if defined(Q_WS_X11) |
|
810 { |
|
811 if (QFontDatabase().families(QFontDatabase::Malayalam).contains("AkrutiMal2")) { |
|
812 QFont f("AkrutiMal2"); |
|
813 const ShapeTable shape_table [] = { |
|
814 { { 0x0d15, 0x0d46, 0x0 }, |
|
815 { 0x005e, 0x0034, 0x0 } }, |
|
816 { { 0x0d15, 0x0d47, 0x0 }, |
|
817 { 0x005f, 0x0034, 0x0 } }, |
|
818 { { 0x0d15, 0x0d4b, 0x0 }, |
|
819 { 0x005f, 0x0034, 0x0058, 0x0 } }, |
|
820 { { 0x0d15, 0x0d48, 0x0 }, |
|
821 { 0x0060, 0x0034, 0x0 } }, |
|
822 { { 0x0d15, 0x0d4a, 0x0 }, |
|
823 { 0x005e, 0x0034, 0x0058, 0x0 } }, |
|
824 { { 0x0d30, 0x0d4d, 0x0d15, 0x0 }, |
|
825 { 0x009e, 0x0034, 0x0 } }, |
|
826 { { 0x0d15, 0x0d4d, 0x0d35, 0x0 }, |
|
827 { 0x0034, 0x007a, 0x0 } }, |
|
828 { { 0x0d15, 0x0d4d, 0x0d2f, 0x0 }, |
|
829 { 0x0034, 0x00a2, 0x0 } }, |
|
830 { { 0x0d1f, 0x0d4d, 0x0d1f, 0x0 }, |
|
831 { 0x0069, 0x0 } }, |
|
832 { { 0x0d26, 0x0d4d, 0x0d26, 0x0 }, |
|
833 { 0x0074, 0x0 } }, |
|
834 { { 0x0d30, 0x0d4d, 0x0 }, |
|
835 { 0x009e, 0x0 } }, |
|
836 { { 0x0d30, 0x0d4d, 0x200c, 0x0 }, |
|
837 { 0x009e, 0x0 } }, |
|
838 { { 0x0d30, 0x0d4d, 0x200d, 0x0 }, |
|
839 { 0x009e, 0x0 } }, |
|
840 { { 0xd15, 0xd46, 0xd3e, 0x0 }, |
|
841 { 0x5e, 0x34, 0x58, 0x0 } }, |
|
842 { { 0xd15, 0xd47, 0xd3e, 0x0 }, |
|
843 { 0x5f, 0x34, 0x58, 0x0 } }, |
|
844 { { 0xd15, 0xd46, 0xd57, 0x0 }, |
|
845 { 0x5e, 0x34, 0x65, 0x0 } }, |
|
846 { { 0xd15, 0xd57, 0x0 }, |
|
847 { 0x34, 0x65, 0x0 } }, |
|
848 { {0}, {0} } |
|
849 }; |
|
850 |
|
851 |
|
852 const ShapeTable *s = shape_table; |
|
853 while (s->unicode[0]) { |
|
854 QVERIFY( shaping(f, s) ); |
|
855 ++s; |
|
856 } |
|
857 } else { |
|
858 QSKIP("couln't find AkrutiMal2", SkipAll); |
|
859 } |
|
860 } |
|
861 { |
|
862 if (QFontDatabase().families(QFontDatabase::Malayalam).contains("Rachana")) { |
|
863 QFont f("Rachana"); |
|
864 const ShapeTable shape_table [] = { |
|
865 { { 0xd37, 0xd4d, 0xd1f, 0xd4d, 0xd30, 0xd40, 0x0 }, |
|
866 { 0x385, 0xa3, 0x0 } }, |
|
867 { { 0xd2f, 0xd4d, 0xd15, 0xd4d, 0xd15, 0xd41, 0x0 }, |
|
868 { 0x2ff, 0x0 } }, |
|
869 { { 0xd33, 0xd4d, 0xd33, 0x0 }, |
|
870 { 0x3f8, 0x0 } }, |
|
871 { { 0xd2f, 0xd4d, 0xd15, 0xd4d, 0xd15, 0xd41, 0x0 }, |
|
872 { 0x2ff, 0x0 } }, |
|
873 |
|
874 { {0}, {0} } |
|
875 }; |
|
876 |
|
877 |
|
878 const ShapeTable *s = shape_table; |
|
879 while (s->unicode[0]) { |
|
880 QVERIFY( shaping(f, s) ); |
|
881 ++s; |
|
882 } |
|
883 } else { |
|
884 QSKIP("couln't find Rachana", SkipAll); |
|
885 } |
|
886 } |
|
887 |
|
888 #else |
|
889 QSKIP("X11 specific test", SkipAll); |
|
890 #endif |
|
891 } |
|
892 |
|
893 void tst_QTextScriptEngine::sinhala() |
|
894 { |
|
895 #if defined(Q_WS_X11) |
|
896 { |
|
897 if (QFontDatabase().families(QFontDatabase::Sinhala).contains("Malithi Web")) { |
|
898 QFont f("Malithi Web"); |
|
899 const ShapeTable shape_table [] = { |
|
900 { { 0xd9a, 0xdd9, 0xdcf, 0x0 }, |
|
901 { 0x4a, 0x61, 0x42, 0x0 } }, |
|
902 { { 0xd9a, 0xdd9, 0xddf, 0x0 }, |
|
903 { 0x4a, 0x61, 0x50, 0x0 } }, |
|
904 { { 0xd9a, 0xdd9, 0xdca, 0x0 }, |
|
905 { 0x4a, 0x62, 0x0 } }, |
|
906 { { 0xd9a, 0xddc, 0xdca, 0x0 }, |
|
907 { 0x4a, 0x61, 0x42, 0x41, 0x0 } }, |
|
908 { { 0xd9a, 0xdda, 0x0 }, |
|
909 { 0x4a, 0x62, 0x0 } }, |
|
910 { { 0xd9a, 0xddd, 0x0 }, |
|
911 { 0x4a, 0x61, 0x42, 0x41, 0x0 } }, |
|
912 { {0}, {0} } |
|
913 }; |
|
914 |
|
915 |
|
916 const ShapeTable *s = shape_table; |
|
917 while (s->unicode[0]) { |
|
918 QVERIFY( shaping(f, s) ); |
|
919 ++s; |
|
920 } |
|
921 } else { |
|
922 QSKIP("couln't find Malithi Web", SkipAll); |
|
923 } |
|
924 } |
|
925 #else |
|
926 QSKIP("X11 specific test", SkipAll); |
|
927 #endif |
|
928 } |
|
929 |
|
930 |
|
931 void tst_QTextScriptEngine::khmer() |
|
932 { |
|
933 #if defined(Q_WS_X11) |
|
934 { |
|
935 if (QFontDatabase().families(QFontDatabase::Khmer).contains("Khmer OS")) { |
|
936 QFont f("Khmer OS"); |
|
937 const ShapeTable shape_table [] = { |
|
938 { { 0x179a, 0x17cd, 0x0 }, |
|
939 { 0x24c, 0x27f, 0x0 } }, |
|
940 { { 0x179f, 0x17c5, 0x0 }, |
|
941 { 0x273, 0x203, 0x0 } }, |
|
942 { { 0x1790, 0x17d2, 0x1784, 0x17c3, 0x0 }, |
|
943 { 0x275, 0x242, 0x182, 0x0 } }, |
|
944 { { 0x179a, 0x0 }, |
|
945 { 0x24c, 0x0 } }, |
|
946 { { 0x1781, 0x17d2, 0x1798, 0x17c2, 0x0 }, |
|
947 { 0x274, 0x233, 0x197, 0x0 } }, |
|
948 { { 0x1798, 0x17b6, 0x0 }, |
|
949 { 0x1cb, 0x0 } }, |
|
950 { { 0x179a, 0x17b8, 0x0 }, |
|
951 { 0x24c, 0x26a, 0x0 } }, |
|
952 { { 0x1787, 0x17b6, 0x0 }, |
|
953 { 0x1ba, 0x0 } }, |
|
954 { { 0x1798, 0x17d2, 0x1796, 0x17bb, 0x0 }, |
|
955 { 0x24a, 0x195, 0x26d, 0x0 } }, |
|
956 { {0}, {0} } |
|
957 }; |
|
958 |
|
959 |
|
960 const ShapeTable *s = shape_table; |
|
961 while (s->unicode[0]) { |
|
962 QVERIFY( shaping(f, s) ); |
|
963 ++s; |
|
964 } |
|
965 } else { |
|
966 QSKIP("couln't find Khmer OS", SkipAll); |
|
967 } |
|
968 } |
|
969 #else |
|
970 QSKIP("X11 specific test", SkipAll); |
|
971 #endif |
|
972 } |
|
973 |
|
974 void tst_QTextScriptEngine::linearB() |
|
975 { |
|
976 #if defined(Q_WS_X11) |
|
977 { |
|
978 if (QFontDatabase().families(QFontDatabase::Any).contains("Penuturesu")) { |
|
979 QFont f("Penuturesu"); |
|
980 const ShapeTable shape_table [] = { |
|
981 { { 0xd800, 0xdc01, 0xd800, 0xdc02, 0xd800, 0xdc03, 0 }, |
|
982 { 0x5, 0x6, 0x7, 0 } }, |
|
983 { {0}, {0} } |
|
984 }; |
|
985 |
|
986 |
|
987 const ShapeTable *s = shape_table; |
|
988 while (s->unicode[0]) { |
|
989 QVERIFY( shaping(f, s) ); |
|
990 ++s; |
|
991 } |
|
992 } else { |
|
993 QSKIP("couln't find Penuturesu", SkipAll); |
|
994 } |
|
995 } |
|
996 #else |
|
997 QSKIP("X11 specific test", SkipAll); |
|
998 #endif |
|
999 } |
|
1000 |
|
1001 |
|
1002 QTEST_MAIN(tst_QTextScriptEngine) |
|
1003 #include "tst_qtextscriptengine.moc" |