ReactOS 0.4.15-dev-8428-g6910fa6
usp10.c File Reference
#include <assert.h>
#include <stdio.h>
#include <wine/test.h>
#include <windows.h>
#include <usp10.h>
Include dependency graph for usp10.c:

Go to the source code of this file.

Classes

struct  _itemTest
 
struct  _shapeTest_char
 
struct  _shapeTest_glyph
 
struct  _font_fingerprint
 
struct  tagRangeP
 
struct  enum_font_data
 
struct  logical_width_test
 

Macros

#define test_items_ok(a, b, c, d, e, f, g, h)   (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _test_items_ok(a,b,c,d,e,f,g,h)
 
#define MS_MAKE_TAG(_x1, _x2, _x3, _x4)
 
#define latn_tag   MS_MAKE_TAG('l','a','t','n')
 
#define arab_tag   MS_MAKE_TAG('a','r','a','b')
 
#define thai_tag   MS_MAKE_TAG('t','h','a','i')
 
#define hebr_tag   MS_MAKE_TAG('h','e','b','r')
 
#define syrc_tag   MS_MAKE_TAG('s','y','r','c')
 
#define thaa_tag   MS_MAKE_TAG('t','h','a','a')
 
#define deva_tag   MS_MAKE_TAG('d','e','v','a')
 
#define beng_tag   MS_MAKE_TAG('b','e','n','g')
 
#define guru_tag   MS_MAKE_TAG('g','u','r','u')
 
#define gujr_tag   MS_MAKE_TAG('g','u','j','r')
 
#define orya_tag   MS_MAKE_TAG('o','r','y','a')
 
#define taml_tag   MS_MAKE_TAG('t','a','m','l')
 
#define telu_tag   MS_MAKE_TAG('t','e','l','u')
 
#define knda_tag   MS_MAKE_TAG('k','n','d','a')
 
#define mlym_tag   MS_MAKE_TAG('m','l','y','m')
 
#define mymr_tag   MS_MAKE_TAG('m','y','m','r')
 
#define tale_tag   MS_MAKE_TAG('t','a','l','e')
 
#define talu_tag   MS_MAKE_TAG('t','a','l','u')
 
#define khmr_tag   MS_MAKE_TAG('k','h','m','r')
 
#define hani_tag   MS_MAKE_TAG('h','a','n','i')
 
#define bopo_tag   MS_MAKE_TAG('b','o','p','o')
 
#define kana_tag   MS_MAKE_TAG('k','a','n','a')
 
#define hang_tag   MS_MAKE_TAG('h','a','n','g')
 
#define yi_tag   MS_MAKE_TAG('y','i',' ',' ')
 
#define ethi_tag   MS_MAKE_TAG('e','t','h','i')
 
#define mong_tag   MS_MAKE_TAG('m','o','n','g')
 
#define tfng_tag   MS_MAKE_TAG('t','f','n','g')
 
#define nko_tag   MS_MAKE_TAG('n','k','o',' ')
 
#define vai_tag   MS_MAKE_TAG('v','a','i',' ')
 
#define cher_tag   MS_MAKE_TAG('c','h','e','r')
 
#define cans_tag   MS_MAKE_TAG('c','a','n','s')
 
#define ogam_tag   MS_MAKE_TAG('o','g','a','m')
 
#define runr_tag   MS_MAKE_TAG('r','u','n','r')
 
#define brai_tag   MS_MAKE_TAG('b','r','a','i')
 
#define dsrt_tag   MS_MAKE_TAG('d','s','r','t')
 
#define osma_tag   MS_MAKE_TAG('o','s','m','a')
 
#define math_tag   MS_MAKE_TAG('m','a','t','h')
 
#define test_shape_ok(a, b, c, d, e, f, g, h, i)    (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _test_shape_ok(1,a,b,c,d,e,f,g,h,i,NULL)
 
#define test_shape_ok_valid(v, a, b, c, d, e, f, g, h, i)    (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _test_shape_ok(v,a,b,c,d,e,f,g,h,i,NULL)
 
#define test_shape_ok_valid_props2(v, a, b, c, d, e, f, g, h, i, j)    (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _test_shape_ok(v,a,b,c,d,e,f,g,h,i,j)
 
#define find_font_for_range(a, b, c, d, e, f, g)   (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _find_font_for_range(a,b,c,d,e,f,g)
 
#define MAX_ENUM_FONTS   4096
 
#define test_item_ScriptXtoX(a, b, c, d, e, f)   (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _test_item_ScriptXtoX(a,b,c,d,e,f)
 
#define test_caret_item_ScriptXtoCP(a, b, c, d, e, f)   _test_caret_item_ScriptXtoCP(__LINE__,a,b,c,d,e,f)
 

Typedefs

typedef struct _itemTest itemTest
 
typedef struct _shapeTest_char shapeTest_char
 
typedef struct _shapeTest_glyph shapeTest_glyph
 
typedef struct _font_fingerprint font_fingerprint
 
typedef struct tagRangeP fontEnumParam
 

Functions

static HRESULT (WINAPI *pScriptItemizeOpenType)(const WCHAR *pwcInChars
 
static void _test_items_ok (LPCWSTR string, DWORD cchString, SCRIPT_CONTROL *Control, SCRIPT_STATE *State, DWORD nItems, const itemTest *items, BOOL nItemsToDo, const INT nItemsBroken[2])
 
static void test_ScriptItemize (void)
 
static void make_surrogate (DWORD i, WORD out[2])
 
static void test_ScriptItemize_surrogates (void)
 
static void _test_shape_ok (int valid, HDC hdc, LPCWSTR string, DWORD cchString, SCRIPT_CONTROL *Control, SCRIPT_STATE *State, DWORD item, DWORD nGlyphs, const shapeTest_char *charItems, const shapeTest_glyph *glyphItems, const SCRIPT_GLYPHPROP *props2)
 
static int CALLBACK enumFontProc (const LOGFONTA *lpelfe, const TEXTMETRICA *lpntme, DWORD FontType, LPARAM lParam)
 
static int _find_font_for_range (HDC hdc, const CHAR *recommended, BYTE range, const WCHAR check, HFONT *hfont, HFONT *origFont, const font_fingerprint *fingerprint)
 
static void test_ScriptShapeOpenType (HDC hdc)
 
static void test_ScriptShape (HDC hdc)
 
static void test_ScriptPlace (HDC hdc)
 
static void test_ScriptItemIzeShapePlace (HDC hdc, unsigned short pwOutGlyphs[256])
 
static void test_ScriptGetCMap (HDC hdc, unsigned short pwOutGlyphs[256])
 
static INT CALLBACK enum_bitmap_font_proc (const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
 
static INT CALLBACK enum_truetype_proc (const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
 
static void test_ScriptGetFontProperties (HDC hdc)
 
static void test_ScriptTextOut (HDC hdc)
 
static void test_ScriptTextOut2 (HDC hdc)
 
static void test_ScriptTextOut3 (HDC hdc)
 
static void _test_item_ScriptXtoX (SCRIPT_ANALYSIS *psa, int cChars, int cGlyphs, const int *offsets, const WORD *pwLogClust, const int *piAdvance)
 
static void _test_caret_item_ScriptXtoCP (int line, SCRIPT_ANALYSIS *psa, int cChars, int cGlyphs, const int *offsets, const WORD *pwLogClust, const int *piAdvance)
 
static void test_ScriptXtoX (void)
 
static void test_ScriptString (HDC hdc)
 
static void test_ScriptStringXtoCP_CPtoX (HDC hdc)
 
static HWND create_test_window (void)
 
static void test_ScriptCacheGetHeight (HDC hdc)
 
static void test_ScriptGetGlyphABCWidth (HDC hdc)
 
static void test_ScriptLayout (void)
 
static BOOL CALLBACK enum_proc (LGRPID group, LCID lcid, LPSTR locale, LONG_PTR lparam)
 
static void test_digit_substitution (void)
 
static void test_ScriptGetProperties (void)
 
static void test_ScriptBreak (void)
 
static void test_newlines (void)
 
static void test_ScriptGetFontFunctions (HDC hdc)
 
static void test_ScriptGetLogicalWidths (void)
 
static void test_ScriptIsComplex (void)
 
static void test_ScriptString_pSize (HDC hdc)
 
static void test_script_cache_reuse (void)
 
static void init_tests (void)
 
 START_TEST (usp10)
 

Variables

static int cInChars
 
static int int cMaxItems
 
static int int const SCRIPT_CONTROLpsControl
 
static int int const SCRIPT_CONTROL const SCRIPT_STATEpsState
 
static int int const SCRIPT_CONTROL const SCRIPT_STATE SCRIPT_ITEMpItems
 
static int int const SCRIPT_CONTROL const SCRIPT_STATE SCRIPT_ITEM ULONGpScriptTags
 
static int int const SCRIPT_CONTROL const SCRIPT_STATE SCRIPT_ITEM ULONG intpcItems
 
static SCRIPT_CACHEpsc
 
static SCRIPT_CACHE SCRIPT_ANALYSISpsa
 
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG tagScript
 
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG tagLangSys
 
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG intrcRangeChars
 
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES ** rpRangeProperties
 
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int cRanges
 
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHARpwcChars
 
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
 
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int cMaxGlyphs
 
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORDpwLogClust
 
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD SCRIPT_CHARPROPpCharProps
 
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD SCRIPT_CHARPROP WORDpwOutGlyphs
 
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD SCRIPT_CHARPROP WORD SCRIPT_GLYPHPROPpOutGlyphProps
 
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD SCRIPT_CHARPROP WORD SCRIPT_GLYPHPROP intpcGlyphs
 
static SCRIPT_CACHE SCRIPT_ANALYSIS int cMaxTags
 
static SCRIPT_CACHE SCRIPT_ANALYSIS int OPENTYPE_TAG intpcTags
 
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG int OPENTYPE_TAGpLangSysTags
 
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int OPENTYPE_TAGpFeatureTags
 
static const struct logical_width_test logical_width_tests []
 

Macro Definition Documentation

◆ arab_tag

#define arab_tag   MS_MAKE_TAG('a','r','a','b')

Definition at line 143 of file usp10.c.

◆ beng_tag

#define beng_tag   MS_MAKE_TAG('b','e','n','g')

Definition at line 149 of file usp10.c.

◆ bopo_tag

#define bopo_tag   MS_MAKE_TAG('b','o','p','o')

Definition at line 162 of file usp10.c.

◆ brai_tag

#define brai_tag   MS_MAKE_TAG('b','r','a','i')

Definition at line 175 of file usp10.c.

◆ cans_tag

#define cans_tag   MS_MAKE_TAG('c','a','n','s')

Definition at line 172 of file usp10.c.

◆ cher_tag

#define cher_tag   MS_MAKE_TAG('c','h','e','r')

Definition at line 171 of file usp10.c.

◆ deva_tag

#define deva_tag   MS_MAKE_TAG('d','e','v','a')

Definition at line 148 of file usp10.c.

◆ dsrt_tag

#define dsrt_tag   MS_MAKE_TAG('d','s','r','t')

Definition at line 176 of file usp10.c.

◆ ethi_tag

#define ethi_tag   MS_MAKE_TAG('e','t','h','i')

Definition at line 166 of file usp10.c.

◆ find_font_for_range

#define find_font_for_range (   a,
  b,
  c,
  d,
  e,
  f,
  g 
)    (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _find_font_for_range(a,b,c,d,e,f,g)

Definition at line 1355 of file usp10.c.

◆ gujr_tag

#define gujr_tag   MS_MAKE_TAG('g','u','j','r')

Definition at line 151 of file usp10.c.

◆ guru_tag

#define guru_tag   MS_MAKE_TAG('g','u','r','u')

Definition at line 150 of file usp10.c.

◆ hang_tag

#define hang_tag   MS_MAKE_TAG('h','a','n','g')

Definition at line 164 of file usp10.c.

◆ hani_tag

#define hani_tag   MS_MAKE_TAG('h','a','n','i')

Definition at line 161 of file usp10.c.

◆ hebr_tag

#define hebr_tag   MS_MAKE_TAG('h','e','b','r')

Definition at line 145 of file usp10.c.

◆ kana_tag

#define kana_tag   MS_MAKE_TAG('k','a','n','a')

Definition at line 163 of file usp10.c.

◆ khmr_tag

#define khmr_tag   MS_MAKE_TAG('k','h','m','r')

Definition at line 160 of file usp10.c.

◆ knda_tag

#define knda_tag   MS_MAKE_TAG('k','n','d','a')

Definition at line 155 of file usp10.c.

◆ latn_tag

#define latn_tag   MS_MAKE_TAG('l','a','t','n')

Definition at line 142 of file usp10.c.

◆ math_tag

#define math_tag   MS_MAKE_TAG('m','a','t','h')

Definition at line 178 of file usp10.c.

◆ MAX_ENUM_FONTS

#define MAX_ENUM_FONTS   4096

Definition at line 2467 of file usp10.c.

◆ mlym_tag

#define mlym_tag   MS_MAKE_TAG('m','l','y','m')

Definition at line 156 of file usp10.c.

◆ mong_tag

#define mong_tag   MS_MAKE_TAG('m','o','n','g')

Definition at line 167 of file usp10.c.

◆ MS_MAKE_TAG

#define MS_MAKE_TAG (   _x1,
  _x2,
  _x3,
  _x4 
)
Value:
( ( (ULONG)_x4 << 24 ) | \
( (ULONG)_x3 << 16 ) | \
( (ULONG)_x2 << 8 ) | \
(ULONG)_x1 )
uint32_t ULONG
Definition: typedefs.h:59

Definition at line 136 of file usp10.c.

◆ mymr_tag

#define mymr_tag   MS_MAKE_TAG('m','y','m','r')

Definition at line 157 of file usp10.c.

◆ nko_tag

#define nko_tag   MS_MAKE_TAG('n','k','o',' ')

Definition at line 169 of file usp10.c.

◆ ogam_tag

#define ogam_tag   MS_MAKE_TAG('o','g','a','m')

Definition at line 173 of file usp10.c.

◆ orya_tag

#define orya_tag   MS_MAKE_TAG('o','r','y','a')

Definition at line 152 of file usp10.c.

◆ osma_tag

#define osma_tag   MS_MAKE_TAG('o','s','m','a')

Definition at line 177 of file usp10.c.

◆ runr_tag

#define runr_tag   MS_MAKE_TAG('r','u','n','r')

Definition at line 174 of file usp10.c.

◆ syrc_tag

#define syrc_tag   MS_MAKE_TAG('s','y','r','c')

Definition at line 146 of file usp10.c.

◆ tale_tag

#define tale_tag   MS_MAKE_TAG('t','a','l','e')

Definition at line 158 of file usp10.c.

◆ talu_tag

#define talu_tag   MS_MAKE_TAG('t','a','l','u')

Definition at line 159 of file usp10.c.

◆ taml_tag

#define taml_tag   MS_MAKE_TAG('t','a','m','l')

Definition at line 153 of file usp10.c.

◆ telu_tag

#define telu_tag   MS_MAKE_TAG('t','e','l','u')

Definition at line 154 of file usp10.c.

◆ test_caret_item_ScriptXtoCP

#define test_caret_item_ScriptXtoCP (   a,
  b,
  c,
  d,
  e,
  f 
)    _test_caret_item_ScriptXtoCP(__LINE__,a,b,c,d,e,f)

Definition at line 2973 of file usp10.c.

◆ test_item_ScriptXtoX

#define test_item_ScriptXtoX (   a,
  b,
  c,
  d,
  e,
  f 
)    (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _test_item_ScriptXtoX(a,b,c,d,e,f)

Definition at line 2901 of file usp10.c.

◆ test_items_ok

#define test_items_ok (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h 
)    (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _test_items_ok(a,b,c,d,e,f,g,h)

Definition at line 134 of file usp10.c.

◆ test_shape_ok

#define test_shape_ok (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i 
)     (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _test_shape_ok(1,a,b,c,d,e,f,g,h,i,NULL)

Definition at line 1230 of file usp10.c.

◆ test_shape_ok_valid

#define test_shape_ok_valid (   v,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i 
)     (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _test_shape_ok(v,a,b,c,d,e,f,g,h,i,NULL)

Definition at line 1233 of file usp10.c.

◆ test_shape_ok_valid_props2

#define test_shape_ok_valid_props2 (   v,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  j 
)     (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _test_shape_ok(v,a,b,c,d,e,f,g,h,i,j)

Definition at line 1236 of file usp10.c.

◆ tfng_tag

#define tfng_tag   MS_MAKE_TAG('t','f','n','g')

Definition at line 168 of file usp10.c.

◆ thaa_tag

#define thaa_tag   MS_MAKE_TAG('t','h','a','a')

Definition at line 147 of file usp10.c.

◆ thai_tag

#define thai_tag   MS_MAKE_TAG('t','h','a','i')

Definition at line 144 of file usp10.c.

◆ vai_tag

#define vai_tag   MS_MAKE_TAG('v','a','i',' ')

Definition at line 170 of file usp10.c.

◆ yi_tag

#define yi_tag   MS_MAKE_TAG('y','i',' ',' ')

Definition at line 165 of file usp10.c.

Typedef Documentation

◆ font_fingerprint

◆ fontEnumParam

◆ itemTest

◆ shapeTest_char

◆ shapeTest_glyph

Function Documentation

◆ _find_font_for_range()

static int _find_font_for_range ( HDC  hdc,
const CHAR recommended,
BYTE  range,
const WCHAR  check,
HFONT hfont,
HFONT origFont,
const font_fingerprint fingerprint 
)
static

Definition at line 1274 of file usp10.c.

1275{
1276 int rc = 0;
1278
1279 lParam.range = range;
1280 memset(&lParam.lf,0,sizeof(LOGFONTA));
1281 *hfont = NULL;
1282
1283 if (recommended)
1284 {
1285 lstrcpyA(lParam.lf.lfFaceName, recommended);
1287 {
1289 if (*hfont)
1290 {
1291 winetest_trace("using font %s\n",lParam.lf.lfFaceName);
1292 if (fingerprint)
1293 {
1294 WORD output[10];
1295 int i;
1296
1297 *origFont = SelectObject(hdc,*hfont);
1298 if (GetGlyphIndicesW(hdc, fingerprint->check, 10, output, 0) != GDI_ERROR)
1299 {
1300 for (i=0; i < 10; i++)
1301 if (output[i] != fingerprint->result[i])
1302 {
1303 winetest_trace("found font does not match fingerprint\n");
1304 SelectObject(hdc,*origFont);
1306 *hfont = NULL;
1307 break;
1308 }
1309 if (i == 10) rc = 1;
1310 }
1311 SelectObject(hdc, *origFont);
1312 }
1313 else rc = 1;
1314 }
1315 }
1316 if (!rc)
1317 winetest_skip("Font %s is not available.\n", recommended);
1318 }
1319
1320 if (!*hfont)
1321 {
1322 memset(&lParam.lf,0,sizeof(LOGFONTA));
1323 lParam.lf.lfCharSet = DEFAULT_CHARSET;
1324
1325 if (!EnumFontFamiliesExA(hdc, &lParam.lf, enumFontProc, (LPARAM)&lParam, 0) && lParam.lf.lfFaceName[0])
1326 {
1328 if (*hfont)
1329 winetest_trace("trying font %s: failures will only be warnings\n",lParam.lf.lfFaceName);
1330 }
1331 }
1332
1333 if (*hfont)
1334 {
1335 WORD glyph = 0;
1336
1337 *origFont = SelectObject(hdc,*hfont);
1338 if (GetGlyphIndicesW(hdc, &check, 1, &glyph, 0) == GDI_ERROR || glyph == 0)
1339 {
1340 winetest_trace(" Font fails to contain required glyphs\n");
1341 SelectObject(hdc,*origFont);
1343 *hfont=NULL;
1344 rc = 0;
1345 }
1346 else if (!rc)
1347 rc = -1;
1348 }
1349 else
1350 winetest_trace("Failed to find usable font\n");
1351
1352 return rc;
1353}
static HFONT hfont
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define check(expected, result)
Definition: dplayx.c:32
unsigned short WORD
Definition: ntddk_ex.h:93
pKey DeleteObject()
GLenum GLint * range
Definition: glext.h:7539
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
HDC hdc
Definition: main.c:9
static int CALLBACK enumFontProc(const LOGFONTA *lpelfe, const TEXTMETRICA *lpntme, DWORD FontType, LPARAM lParam)
Definition: usp10.c:1244
void __winetest_cdecl winetest_skip(const char *msg,...)
void __winetest_cdecl winetest_trace(const char *msg,...)
#define memset(x, y, z)
Definition: compat.h:39
WORD result[10]
Definition: usp10.c:58
WCHAR check[10]
Definition: usp10.c:57
LONG_PTR LPARAM
Definition: windef.h:208
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
int WINAPI EnumFontFamiliesExA(_In_ HDC, _In_ PLOGFONTA, _In_ FONTENUMPROCA, _In_ LPARAM, _In_ DWORD)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
#define DEFAULT_CHARSET
Definition: wingdi.h:384
#define GDI_ERROR
Definition: wingdi.h:1309

◆ _test_caret_item_ScriptXtoCP()

static void _test_caret_item_ScriptXtoCP ( int  line,
SCRIPT_ANALYSIS psa,
int  cChars,
int  cGlyphs,
const int offsets,
const WORD pwLogClust,
const int piAdvance 
)
static

Definition at line 2975 of file usp10.c.

2976{
2977 int iX, iCP, i;
2978 int icChars, icGlyphs;
2979 int piCP;
2980 int clusterSize;
2981 HRESULT hr;
2982 SCRIPT_VISATTR psva[10];
2983 int piTrailing;
2984 int direction;
2985
2986 memset(psva,0,sizeof(psva));
2987 direction = (psa->fRTL)?-1:+1;
2988
2989 for(iX = -1, i = iCP = 0; i < cChars; i++)
2990 {
2991 if (offsets[i] != iX)
2992 {
2993 iX = offsets[i];
2994 iCP = i;
2995 }
2996 icChars = cChars;
2997 icGlyphs = cGlyphs;
2998 hr = ScriptXtoCP(iX, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piCP, &piTrailing);
2999 ok_(__FILE__,line)(hr == S_OK, "ScriptXtoCP: should return S_OK not %08x\n", hr);
3000 ok_(__FILE__,line)(piCP == iCP, "ScriptXtoCP: iX=%d should return piCP=%d not %d\n", iX, iCP, piCP);
3001 ok_(__FILE__,line)(piTrailing == 0, "ScriptXtoCP: iX=%d should return piTrailing=0 not %d\n", iX, piTrailing);
3002 }
3003
3004 for(iX = -2, i = 0; i < cChars; i++)
3005 {
3006 if (offsets[i]+direction != iX)
3007 {
3008 iX = offsets[i] + direction;
3009 iCP = i;
3010 }
3011 icChars = cChars;
3012 icGlyphs = cGlyphs;
3013 hr = ScriptXtoCP(iX, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piCP, &piTrailing);
3014 ok_(__FILE__,line)(hr == S_OK, "ScriptXtoCP leading: should return S_OK not %08x\n", hr);
3015 ok_(__FILE__,line)(piCP == iCP, "ScriptXtoCP leading: iX=%d should return piCP=%d not %d\n", iX, iCP, piCP);
3016 ok_(__FILE__,line)(piTrailing == 0, "ScriptXtoCP leading: iX=%d should return piTrailing=0 not %d\n", iX, piTrailing);
3017 }
3018
3019 for(clusterSize = 0, iCP = 0, iX = -2, i = 0; i < cChars; i++)
3020 {
3021 clusterSize++;
3022 if (offsets[i] != offsets[i+1])
3023 {
3024 iX = offsets[i+1]-direction;
3025 icChars = cChars;
3026 icGlyphs = cGlyphs;
3027 hr = ScriptXtoCP(iX, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piCP, &piTrailing);
3028 ok_(__FILE__,line)(hr == S_OK, "ScriptXtoCP trailing: should return S_OK not %08x\n", hr);
3029 ok_(__FILE__,line)(piCP == iCP, "ScriptXtoCP trailing: iX=%d should return piCP=%d not %d\n", iX, iCP, piCP);
3030 ok_(__FILE__,line)(piTrailing == clusterSize, "ScriptXtoCP trailing: iX=%d should return piTrailing=%d not %d\n", iX, clusterSize, piTrailing);
3031 iCP = i+1;
3032 clusterSize = 0;
3033 }
3034 }
3035}
#define ok_(x1, x2)
Definition: atltest.h:61
HRESULT WINAPI ScriptXtoCP(int iX, int cChars, int cGlyphs, const WORD *pwLogClust, const SCRIPT_VISATTR *psva, const int *piAdvance, const SCRIPT_ANALYSIS *psa, int *piCP, int *piTrailing)
Definition: usp10.c:2854
static const FxOffsetAndName offsets[]
#define S_OK
Definition: intsafe.h:52
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
HRESULT hr
Definition: shlfolder.c:183
Definition: parser.c:49
_In_ FONTOBJ _In_ ULONG _In_ ULONG cGlyphs
Definition: winddi.h:3799

◆ _test_item_ScriptXtoX()

static void _test_item_ScriptXtoX ( SCRIPT_ANALYSIS psa,
int  cChars,
int  cGlyphs,
const int offsets,
const WORD pwLogClust,
const int piAdvance 
)
static

Definition at line 2903 of file usp10.c.

2904{
2905 int iX, iCP;
2906 int icChars, icGlyphs;
2907 int piCP, piX;
2908 HRESULT hr;
2909 SCRIPT_VISATTR psva[10];
2910 int piTrailing;
2911 BOOL fTrailing;
2912 int direction;
2913
2914 memset(psva,0,sizeof(psva));
2915 direction = (psa->fRTL)?-1:+1;
2916
2917 for(iCP = 0; iCP < cChars; iCP++)
2918 {
2919 iX = offsets[iCP];
2920 icChars = cChars;
2921 icGlyphs = cGlyphs;
2922 hr = ScriptXtoCP(iX, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piCP, &piTrailing);
2923 winetest_ok(hr == S_OK, "ScriptXtoCP: should return S_OK not %08x\n", hr);
2924 winetest_ok(piCP == iCP, "ScriptXtoCP: iX=%d should return piCP=%d not %d\n", iX, iCP, piCP);
2925 winetest_ok(piTrailing == 0, "ScriptXtoCP: iX=%d should return piTrailing=0 not %d\n", iX, piTrailing);
2926 }
2927
2928 for(iCP = 0; iCP < cChars; iCP++)
2929 {
2930 iX = offsets[iCP]+direction;
2931 icChars = cChars;
2932 icGlyphs = cGlyphs;
2933 hr = ScriptXtoCP(iX, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piCP, &piTrailing);
2934 winetest_ok(hr == S_OK, "ScriptXtoCP leading: should return S_OK not %08x\n", hr);
2935 winetest_ok(piCP == iCP, "ScriptXtoCP leading: iX=%d should return piCP=%d not %d\n", iX, iCP, piCP);
2936 winetest_ok(piTrailing == 0, "ScriptXtoCP leading: iX=%d should return piTrailing=0 not %d\n", iX, piTrailing);
2937 }
2938
2939 for(iCP = 0; iCP < cChars; iCP++)
2940 {
2941 iX = offsets[iCP+1]-direction;
2942 icChars = cChars;
2943 icGlyphs = cGlyphs;
2944 hr = ScriptXtoCP(iX, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piCP, &piTrailing);
2945 winetest_ok(hr == S_OK, "ScriptXtoCP trailing: should return S_OK not %08x\n", hr);
2946 winetest_ok(piCP == iCP, "ScriptXtoCP trailing: iX=%d should return piCP=%d not %d\n", iX, iCP, piCP);
2947 winetest_ok(piTrailing == 1, "ScriptXtoCP trailing: iX=%d should return piTrailing=1 not %d\n", iX, piTrailing);
2948 }
2949
2950 for(iCP = 0; iCP <= cChars+1; iCP++)
2951 {
2952 fTrailing = FALSE;
2953 icChars = cChars;
2954 icGlyphs = cGlyphs;
2955 hr = ScriptCPtoX(iCP, fTrailing, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piX);
2956 winetest_ok(hr == S_OK, "ScriptCPtoX: should return S_OK not %08x\n", hr);
2957 winetest_ok(piX == offsets[iCP],
2958 "ScriptCPtoX: iCP=%d should return piX=%d not %d\n", iCP, offsets[iCP], piX);
2959 }
2960
2961 for(iCP = 0; iCP <= cChars+1; iCP++)
2962 {
2963 fTrailing = TRUE;
2964 icChars = cChars;
2965 icGlyphs = cGlyphs;
2966 hr = ScriptCPtoX(iCP, fTrailing, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piX);
2967 winetest_ok(hr == S_OK, "ScriptCPtoX trailing: should return S_OK not %08x\n", hr);
2968 winetest_ok(piX == offsets[iCP+1],
2969 "ScriptCPtoX trailing: iCP=%d should return piX=%d not %d\n", iCP, offsets[iCP+1], piX);
2970 }
2971}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HRESULT WINAPI ScriptCPtoX(int iCP, BOOL fTrailing, int cChars, int cGlyphs, const WORD *pwLogClust, const SCRIPT_VISATTR *psva, const int *piAdvance, const SCRIPT_ANALYSIS *psa, int *piX)
Definition: usp10.c:2650
unsigned int BOOL
Definition: ntddk_ex.h:94
void __winetest_cdecl winetest_ok(int condition, const char *msg,...)

◆ _test_items_ok()

static void _test_items_ok ( LPCWSTR  string,
DWORD  cchString,
SCRIPT_CONTROL Control,
SCRIPT_STATE State,
DWORD  nItems,
const itemTest items,
BOOL  nItemsToDo,
const INT  nItemsBroken[2] 
)
inlinestatic

Definition at line 70 of file usp10.c.

74{
75 HRESULT hr;
76 int x, outnItems;
77 SCRIPT_ITEM outpItems[15];
78 ULONG tags[15] = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};
79
80 if (pScriptItemizeOpenType)
81 hr = pScriptItemizeOpenType(string, cchString, 15, Control, State, outpItems, tags, &outnItems);
82 else
83 hr = ScriptItemize(string, cchString, 15, Control, State, outpItems, &outnItems);
84
85 winetest_ok(hr == S_OK, "ScriptItemize should return S_OK not %08x\n", hr);
86 if (nItemsBroken && (broken(nItemsBroken[0] == outnItems) || broken(nItemsBroken[1] == outnItems)))
87 {
88 winetest_win_skip("This test broken on this platform: nitems %d\n", outnItems);
89 return;
90 }
91 todo_wine_if (nItemsToDo)
92 winetest_ok(outnItems == nItems, "Wrong number of items (%u)\n", outnItems);
93 outnItems = min(outnItems, nItems);
94 for (x = 0; x <= outnItems; x++)
95 {
96 if (items[x].isBroken && broken(outpItems[x].iCharPos == items[x].broken_value[0]))
97 winetest_win_skip("This test broken on this platform: item %d CharPos %d\n", x, outpItems[x].iCharPos);
98 else todo_wine_if (items[x].todo_flag[0])
99 winetest_ok(outpItems[x].iCharPos == items[x].iCharPos, "%i:Wrong CharPos (%i)\n",x,outpItems[x].iCharPos);
100
101 if (items[x].isBroken && broken(outpItems[x].a.fRTL== items[x].broken_value[1]))
102 winetest_win_skip("This test broken on this platform: item %d fRTL %d\n", x, outpItems[x].a.fRTL);
103 else todo_wine_if (items[x].todo_flag[1])
104 winetest_ok(outpItems[x].a.fRTL == items[x].fRTL, "%i:Wrong fRTL(%i)\n",x,outpItems[x].a.fRTL);
105
106 if (items[x].isBroken && broken(outpItems[x].a.fLayoutRTL == items[x].broken_value[2]))
107 winetest_win_skip("This test broken on this platform: item %d fLayoutRTL %d\n", x, outpItems[x].a.fLayoutRTL);
108 else todo_wine_if (items[x].todo_flag[2])
109 winetest_ok(outpItems[x].a.fLayoutRTL == items[x].fLayoutRTL, "%i:Wrong fLayoutRTL(%i)\n",x,outpItems[x].a.fLayoutRTL);
110
111 if (items[x].isBroken && broken(outpItems[x].a.s.uBidiLevel == items[x].broken_value[3]))
112 winetest_win_skip("This test broken on this platform: item %d BidiLevel %d\n", x, outpItems[x].a.s.uBidiLevel);
113 else todo_wine_if (items[x].todo_flag[3])
114 winetest_ok(outpItems[x].a.s.uBidiLevel == items[x].uBidiLevel, "%i:Wrong BidiLevel(%i)\n",x,outpItems[x].a.s.uBidiLevel);
115
116 if (items[x].isBroken && broken(outpItems[x].a.s.fOverrideDirection == items[x].broken_value[4]))
117 winetest_win_skip("This test broken on this platform: item %d fOverrideDirection %d\n", x, outpItems[x].a.s.fOverrideDirection);
118 else todo_wine_if (items[x].todo_flag[4])
119 winetest_ok(outpItems[x].a.s.fOverrideDirection == items[x].fOverrideDirection, "%i:Wrong fOverrideDirection(%i)\n",x,outpItems[x].a.s.fOverrideDirection);
120
121 if (x != outnItems)
122 winetest_ok(outpItems[x].a.eScript != SCRIPT_UNDEFINED, "%i: Undefined script\n",x);
123 if (pScriptItemizeOpenType)
124 {
125 if (items[x].isBroken && broken(tags[x] == items[x].broken_value[5]))
126 winetest_win_skip("This test broken on this platform: item %d Script Tag %x\n", x, tags[x]);
127 else todo_wine_if (items[x].todo_flag[5])
128 winetest_ok(tags[x] == items[x].scriptTag,"%i:Incorrect Script Tag %x != %x\n",x,tags[x],items[x].scriptTag);
129 }
130
131 }
132}
#define broken(x)
Definition: _sntprintf.h:21
int nItems
Definition: appswitch.c:56
HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItems, const SCRIPT_CONTROL *psControl, const SCRIPT_STATE *psState, SCRIPT_ITEM *pItems, int *pcItems)
Definition: usp10.c:1853
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
const char * tags[7 *8]
Definition: apphelp.c:216
#define todo_wine_if(is_todo)
Definition: custom.c:76
#define min(a, b)
Definition: monoChain.cc:55
static TCHAR * items[]
Definition: page1.c:45
void __winetest_cdecl winetest_win_skip(const char *msg,...)
#define SCRIPT_UNDEFINED
Definition: usp10.h:69
_In_ WDF_WMI_PROVIDER_CONTROL Control
Definition: wdfwmi.h:166

◆ _test_shape_ok()

static void _test_shape_ok ( int  valid,
HDC  hdc,
LPCWSTR  string,
DWORD  cchString,
SCRIPT_CONTROL Control,
SCRIPT_STATE State,
DWORD  item,
DWORD  nGlyphs,
const shapeTest_char charItems,
const shapeTest_glyph glyphItems,
const SCRIPT_GLYPHPROP props2 
)
inlinestatic

Definition at line 966 of file usp10.c.

972{
973 HRESULT hr;
974 int x, outnItems = 0, outnGlyphs = 0, outnGlyphs2 = 0;
975 const SCRIPT_PROPERTIES **script_properties;
976 SCRIPT_ITEM outpItems[15];
977 SCRIPT_CACHE sc = NULL;
978 WORD *glyphs, *glyphs2;
979 WORD *logclust, *logclust2;
980 int maxGlyphs = cchString * 1.5;
981 SCRIPT_GLYPHPROP *glyphProp, *glyphProp2;
982 SCRIPT_CHARPROP *charProp, *charProp2;
983 int script_count;
984 WCHAR *string2;
985 ULONG tags[15];
986
987 hr = ScriptGetProperties(&script_properties, &script_count);
988 winetest_ok(SUCCEEDED(hr), "Failed to get script properties, hr %#x.\n", hr);
989
990 hr = pScriptItemizeOpenType(string, cchString, 15, Control, State, outpItems, tags, &outnItems);
991 if (valid > 0)
992 winetest_ok(hr == S_OK, "ScriptItemizeOpenType should return S_OK not %08x\n", hr);
993 else if (hr != S_OK)
994 winetest_trace("ScriptItemizeOpenType should return S_OK not %08x\n", hr);
995
996 if (outnItems <= item)
997 {
998 if (valid > 0)
999 winetest_win_skip("Did not get enough items\n");
1000 else
1001 winetest_trace("Did not get enough items\n");
1002 return;
1003 }
1004
1005 logclust = HeapAlloc(GetProcessHeap(), 0, sizeof(WORD) * cchString);
1006 memset(logclust,'a',sizeof(WORD) * cchString);
1007 charProp = HeapAlloc(GetProcessHeap(), 0, sizeof(SCRIPT_CHARPROP) * cchString);
1008 memset(charProp,'a',sizeof(SCRIPT_CHARPROP) * cchString);
1009 glyphs = HeapAlloc(GetProcessHeap(), 0, sizeof(WORD) * maxGlyphs);
1010 memset(glyphs,'a',sizeof(WORD) * cchString);
1011 glyphProp = HeapAlloc(GetProcessHeap(), 0, sizeof(SCRIPT_GLYPHPROP) * maxGlyphs);
1012 memset(glyphProp,'a',sizeof(SCRIPT_GLYPHPROP) * cchString);
1013
1014 string2 = HeapAlloc(GetProcessHeap(), 0, cchString * sizeof(*string2));
1015 logclust2 = HeapAlloc(GetProcessHeap(), 0, cchString * sizeof(*logclust2));
1016 memset(logclust2, 'a', cchString * sizeof(*logclust2));
1017 charProp2 = HeapAlloc(GetProcessHeap(), 0, cchString * sizeof(*charProp2));
1018 memset(charProp2, 'a', cchString * sizeof(*charProp2));
1019 glyphs2 = HeapAlloc(GetProcessHeap(), 0, maxGlyphs * sizeof(*glyphs2));
1020 memset(glyphs2, 'a', maxGlyphs * sizeof(*glyphs2));
1021 glyphProp2 = HeapAlloc(GetProcessHeap(), 0, maxGlyphs * sizeof(*glyphProp2));
1022 memset(glyphProp2, 'a', maxGlyphs * sizeof(*glyphProp2));
1023
1024 winetest_ok(!outpItems[item].a.fLogicalOrder, "Got unexpected fLogicalOrder %#x.\n",
1025 outpItems[item].a.fLogicalOrder);
1026 hr = pScriptShapeOpenType(hdc, &sc, &outpItems[item].a, tags[item], 0x00000000, NULL, NULL, 0, string, cchString, maxGlyphs, logclust, charProp, glyphs, glyphProp, &outnGlyphs);
1027 if (valid > 0)
1028 winetest_ok(hr == S_OK, "ScriptShapeOpenType failed (%x)\n",hr);
1029 else if (hr != S_OK)
1030 winetest_trace("ScriptShapeOpenType failed (%x)\n",hr);
1031 if (FAILED(hr))
1032 goto cleanup;
1033
1034 for (x = 0; x < cchString; x++)
1035 {
1036 if (valid > 0)
1037 winetest_ok(logclust[x] == charItems[x].wLogClust, "%i: invalid LogClust(%i)\n",x,logclust[x]);
1038 else if (logclust[x] != charItems[x].wLogClust)
1039 winetest_trace("%i: invalid LogClust(%i)\n",x,logclust[x]);
1040 if (valid > 0)
1041 winetest_ok(charProp[x].fCanGlyphAlone == charItems[x].CharProp.fCanGlyphAlone, "%i: invalid fCanGlyphAlone\n",x);
1042 else if (charProp[x].fCanGlyphAlone != charItems[x].CharProp.fCanGlyphAlone)
1043 winetest_trace("%i: invalid fCanGlyphAlone\n",x);
1044 }
1045
1046 if (valid > 0)
1047 winetest_ok(nGlyphs == outnGlyphs, "got incorrect number of glyphs (%i)\n",outnGlyphs);
1048 else if (nGlyphs != outnGlyphs)
1049 winetest_trace("got incorrect number of glyphs (%i)\n",outnGlyphs);
1050 for (x = 0; x < outnGlyphs; x++)
1051 {
1052 if (glyphItems[x].Glyph)
1053 {
1054 if (valid > 0)
1055 winetest_ok(glyphs[x]!=0, "%i: Glyph not present when it should be\n",x);
1056 else if (glyphs[x]==0)
1057 winetest_trace("%i: Glyph not present when it should be\n",x);
1058 }
1059 else
1060 {
1061 if (valid > 0)
1062 winetest_ok(glyphs[x]==0, "%i: Glyph present when it should not be\n",x);
1063 else if (glyphs[x]!=0)
1064 winetest_trace("%i: Glyph present when it should not be\n",x);
1065 }
1066 if (valid > 0)
1067 {
1069 winetest_ok(glyphProp[x].sva.uJustification == glyphItems[x].GlyphProp.sva.uJustification ||
1070 (props2 && glyphProp[x].sva.uJustification == props2[x].sva.uJustification),
1071 "%i: uJustification incorrect (%i)\n",x,glyphProp[x].sva.uJustification);
1072 }
1073 else if (glyphProp[x].sva.uJustification != glyphItems[x].GlyphProp.sva.uJustification)
1074 {
1075 winetest_trace("%i: uJustification incorrect (%i)\n",x,glyphProp[x].sva.uJustification);
1076 }
1077 if (valid > 0)
1078 winetest_ok(glyphProp[x].sva.fClusterStart == glyphItems[x].GlyphProp.sva.fClusterStart ||
1079 (props2 && glyphProp[x].sva.fClusterStart == props2[x].sva.fClusterStart),
1080 "%i: fClusterStart incorrect (%i)\n",x,glyphProp[x].sva.fClusterStart);
1081 else if (glyphProp[x].sva.fClusterStart != glyphItems[x].GlyphProp.sva.fClusterStart)
1082 winetest_trace("%i: fClusterStart incorrect (%i)\n",x,glyphProp[x].sva.fClusterStart);
1083 if (valid > 0)
1084 winetest_ok(glyphProp[x].sva.fDiacritic == glyphItems[x].GlyphProp.sva.fDiacritic ||
1085 (props2 && glyphProp[x].sva.fDiacritic == props2[x].sva.fDiacritic),
1086 "%i: fDiacritic incorrect (%i)\n",x,glyphProp[x].sva.fDiacritic);
1087 else if (glyphProp[x].sva.fDiacritic != glyphItems[x].GlyphProp.sva.fDiacritic)
1088 winetest_trace("%i: fDiacritic incorrect (%i)\n",x,glyphProp[x].sva.fDiacritic);
1089 if (valid > 0)
1090 winetest_ok(glyphProp[x].sva.fZeroWidth == glyphItems[x].GlyphProp.sva.fZeroWidth ||
1091 (props2 && glyphProp[x].sva.fZeroWidth == props2[x].sva.fZeroWidth),
1092 "%i: fZeroWidth incorrect (%i)\n",x,glyphProp[x].sva.fZeroWidth);
1093 else if (glyphProp[x].sva.fZeroWidth != glyphItems[x].GlyphProp.sva.fZeroWidth)
1094 winetest_trace("%i: fZeroWidth incorrect (%i)\n",x,glyphProp[x].sva.fZeroWidth);
1095 }
1096
1097 outpItems[item].a.fLogicalOrder = 1;
1098 hr = pScriptShapeOpenType(hdc, &sc, &outpItems[item].a, tags[item], 0x00000000, NULL, NULL, 0,
1099 string, cchString, maxGlyphs, logclust2, charProp2, glyphs2, glyphProp2, &outnGlyphs2);
1100 winetest_ok(hr == S_OK, "ScriptShapeOpenType failed (%x)\n",hr);
1101 /* Cluster maps are hard. */
1102 if (tags[item] != thaa_tag && tags[item] != syrc_tag)
1103 {
1104 for (x = 0; x < cchString; ++x)
1105 {
1106 unsigned int compare_idx = outpItems[item].a.fRTL ? cchString - x - 1 : x;
1107 winetest_ok(logclust2[x] == logclust[compare_idx],
1108 "Got unexpected logclust2[%u] %#x, expected %#x.\n",
1109 x, logclust2[x], logclust[compare_idx]);
1110 winetest_ok(charProp2[x].fCanGlyphAlone == charProp[compare_idx].fCanGlyphAlone,
1111 "Got unexpected charProp2[%u].fCanGlyphAlone %#x, expected %#x.\n",
1112 x, charProp2[x].fCanGlyphAlone, charProp[compare_idx].fCanGlyphAlone);
1113 }
1114 }
1115 winetest_ok(outnGlyphs2 == outnGlyphs, "Got unexpected glyph count %u.\n", outnGlyphs2);
1116 for (x = 0; x < outnGlyphs2; ++x)
1117 {
1118 unsigned int compare_idx = outpItems[item].a.fRTL ? outnGlyphs2 - x - 1 : x;
1119 winetest_ok(glyphs2[x] == glyphs[compare_idx], "Got unexpected glyphs2[%u] %#x, expected %#x.\n",
1120 x, glyphs2[x], glyphs[compare_idx]);
1121 winetest_ok(glyphProp2[x].sva.uJustification == glyphProp[compare_idx].sva.uJustification,
1122 "Got unexpected glyphProp2[%u].sva.uJustification %#x, expected %#x.\n",
1123 x, glyphProp2[x].sva.uJustification, glyphProp[compare_idx].sva.uJustification);
1124 winetest_ok(glyphProp2[x].sva.fClusterStart == glyphProp[compare_idx].sva.fClusterStart,
1125 "Got unexpected glyphProp2[%u].sva.fClusterStart %#x, expected %#x.\n",
1126 x, glyphProp2[x].sva.fClusterStart, glyphProp[compare_idx].sva.fClusterStart);
1127 winetest_ok(glyphProp2[x].sva.fDiacritic == glyphProp[compare_idx].sva.fDiacritic,
1128 "Got unexpected glyphProp2[%u].sva.fDiacritic %#x, expected %#x.\n",
1129 x, glyphProp2[x].sva.fDiacritic, glyphProp[compare_idx].sva.fDiacritic);
1130 winetest_ok(glyphProp2[x].sva.fZeroWidth == glyphProp[compare_idx].sva.fZeroWidth,
1131 "Got unexpected glyphProp2[%u].sva.fZeroWidth %#x, expected %#x.\n",
1132 x, glyphProp2[x].sva.fZeroWidth, glyphProp[compare_idx].sva.fZeroWidth);
1133 }
1134
1135 /* Most scripts get this wrong. For example, when the font has the
1136 * appropriate ligatures, "ttfffi" get rendered as "<ttf><ffi>", but
1137 * "<RLO>iffftt" gets rendered as "t<ft><ff>i". Arabic gets it right,
1138 * and there exist applications that depend on that. */
1139 if (tags[item] == arab_tag && broken(script_count <= 75))
1140 {
1141 winetest_win_skip("Test broken on this platform, skipping.\n");
1142 }
1143 else if (tags[item] == arab_tag)
1144 {
1145 for (x = 0; x < cchString; ++x)
1146 {
1147 string2[x] = string[cchString - x - 1];
1148 }
1149 outpItems[item].a.fLogicalOrder = 0;
1150 outpItems[item].a.fRTL = !outpItems[item].a.fRTL;
1151 hr = pScriptShapeOpenType(hdc, &sc, &outpItems[item].a, tags[item], 0x00000000, NULL, NULL, 0,
1152 string2, cchString, maxGlyphs, logclust2, charProp2, glyphs2, glyphProp2, &outnGlyphs2);
1153 winetest_ok(hr == S_OK, "ScriptShapeOpenType failed (%x)\n",hr);
1154 for (x = 0; x < cchString; ++x)
1155 {
1156 unsigned int compare_idx = cchString - x - 1;
1157 winetest_ok(logclust2[x] == logclust[compare_idx],
1158 "Got unexpected logclust2[%u] %#x, expected %#x.\n",
1159 x, logclust2[x], logclust[compare_idx]);
1160 winetest_ok(charProp2[x].fCanGlyphAlone == charProp[compare_idx].fCanGlyphAlone,
1161 "Got unexpected charProp2[%u].fCanGlyphAlone %#x, expected %#x.\n",
1162 x, charProp2[x].fCanGlyphAlone, charProp[compare_idx].fCanGlyphAlone);
1163 }
1164 winetest_ok(outnGlyphs2 == outnGlyphs, "Got unexpected glyph count %u.\n", outnGlyphs2);
1165 for (x = 0; x < outnGlyphs2; ++x)
1166 {
1167 winetest_ok(glyphs2[x] == glyphs[x], "Got unexpected glyphs2[%u] %#x, expected %#x.\n",
1168 x, glyphs2[x], glyphs[x]);
1169 winetest_ok(glyphProp2[x].sva.uJustification == glyphProp[x].sva.uJustification,
1170 "Got unexpected glyphProp2[%u].sva.uJustification %#x, expected %#x.\n",
1171 x, glyphProp2[x].sva.uJustification, glyphProp[x].sva.uJustification);
1172 winetest_ok(glyphProp2[x].sva.fClusterStart == glyphProp[x].sva.fClusterStart,
1173 "Got unexpected glyphProp2[%u].sva.fClusterStart %#x, expected %#x.\n",
1174 x, glyphProp2[x].sva.fClusterStart, glyphProp[x].sva.fClusterStart);
1175 winetest_ok(glyphProp2[x].sva.fDiacritic == glyphProp[x].sva.fDiacritic,
1176 "Got unexpected glyphProp2[%u].sva.fDiacritic %#x, expected %#x.\n",
1177 x, glyphProp2[x].sva.fDiacritic, glyphProp[x].sva.fDiacritic);
1178 winetest_ok(glyphProp2[x].sva.fZeroWidth == glyphProp[x].sva.fZeroWidth,
1179 "Got unexpected glyphProp2[%u].sva.fZeroWidth %#x, expected %#x.\n",
1180 x, glyphProp2[x].sva.fZeroWidth, glyphProp[x].sva.fZeroWidth);
1181 }
1182 outpItems[item].a.fLogicalOrder = 1;
1183 hr = pScriptShapeOpenType(hdc, &sc, &outpItems[item].a, tags[item], 0x00000000, NULL, NULL, 0,
1184 string2, cchString, maxGlyphs, logclust2, charProp2, glyphs2, glyphProp2, &outnGlyphs2);
1185 winetest_ok(hr == S_OK, "ScriptShapeOpenType failed (%x)\n",hr);
1186 for (x = 0; x < cchString; ++x)
1187 {
1188 unsigned int compare_idx = outpItems[item].a.fRTL ? x : cchString - x - 1;
1189 winetest_ok(logclust2[x] == logclust[compare_idx], "Got unexpected logclust2[%u] %#x, expected %#x.\n",
1190 x, logclust2[x], logclust[compare_idx]);
1191 winetest_ok(charProp2[x].fCanGlyphAlone == charProp[compare_idx].fCanGlyphAlone,
1192 "Got unexpected charProp2[%u].fCanGlyphAlone %#x, expected %#x.\n",
1193 x, charProp2[x].fCanGlyphAlone, charProp[compare_idx].fCanGlyphAlone);
1194 }
1195 winetest_ok(outnGlyphs2 == outnGlyphs, "Got unexpected glyph count %u.\n", outnGlyphs2);
1196 for (x = 0; x < outnGlyphs2; ++x)
1197 {
1198 unsigned int compare_idx = outpItems[item].a.fRTL ? outnGlyphs2 - x - 1 : x;
1199 winetest_ok(glyphs2[x] == glyphs[compare_idx], "Got unexpected glyphs2[%u] %#x, expected %#x.\n",
1200 x, glyphs2[x], glyphs[compare_idx]);
1201 winetest_ok(glyphProp2[x].sva.uJustification == glyphProp[compare_idx].sva.uJustification,
1202 "Got unexpected glyphProp2[%u].sva.uJustification %#x, expected %#x.\n",
1203 x, glyphProp2[x].sva.uJustification, glyphProp[compare_idx].sva.uJustification);
1204 winetest_ok(glyphProp2[x].sva.fClusterStart == glyphProp[compare_idx].sva.fClusterStart,
1205 "Got unexpected glyphProp2[%u].sva.fClusterStart %#x, expected %#x.\n",
1206 x, glyphProp2[x].sva.fClusterStart, glyphProp[compare_idx].sva.fClusterStart);
1207 winetest_ok(glyphProp2[x].sva.fDiacritic == glyphProp[compare_idx].sva.fDiacritic,
1208 "Got unexpected glyphProp2[%u].sva.fDiacritic %#x, expected %#x.\n",
1209 x, glyphProp2[x].sva.fDiacritic, glyphProp[compare_idx].sva.fDiacritic);
1210 winetest_ok(glyphProp2[x].sva.fZeroWidth == glyphProp[compare_idx].sva.fZeroWidth,
1211 "Got unexpected glyphProp2[%u].sva.fZeroWidth %#x, expected %#x.\n",
1212 x, glyphProp2[x].sva.fZeroWidth, glyphProp[compare_idx].sva.fZeroWidth);
1213 }
1214 }
1215
1216cleanup:
1218 HeapFree(GetProcessHeap(),0,logclust2);
1219 HeapFree(GetProcessHeap(),0,charProp2);
1220 HeapFree(GetProcessHeap(),0,glyphs2);
1221 HeapFree(GetProcessHeap(),0,glyphProp2);
1222
1223 HeapFree(GetProcessHeap(),0,logclust);
1224 HeapFree(GetProcessHeap(),0,charProp);
1226 HeapFree(GetProcessHeap(),0,glyphProp);
1227 ScriptFreeCache(&sc);
1228}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
static void cleanup(void)
Definition: main.c:1335
HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *psc)
Definition: usp10.c:1080
HRESULT WINAPI ScriptGetProperties(const SCRIPT_PROPERTIES ***props, int *num)
Definition: usp10.c:1154
BOOLEAN valid
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
static UINT UINT LPWORD glyphs
Definition: font.c:44
static CHAR string2[MAX_PATH]
Definition: automation.c:449
static ATOM item
Definition: dde.c:856
#define syrc_tag
Definition: usp10.c:146
#define thaa_tag
Definition: usp10.c:147
#define arab_tag
Definition: usp10.c:143
WORD fLogicalOrder
Definition: usp10.h:144
SCRIPT_ANALYSIS a
Definition: usp10.h:151
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ create_test_window()

static HWND create_test_window ( void  )
static

Definition at line 3383 of file usp10.c.

3384{
3385 HWND hwnd = CreateWindowExA(0, "Static", "", WS_POPUP, 0, 0, 100, 100, 0, 0, 0, NULL);
3386 ok(hwnd != NULL, "Failed to create test window.\n");
3387
3390
3391 return hwnd;
3392}
#define ok(value,...)
Definition: atltest.h:57
#define WS_POPUP
Definition: pedump.c:616
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI UpdateWindow(_In_ HWND)
#define SW_SHOW
Definition: winuser.h:775

Referenced by test_script_cache_reuse(), and test_ScriptCacheGetHeight().

◆ enum_bitmap_font_proc()

static INT CALLBACK enum_bitmap_font_proc ( const LOGFONTA lf,
const TEXTMETRICA ntm,
DWORD  type,
LPARAM  lParam 
)
static

Definition at line 2475 of file usp10.c.

2476{
2477 struct enum_font_data *efnd = (struct enum_font_data *)lParam;
2478
2479 if (type & (TRUETYPE_FONTTYPE | DEVICE_FONTTYPE)) return 1;
2480
2481 if (efnd->total < MAX_ENUM_FONTS)
2482 {
2483 efnd->elf[efnd->total++] = *(ENUMLOGFONTA*)lf;
2484 }
2485 else
2486 trace("enum tests invalid; you have more than %d fonts\n", MAX_ENUM_FONTS);
2487
2488 return 1;
2489}
#define trace
Definition: atltest.h:70
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define MAX_ENUM_FONTS
Definition: usp10.c:2467
ENUMLOGFONTA elf[MAX_ENUM_FONTS]
Definition: usp10.c:2472
LOGFONTA * lf
Definition: font.c:2789
#define DEVICE_FONTTYPE
Definition: wingdi.h:1108
#define TRUETYPE_FONTTYPE
Definition: wingdi.h:1109

Referenced by test_ScriptGetFontProperties().

◆ enum_proc()

static BOOL CALLBACK enum_proc ( LGRPID  group,
LCID  lcid,
LPSTR  locale,
LONG_PTR  lparam 
)
static

Definition at line 3640 of file usp10.c.

3641{
3642 HRESULT hr;
3644 SCRIPT_CONTROL sc;
3646 LCID lcid_old;
3647
3648 if (!IsValidLocale(lcid, LCID_INSTALLED)) return TRUE;
3649
3650 memset(&sds, 0, sizeof(sds));
3651 memset(&sc, 0, sizeof(sc));
3652 memset(&ss, 0, sizeof(ss));
3653
3654 lcid_old = GetThreadLocale();
3655 if (!SetThreadLocale(lcid)) return TRUE;
3656
3657 hr = ScriptRecordDigitSubstitution(lcid, &sds);
3658 ok(hr == S_OK, "ScriptRecordDigitSubstitution failed: 0x%08x\n", hr);
3659
3660 hr = ScriptApplyDigitSubstitution(&sds, &sc, &ss);
3661 ok(hr == S_OK, "ScriptApplyDigitSubstitution failed: 0x%08x\n", hr);
3662
3663 SetThreadLocale(lcid_old);
3664 return TRUE;
3665}
LCID WINAPI GetThreadLocale(void)
Definition: locale.c:2800
BOOL WINAPI SetThreadLocale(LCID lcid)
Definition: locale.c:2819
BOOL WINAPI IsValidLocale(LCID lcid, DWORD flags)
Definition: locale.c:2922
HRESULT WINAPI ScriptApplyDigitSubstitution(const SCRIPT_DIGITSUBSTITUTE *sds, SCRIPT_CONTROL *sc, SCRIPT_STATE *ss)
Definition: usp10.c:1275
HRESULT WINAPI ScriptRecordDigitSubstitution(LCID locale, SCRIPT_DIGITSUBSTITUTE *sds)
Definition: usp10.c:1209
#define ss
Definition: i386-dis.c:441
DWORD LCID
Definition: nls.h:13
#define LCID_INSTALLED
Definition: winnls.h:201

Referenced by test_digit_substitution().

◆ enum_truetype_proc()

static INT CALLBACK enum_truetype_proc ( const LOGFONTA lf,
const TEXTMETRICA ntm,
DWORD  type,
LPARAM  lParam 
)
static

Definition at line 2491 of file usp10.c.

2492{
2493 struct enum_font_data *efnd = (struct enum_font_data *)lParam;
2494
2495 if (!(type & (TRUETYPE_FONTTYPE | DEVICE_FONTTYPE))) return 1;
2496
2497 if (efnd->total < MAX_ENUM_FONTS)
2498 {
2499 efnd->elf[efnd->total++] = *(ENUMLOGFONTA*)lf;
2500 }
2501 else
2502 trace("enum tests invalid; you have more than %d fonts\n", MAX_ENUM_FONTS);
2503
2504 return 1;
2505}

Referenced by test_ScriptGetFontProperties().

◆ enumFontProc()

static int CALLBACK enumFontProc ( const LOGFONTA lpelfe,
const TEXTMETRICA lpntme,
DWORD  FontType,
LPARAM  lParam 
)
static

Definition at line 1244 of file usp10.c.

1245{
1246 NEWTEXTMETRICEXA *ntme = (NEWTEXTMETRICEXA*)lpntme;
1248 int idx = 0;
1249 DWORD i;
1250 DWORD mask = 0;
1251
1252 if (FontType != TRUETYPE_FONTTYPE)
1253 return 1;
1254
1255 i = rp->range;
1256 while (i >= sizeof(DWORD)*8)
1257 {
1258 idx++;
1259 i -= (sizeof(DWORD)*8);
1260 }
1261 if (idx > 3)
1262 return 0;
1263
1264 mask = 1 << i;
1265
1266 if (ntme->ntmFontSig.fsUsb[idx] & mask)
1267 {
1268 memcpy(&(rp->lf),lpelfe,sizeof(LOGFONTA));
1269 return 0;
1270 }
1271 return 1;
1272}
unsigned int idx
Definition: utils.c:41
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLint GLuint mask
Definition: glext.h:6028
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define DWORD
Definition: nt_native.h:44
DWORD fsUsb[4]
Definition: wingdi.h:1542
FONTSIGNATURE ntmFontSig
Definition: wingdi.h:2672
BYTE range
Definition: usp10.c:1240
LOGFONTA lf
Definition: usp10.c:1241

Referenced by _find_font_for_range().

◆ HRESULT()

static HRESULT ( WINAPI pScriptItemizeOpenType) const
static

◆ init_tests()

static void init_tests ( void  )
static

Definition at line 4177 of file usp10.c.

4178{
4179 HMODULE module = GetModuleHandleA("usp10.dll");
4180
4181 ok(module != 0, "Expected usp10.dll to be loaded.\n");
4182
4183 pScriptItemizeOpenType = (void *)GetProcAddress(module, "ScriptItemizeOpenType");
4184 pScriptShapeOpenType = (void *)GetProcAddress(module, "ScriptShapeOpenType");
4185 pScriptGetFontScriptTags = (void *)GetProcAddress(module, "ScriptGetFontScriptTags");
4186 pScriptGetFontLanguageTags = (void *)GetProcAddress(module, "ScriptGetFontLanguageTags");
4187 pScriptGetFontFeatureTags = (void *)GetProcAddress(module, "ScriptGetFontFeatureTags");
4188}
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812

Referenced by START_TEST().

◆ make_surrogate()

static void make_surrogate ( DWORD  i,
WORD  out[2] 
)
static

Definition at line 925 of file usp10.c.

926{
927 static const DWORD mask = (1 << 10) - 1;
928
929 if (i <= 0xffff)
930 {
931 out[0] = i;
932 out[1] = 0;
933 }
934 else
935 {
936 i -= 0x010000;
937 out[0] = ((i >> 10) & mask) + 0xd800;
938 out[1] = (i & mask) + 0xdc00;
939 }
940}
static FILE * out
Definition: regtests2xml.c:44

Referenced by test_ScriptItemize_surrogates().

◆ START_TEST()

START_TEST ( usp10  )

Definition at line 4190 of file usp10.c.

4191{
4192 HWND hwnd;
4193 HDC hdc;
4194 LOGFONTA lf;
4195 HFONT hfont;
4196
4197 unsigned short pwOutGlyphs[256];
4198
4199 /* We need a valid HDC to drive a lot of Script functions which requires the following *
4200 * to set up for the tests. */
4201 hwnd = CreateWindowExA(0, "static", "", WS_POPUP, 0,0,100,100,
4202 0, 0, 0, NULL);
4203 assert(hwnd != 0);
4206
4207 hdc = GetDC(hwnd); /* We now have a hdc */
4208 ok( hdc != NULL, "HDC failed to be created %p\n", hdc);
4209
4210 memset(&lf, 0, sizeof(LOGFONTA));
4211 lstrcpyA(lf.lfFaceName, "Tahoma");
4212 lf.lfHeight = 10;
4213 lf.lfWeight = 3;
4214 lf.lfWidth = 10;
4215
4217 ok(hfont != NULL, "SelectObject failed: %p\n", hfont);
4218
4219 init_tests();
4220
4230
4239
4244 test_newlines();
4245
4248
4251
4252 ReleaseDC(hwnd, hdc);
4254}
#define assert(x)
Definition: debug.h:53
static HDC
Definition: imagelist.c:92
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static void test_ScriptCacheGetHeight(HDC hdc)
Definition: usp10.c:3394
static void test_ScriptShape(HDC hdc)
Definition: usp10.c:1833
static void test_ScriptString_pSize(HDC hdc)
Definition: usp10.c:4041
static void test_ScriptGetFontProperties(HDC hdc)
Definition: usp10.c:2507
static void test_ScriptIsComplex(void)
Definition: usp10.c:3979
static void init_tests(void)
Definition: usp10.c:4177
static void test_ScriptGetGlyphABCWidth(HDC hdc)
Definition: usp10.c:3466
static void test_ScriptGetProperties(void)
Definition: usp10.c:3699
static void test_ScriptItemize(void)
Definition: usp10.c:180
static void test_ScriptBreak(void)
Definition: usp10.c:3718
static void test_ScriptItemIzeShapePlace(HDC hdc, unsigned short pwOutGlyphs[256])
Definition: usp10.c:2221
static void test_digit_substitution(void)
Definition: usp10.c:3667
static void test_ScriptXtoX(void)
Definition: usp10.c:3037
static void test_ScriptString(HDC hdc)
Definition: usp10.c:3168
static void test_ScriptGetFontFunctions(HDC hdc)
Definition: usp10.c:3812
static void test_ScriptItemize_surrogates(void)
Definition: usp10.c:942
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD SCRIPT_CHARPROP WORD * pwOutGlyphs
Definition: usp10.c:64
static void test_ScriptGetCMap(HDC hdc, unsigned short pwOutGlyphs[256])
Definition: usp10.c:2369
static void test_ScriptPlace(HDC hdc)
Definition: usp10.c:2093
static void test_ScriptGetLogicalWidths(void)
Definition: usp10.c:3951
static void test_ScriptTextOut2(HDC hdc)
Definition: usp10.c:2780
static void test_script_cache_reuse(void)
Definition: usp10.c:4071
static void test_ScriptLayout(void)
Definition: usp10.c:3544
static void test_newlines(void)
Definition: usp10.c:3775
static void test_ScriptShapeOpenType(HDC hdc)
Definition: usp10.c:1357
static void test_ScriptTextOut(HDC hdc)
Definition: usp10.c:2694
static void test_ScriptTextOut3(HDC hdc)
Definition: usp10.c:2847
static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
Definition: usp10.c:3237
LONG lfHeight
Definition: dimm.idl:42
LONG lfWeight
Definition: dimm.idl:46
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
LONG lfWidth
Definition: dimm.idl:43
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)
BOOL WINAPI DestroyWindow(_In_ HWND)

◆ test_digit_substitution()

static void test_digit_substitution ( void  )
static

Definition at line 3667 of file usp10.c.

3668{
3669 BOOL ret;
3670 unsigned int i;
3671 static const LGRPID groups[] =
3672 {
3690 };
3691
3692 for (i = 0; i < ARRAY_SIZE(groups); ++i)
3693 {
3695 ok(ret, "EnumLanguageGroupLocalesA failed unexpectedly: %u\n", GetLastError());
3696 }
3697}
#define ARRAY_SIZE(A)
Definition: main.h:33
BOOL WINAPI EnumLanguageGroupLocalesA(LANGGROUPLOCALE_ENUMPROCA pLangGrpLcEnumProc, LGRPID lgrpid, DWORD dwFlags, LONG_PTR lParam)
Definition: locale.c:4774
GLsizei GLuint * groups
Definition: glext.h:11113
static BOOL CALLBACK enum_proc(LGRPID group, LCID lcid, LPSTR locale, LONG_PTR lparam)
Definition: usp10.c:3640
int ret
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define LGRPID_GEORGIAN
Definition: winnls.h:475
#define LGRPID_SIMPLIFIED_CHINESE
Definition: winnls.h:469
DWORD LGRPID
Definition: winnls.h:520
#define LGRPID_TRADITIONAL_CHINESE
Definition: winnls.h:468
#define LGRPID_KOREAN
Definition: winnls.h:467
#define LGRPID_ARMENIAN
Definition: winnls.h:476
#define LGRPID_JAPANESE
Definition: winnls.h:466
#define LGRPID_WESTERN_EUROPE
Definition: winnls.h:460
#define LGRPID_CENTRAL_EUROPE
Definition: winnls.h:461
#define LGRPID_INDIC
Definition: winnls.h:474
#define LGRPID_ARABIC
Definition: winnls.h:472
#define LGRPID_VIETNAMESE
Definition: winnls.h:473
#define LGRPID_THAI
Definition: winnls.h:470
#define LGRPID_HEBREW
Definition: winnls.h:471
#define LGRPID_CYRILLIC
Definition: winnls.h:464
#define LGRPID_TURKISH
Definition: winnls.h:465
#define LGRPID_BALTIC
Definition: winnls.h:462
#define LGRPID_GREEK
Definition: winnls.h:463

Referenced by START_TEST().

◆ test_newlines()

static void test_newlines ( void  )
static

Definition at line 3775 of file usp10.c.

3776{
3777 static const WCHAR test1[] = {'t','e','x','t','\r','t','e','x','t',0};
3778 static const WCHAR test2[] = {'t','e','x','t','\n','t','e','x','t',0};
3779 static const WCHAR test3[] = {'t','e','x','t','\r','\n','t','e','x','t',0};
3780 static const WCHAR test4[] = {'t','e','x','t','\n','\r','t','e','x','t',0};
3781 static const WCHAR test5[] = {'1','2','3','4','\n','\r','1','2','3','4',0};
3782 SCRIPT_ITEM items[5];
3783 HRESULT hr;
3784 int count;
3785
3786 count = 0;
3788 ok(hr == S_OK, "ScriptItemize failed: 0x%08x\n", hr);
3789 ok(count == 3, "got %d expected 3\n", count);
3790
3791 count = 0;
3793 ok(hr == S_OK, "ScriptItemize failed: 0x%08x\n", hr);
3794 ok(count == 3, "got %d expected 3\n", count);
3795
3796 count = 0;
3798 ok(hr == S_OK, "ScriptItemize failed: 0x%08x\n", hr);
3799 ok(count == 4, "got %d expected 4\n", count);
3800
3801 count = 0;
3803 ok(hr == S_OK, "ScriptItemize failed: 0x%08x\n", hr);
3804 ok(count == 4, "got %d expected 4\n", count);
3805
3806 count = 0;
3808 ok(hr == S_OK, "ScriptItemize failed: 0x%08x\n", hr);
3809 ok(count == 4, "got %d expected 4\n", count);
3810}
#define lstrlenW
Definition: compat.h:750
void test2()
Definition: ehthrow.cxx:284
void test1()
Definition: ehthrow.cxx:277
void test4()
Definition: ehthrow.cxx:298
void test3()
Definition: ehthrow.cxx:291
void test5()
Definition: ehthrow.cxx:305
GLuint GLuint GLsizei count
Definition: gl.h:1545

Referenced by START_TEST().

◆ test_script_cache_reuse()

static void test_script_cache_reuse ( void  )
static

Definition at line 4071 of file usp10.c.

4072{
4073 HRESULT hr;
4074 HWND hwnd1, hwnd2;
4075 HDC hdc1, hdc2;
4076 LOGFONTA lf;
4077 HFONT hfont1, hfont2;
4078 HFONT prev_hfont1, prev_hfont2;
4079 SCRIPT_CACHE sc = NULL;
4080 SCRIPT_CACHE sc2;
4081 LONG height;
4082
4083 hwnd1 = create_test_window();
4084 hwnd2 = create_test_window();
4085
4086 hdc1 = GetDC(hwnd1);
4087 hdc2 = GetDC(hwnd2);
4088 ok(hdc1 != NULL && hdc2 != NULL, "Failed to get window dc.\n");
4089
4090 memset(&lf, 0, sizeof(LOGFONTA));
4091 lstrcpyA(lf.lfFaceName, "Tahoma");
4092
4093 lf.lfHeight = 10;
4094 hfont1 = CreateFontIndirectA(&lf);
4095 ok(hfont1 != NULL, "CreateFontIndirectA failed\n");
4096 hfont2 = CreateFontIndirectA(&lf);
4097 ok(hfont2 != NULL, "CreateFontIndirectA failed\n");
4098 ok(hfont1 != hfont2, "Expected fonts %p and %p to differ\n", hfont1, hfont2);
4099
4100 prev_hfont1 = SelectObject(hdc1, hfont1);
4101 ok(prev_hfont1 != NULL, "SelectObject failed: %p\n", prev_hfont1);
4102 prev_hfont2 = SelectObject(hdc2, hfont1);
4103 ok(prev_hfont2 != NULL, "SelectObject failed: %p\n", prev_hfont2);
4104
4105 /* Get a script cache */
4107 ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
4108 ok(sc != NULL, "Script cache is NULL\n");
4109
4110 /* Same font, same DC -> same SCRIPT_CACHE */
4111 sc2 = NULL;
4113 ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
4114 ok(sc2 != NULL, "Script cache is NULL\n");
4115 ok(sc == sc2, "Expected caches %p, %p to be identical\n", sc, sc2);
4116 ScriptFreeCache(&sc2);
4117
4118 /* Same font in different DC -> same SCRIPT_CACHE */
4119 sc2 = NULL;
4121 ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
4122 ok(sc2 != NULL, "Script cache is NULL\n");
4123 ok(sc == sc2, "Expected caches %p, %p to be identical\n", sc, sc2);
4124 ScriptFreeCache(&sc2);
4125
4126 /* Same font face & size, but different font handle */
4127 ok(SelectObject(hdc1, hfont2) != NULL, "SelectObject failed\n");
4128 ok(SelectObject(hdc2, hfont2) != NULL, "SelectObject failed\n");
4129
4130 sc2 = NULL;
4132 ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
4133 ok(sc2 != NULL, "Script cache is NULL\n");
4134 ok(sc == sc2, "Expected caches %p, %p to be identical\n", sc, sc2);
4135 ScriptFreeCache(&sc2);
4136
4137 sc2 = NULL;
4139 ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
4140 ok(sc2 != NULL, "Script cache is NULL\n");
4141 ok(sc == sc2, "Expected caches %p, %p to be identical\n", sc, sc2);
4142 ScriptFreeCache(&sc2);
4143
4144 /* Different font size -- now we get a different SCRIPT_CACHE */
4145 SelectObject(hdc1, prev_hfont1);
4146 SelectObject(hdc2, prev_hfont2);
4147 DeleteObject(hfont2);
4148 lf.lfHeight = 20;
4149 hfont2 = CreateFontIndirectA(&lf);
4150 ok(hfont2 != NULL, "CreateFontIndirectA failed\n");
4151 ok(SelectObject(hdc1, hfont2) != NULL, "SelectObject failed\n");
4152 ok(SelectObject(hdc2, hfont2) != NULL, "SelectObject failed\n");
4153
4154 sc2 = NULL;
4156 ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
4157 ok(sc2 != NULL, "Script cache is NULL\n");
4158 ok(sc != sc2, "Expected caches %p, %p to be different\n", sc, sc2);
4159 ScriptFreeCache(&sc2);
4160
4161 sc2 = NULL;
4163 ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
4164 ok(sc2 != NULL, "Script cache is NULL\n");
4165 ok(sc != sc2, "Expected caches %p, %p to be different\n", sc, sc2);
4166 ScriptFreeCache(&sc2);
4167
4168 ScriptFreeCache(&sc);
4169 SelectObject(hdc1, prev_hfont1);
4170 SelectObject(hdc2, prev_hfont2);
4171 DeleteObject(hfont1);
4172 DeleteObject(hfont2);
4173 DestroyWindow(hwnd1);
4174 DestroyWindow(hwnd2);
4175}
HDC hdc1
Definition: SelectObject.c:10
HDC hdc2
Definition: SelectObject.c:10
HRESULT WINAPI ScriptCacheGetHeight(HDC hdc, SCRIPT_CACHE *psc, LONG *height)
Definition: usp10.c:3680
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
static HWND create_test_window(void)
Definition: usp10.c:3383
long LONG
Definition: pedump.c:60

Referenced by START_TEST().

◆ test_ScriptBreak()

static void test_ScriptBreak ( void  )
static

Definition at line 3718 of file usp10.c.

3719{
3720 static const WCHAR test[] = {' ','\r','\n',0};
3721 SCRIPT_ITEM items[4];
3722 SCRIPT_LOGATTR la;
3723 HRESULT hr;
3724
3725 hr = ScriptItemize(test, 3, 4, NULL, NULL, items, NULL);
3726 ok(hr == S_OK, "ScriptItemize should return S_OK not %08x\n", hr);
3727
3728 /*
3729 * This Test crashes pre Vista.
3730
3731 hr = ScriptBreak(test, 1, &items[0].a, NULL);
3732 ok(hr == E_INVALIDARG, "ScriptBreak should return E_INVALIDARG not %08x\n", hr);
3733 */
3734
3735 hr = ScriptBreak(test, 0, &items[0].a, &la);
3736 ok(hr == E_FAIL || broken(hr == S_OK), "ScriptBreak should return E_FAIL not %08x\n", hr);
3737
3738 hr = ScriptBreak(test, -1, &items[0].a, &la);
3739 ok(hr == E_INVALIDARG || broken(hr == S_OK), "ScriptBreak should return E_INVALIDARG not %08x\n", hr);
3740
3741 memset(&la, 0, sizeof(la));
3742 hr = ScriptBreak(test, 1, &items[0].a, &la);
3743 ok(hr == S_OK, "ScriptBreak should return S_OK not %08x\n", hr);
3744
3745 ok(!la.fSoftBreak, "fSoftBreak set\n");
3746 ok(la.fWhiteSpace, "fWhiteSpace not set\n");
3747 ok(la.fCharStop, "fCharStop not set\n");
3748 ok(!la.fWordStop, "fWordStop set\n");
3749 ok(!la.fInvalid, "fInvalid set\n");
3750 ok(!la.fReserved, "fReserved set\n");
3751
3752 memset(&la, 0, sizeof(la));
3753 hr = ScriptBreak(test + 1, 1, &items[1].a, &la);
3754 ok(hr == S_OK, "ScriptBreak should return S_OK not %08x\n", hr);
3755
3756 ok(!la.fSoftBreak, "fSoftBreak set\n");
3757 ok(!la.fWhiteSpace, "fWhiteSpace set\n");
3758 ok(la.fCharStop, "fCharStop not set\n");
3759 ok(!la.fWordStop, "fWordStop set\n");
3760 ok(!la.fInvalid, "fInvalid set\n");
3761 ok(!la.fReserved, "fReserved set\n");
3762
3763 memset(&la, 0, sizeof(la));
3764 hr = ScriptBreak(test + 2, 1, &items[2].a, &la);
3765 ok(hr == S_OK, "ScriptBreak should return S_OK not %08x\n", hr);
3766
3767 ok(!la.fSoftBreak, "fSoftBreak set\n");
3768 ok(!la.fWhiteSpace, "fWhiteSpace set\n");
3769 ok(la.fCharStop, "fCharStop not set\n");
3770 ok(!la.fWordStop, "fWordStop set\n");
3771 ok(!la.fInvalid, "fInvalid set\n");
3772 ok(!la.fReserved, "fReserved set\n");
3773}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
HRESULT WINAPI ScriptBreak(const WCHAR *chars, int count, const SCRIPT_ANALYSIS *sa, SCRIPT_LOGATTR *la)
Definition: usp10.c:3047
#define test
Definition: rosglue.h:37
BYTE fWhiteSpace
Definition: usp10.h:188

Referenced by START_TEST().

◆ test_ScriptCacheGetHeight()

static void test_ScriptCacheGetHeight ( HDC  hdc)
static

Definition at line 3394 of file usp10.c.

3395{
3396 HFONT hfont, prev_hfont;
3397 SCRIPT_CACHE sc = NULL;
3398 LONG height, height2;
3400 LOGFONTA lf;
3401 HRESULT hr;
3402 HWND hwnd;
3403 HDC hdc2;
3404
3406 ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr);
3407
3409 ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr);
3410
3412 ok(hr == E_PENDING, "expected E_PENDING, got 0x%08x\n", hr);
3413
3414 height = 123;
3416 ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
3417 ok(height == 123, "Unexpected height.\n");
3418
3419 memset(&tm, 0, sizeof(tm));
3421 ok(tm.tmHeight > 0, "Unexpected tmHeight %u.\n", tm.tmHeight);
3422
3423 height = 0;
3425 ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
3426 ok(height == tm.tmHeight, "expected height > 0\n");
3427
3428 /* Try again with NULL dc. */
3429 height2 = 0;
3430 hr = ScriptCacheGetHeight(NULL, &sc, &height2);
3431 ok(hr == S_OK, "Failed to get cached height, hr %#x.\n", hr);
3432 ok(height2 == height, "Unexpected height %u.\n", height2);
3433
3435
3436 hdc2 = GetDC(hwnd);
3437 ok(hdc2 != NULL, "Failed to get window dc.\n");
3438
3439 memset(&lf, 0, sizeof(LOGFONTA));
3440 lstrcpyA(lf.lfFaceName, "Tahoma");
3441 lf.lfHeight = -32;
3442
3444 ok(hfont != NULL, "Failed to create font.\n");
3445
3446 prev_hfont = SelectObject(hdc2, hfont);
3447
3448 memset(&tm, 0, sizeof(tm));
3450 ok(tm.tmHeight > height, "Unexpected tmHeight %u.\n", tm.tmHeight);
3451
3452 height2 = 0;
3453 hr = ScriptCacheGetHeight(hdc2, &sc, &height2);
3454 ok(hr == S_OK, "Failed to get cached height, hr %#x.\n", hr);
3455 ok(height2 == height, "Unexpected height.\n");
3456
3457 SelectObject(hdc2, prev_hfont);
3459
3462
3463 ScriptFreeCache(&sc);
3464}
#define E_PENDING
Definition: dinput.h:172
Definition: time.h:68
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221

Referenced by START_TEST().

◆ test_ScriptGetCMap()

static void test_ScriptGetCMap ( HDC  hdc,
unsigned short  pwOutGlyphs[256] 
)
static

Definition at line 2369 of file usp10.c.

2370{
2371 HRESULT hr;
2373 int cInChars;
2374 int cChars;
2375 unsigned short pwOutGlyphs2[256];
2376 unsigned short pwOutGlyphs3[256];
2377 DWORD dwFlags;
2378 int cnt;
2379
2380 static const WCHAR TestItem1[] = {'T', 'e', 's', 't', 'a', 0};
2381 static const WCHAR TestItem2[] = {0x202B, 'i', 'n', 0x202C,0};
2382 static const WCHAR TestItem3[] = {'a','b','c','d','(','<','{','[',0x2039,0};
2383 static const WCHAR TestItem3b[] = {'a','b','c','d',')','>','}',']',0x203A,0};
2384
2385 /* Check to make sure that SCRIPT_CACHE gets allocated ok */
2386 dwFlags = 0;
2387 cInChars = cChars = 5;
2388 /* Some sanity checks for ScriptGetCMap */
2389
2390 hr = ScriptGetCMap(NULL, NULL, NULL, 0, 0, NULL);
2391 ok( hr == E_INVALIDARG, "(NULL,NULL,NULL,0,0,NULL), "
2392 "expected E_INVALIDARG, got %08x\n", hr);
2393
2394 hr = ScriptGetCMap(NULL, NULL, TestItem1, cInChars, dwFlags, pwOutGlyphs3);
2395 ok( hr == E_INVALIDARG, "(NULL,NULL,TestItem1, cInChars, dwFlags, pwOutGlyphs3), "
2396 "expected E_INVALIDARG, got %08x\n", hr);
2397
2398 /* Set psc to NULL, to be able to check if a pointer is returned in psc */
2399 psc = NULL;
2400 hr = ScriptGetCMap(NULL, &psc, TestItem1, cInChars, 0, pwOutGlyphs3);
2401 ok( hr == E_PENDING, "(NULL,&psc,NULL,0,0,NULL), expected E_PENDING, "
2402 "got %08x\n", hr);
2403 ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
2404
2405 /* Set psc to NULL but add hdc, to be able to check if a pointer is returned in psc */
2406 psc = NULL;
2407 hr = ScriptGetCMap(hdc, &psc, TestItem1, cInChars, 0, pwOutGlyphs3);
2408 ok( hr == S_OK, "ScriptGetCMap(NULL,&psc,NULL,0,0,NULL), expected S_OK, "
2409 "got %08x\n", hr);
2410 ok( psc != NULL, "ScriptGetCMap expected psc to be not NULL\n");
2412
2413 /* Set psc to NULL, to be able to check if a pointer is returned in psc */
2414 psc = NULL;
2415 hr = ScriptGetCMap(NULL, &psc, TestItem1, cInChars, dwFlags, pwOutGlyphs3);
2416 ok( hr == E_PENDING, "(NULL,&psc,), expected E_PENDING, got %08x\n", hr);
2417 ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
2418 /* Check to see if the results are the same as those returned by ScriptShape */
2419 hr = ScriptGetCMap(hdc, &psc, TestItem1, cInChars, dwFlags, pwOutGlyphs3);
2420 ok (hr == S_OK, "ScriptGetCMap should return S_OK not (%08x)\n", hr);
2421 ok (psc != NULL, "psc should not be null and have SCRIPT_CACHE buffer address\n");
2422 for (cnt=0; cnt < cChars && pwOutGlyphs[cnt] == pwOutGlyphs3[cnt]; cnt++) {}
2423 ok (cnt == cInChars, "Translation not correct. WCHAR %d - %04x != %04x\n",
2424 cnt, pwOutGlyphs[cnt], pwOutGlyphs3[cnt]);
2425
2427 ok (!psc, "psc is not null after ScriptFreeCache\n");
2428
2429 /* ScriptGetCMap returns whatever font defines, no special treatment for control chars */
2430 cInChars = cChars = 4;
2431 GetGlyphIndicesW(hdc, TestItem2, cInChars, pwOutGlyphs2, 0);
2432
2433 hr = ScriptGetCMap(hdc, &psc, TestItem2, cInChars, dwFlags, pwOutGlyphs3);
2434 if (pwOutGlyphs3[0] == 0 || pwOutGlyphs3[3] == 0)
2435 ok(hr == S_FALSE, "ScriptGetCMap should return S_FALSE not (%08x)\n", hr);
2436 else
2437 ok(hr == S_OK, "ScriptGetCMap should return S_OK not (%08x)\n", hr);
2438
2439 ok(psc != NULL, "psc should not be null and have SCRIPT_CACHE buffer address\n");
2440 ok(pwOutGlyphs3[0] == pwOutGlyphs2[0], "expected glyph %d, got %d\n", pwOutGlyphs2[0], pwOutGlyphs3[0]);
2441 ok(pwOutGlyphs3[3] == pwOutGlyphs2[3], "expected glyph %d, got %d\n", pwOutGlyphs2[3], pwOutGlyphs3[3]);
2442
2443 cInChars = cChars = 9;
2444 hr = ScriptGetCMap(hdc, &psc, TestItem3b, cInChars, dwFlags, pwOutGlyphs2);
2445 ok (hr == S_OK, "ScriptGetCMap should return S_OK not (%08x)\n", hr);
2446 ok (psc != NULL, "psc should not be null and have SCRIPT_CACHE buffer address\n");
2447
2448 cInChars = cChars = 9;
2449 dwFlags = SGCM_RTL;
2450 hr = ScriptGetCMap(hdc, &psc, TestItem3, cInChars, dwFlags, pwOutGlyphs3);
2451 ok (hr == S_OK, "ScriptGetCMap should return S_OK not (%08x)\n", hr);
2452 ok (psc != NULL, "psc should not be null and have SCRIPT_CACHE buffer address\n");
2453 ok(pwOutGlyphs3[0] == pwOutGlyphs2[0], "glyph incorrectly altered\n");
2454 ok(pwOutGlyphs3[1] == pwOutGlyphs2[1], "glyph incorrectly altered\n");
2455 ok(pwOutGlyphs3[2] == pwOutGlyphs2[2], "glyph incorrectly altered\n");
2456 ok(pwOutGlyphs3[3] == pwOutGlyphs2[3], "glyph incorrectly altered\n");
2457 ok(pwOutGlyphs3[4] == pwOutGlyphs2[4], "glyph not mirrored correctly\n");
2458 ok(pwOutGlyphs3[5] == pwOutGlyphs2[5], "glyph not mirrored correctly\n");
2459 ok(pwOutGlyphs3[6] == pwOutGlyphs2[6], "glyph not mirrored correctly\n");
2460 ok(pwOutGlyphs3[7] == pwOutGlyphs2[7], "glyph not mirrored correctly\n");
2461 ok(pwOutGlyphs3[8] == pwOutGlyphs2[8], "glyph not mirrored correctly\n");
2462
2464 ok (!psc, "psc is not null after ScriptFreeCache\n");
2465}
HRESULT WINAPI ScriptGetCMap(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcInChars, int cChars, DWORD dwFlags, WORD *pwOutGlyphs)
Definition: usp10.c:3554
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static int cInChars
Definition: usp10.c:62
#define SGCM_RTL
Definition: usp10.h:61
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
#define S_FALSE
Definition: winerror.h:2357

Referenced by START_TEST().

◆ test_ScriptGetFontFunctions()

static void test_ScriptGetFontFunctions ( HDC  hdc)
static

Definition at line 3812 of file usp10.c.

3813{
3814 static const WCHAR test_phagspa[] = {0xa84f, 0xa861, 0xa843, 0x0020, 0xa863, 0xa861, 0xa859,
3815 0x0020, 0xa850, 0xa85c, 0xa85e};
3816 SCRIPT_CONTROL control;
3817 SCRIPT_CACHE sc = NULL;
3818 SCRIPT_ITEM items[15];
3819 OPENTYPE_TAG tags[5];
3821 int count = 0;
3822 HRESULT hr;
3823
3824 if (!pScriptGetFontScriptTags || !pScriptGetFontLanguageTags || !pScriptGetFontFeatureTags)
3825 {
3826 win_skip("ScriptGetFontScriptTags, ScriptGetFontLanguageTags or "
3827 "ScriptGetFontFeatureTags not available on this platform.\n");
3828 return;
3829 }
3830
3831 hr = pScriptGetFontScriptTags(hdc, &sc, NULL, 0, NULL, NULL);
3832 ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3833 ok(!sc, "Got unexpected script cache %p.\n", sc);
3834 hr = pScriptGetFontScriptTags(hdc, &sc, NULL, 0, NULL, &count);
3835 ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3836 ok(!sc, "Got unexpected script cache %p.\n", sc);
3837 hr = pScriptGetFontScriptTags(hdc, &sc, NULL, ARRAY_SIZE(tags), tags, NULL);
3838 ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3839 ok(!sc, "Got unexpected script cache %p.\n", sc);
3840 hr = pScriptGetFontScriptTags(hdc, &sc, NULL, 0, tags, &count);
3841 ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3842 ok(!sc, "Got unexpected script cache %p.\n", sc);
3843 hr = pScriptGetFontScriptTags(NULL, &sc, NULL, ARRAY_SIZE(tags), tags, &count);
3844 ok(hr == E_PENDING, "Got unexpected hr %#x.\n", hr);
3845 ok(!sc, "Got unexpected script cache %p.\n", sc);
3846 hr = pScriptGetFontScriptTags(hdc, &sc, NULL, ARRAY_SIZE(tags), tags, &count);
3847 ok(hr == S_OK || hr == E_OUTOFMEMORY, "Got unexpected hr %#x.\n", hr);
3848 if (hr == S_OK)
3849 ok(count <= 5, "Got unexpected count %d.\n", count);
3850 else
3851 ok(!count, "Got unexpected count %d.\n", count);
3852 ok(!!sc, "Got unexpected script cache %p.\n", sc);
3853
3854 ScriptFreeCache(&sc);
3855 sc = NULL;
3856
3857 hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, 0, NULL, NULL);
3858 ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3859 ok(!sc, "Got unexpected script cache %p.\n", sc);
3860 hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, 0, NULL, &count);
3861 ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3862 ok(!sc, "Got unexpected script cache %p.\n", sc);
3863 hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, ARRAY_SIZE(tags), tags, NULL);
3864 ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3865 ok(!sc, "Got unexpected script cache %p.\n", sc);
3866 hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, 0, tags, &count);
3867 ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3868 ok(!sc, "Got unexpected script cache %p.\n", sc);
3869 hr = pScriptGetFontLanguageTags(NULL, &sc, NULL, latn_tag, ARRAY_SIZE(tags), tags, &count);
3870 ok(hr == E_PENDING, "Got unexpected hr %#x.\n", hr);
3871 ok(!sc, "Got unexpected script cache %p.\n", sc);
3872 hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, ARRAY_SIZE(tags), tags, &count);
3873 ok(hr == S_OK || hr == E_OUTOFMEMORY, "Got unexpected hr %#x.\n", hr);
3874 if (hr == S_OK)
3875 ok(count <= 5, "Got unexpected count %d.\n", count);
3876 else
3877 ok(!count, "Got unexpected count %d.\n", count);
3878
3879 ScriptFreeCache(&sc);
3880 sc = NULL;
3881
3882 hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, 0, NULL, NULL);
3883 ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3884 ok(!sc, "Got unexpected script cache %p.\n", sc);
3885 hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, 0, NULL, &count);
3886 ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3887 ok(!sc, "Got unexpected script cache %p.\n", sc);
3888 hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, ARRAY_SIZE(tags), tags, NULL);
3889 ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3890 ok(!sc, "Got unexpected script cache %p.\n", sc);
3891 hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, 0, tags, &count);
3892 ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3893 ok(!sc, "Got unexpected script cache %p.\n", sc);
3894 hr = pScriptGetFontFeatureTags(NULL, &sc, NULL, latn_tag, 0x0, ARRAY_SIZE(tags), tags, &count);
3895 ok(hr == E_PENDING, "Got unexpected hr %#x.\n", hr);
3896 ok(!sc, "Got unexpected script cache %p.\n", sc);
3897 hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, ARRAY_SIZE(tags), tags, &count);
3898 ok(hr == S_OK || hr == E_OUTOFMEMORY, "Got unexpected hr %#x.\n", hr);
3899 if (hr == S_OK)
3900 ok(count <= 5, "Got unexpected count %d.\n", count);
3901 else
3902 ok(!count, "Got unexpected count %d.\n", count);
3903
3904 memset(&control, 0, sizeof(control));
3905 memset(&state, 0, sizeof(state));
3906
3907 hr = ScriptItemize(test_phagspa, ARRAY_SIZE(test_phagspa), ARRAY_SIZE(items),
3908 &control, &state, items, &count);
3909 ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
3910 memset(tags, 0, sizeof(tags));
3911 hr = pScriptGetFontScriptTags(hdc, &sc, &items[0].a, ARRAY_SIZE(tags), tags, &count);
3912 ok(hr == USP_E_SCRIPT_NOT_IN_FONT || broken(hr == S_OK), "Got unexpected hr %#x.\n", hr);
3913
3914 hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, dsrt_tag, ARRAY_SIZE(tags), tags, &count);
3915 ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
3916 hr = pScriptGetFontLanguageTags(hdc, &sc, &items[0].a, dsrt_tag, ARRAY_SIZE(tags), tags, &count);
3917 ok(hr == E_INVALIDARG || broken(hr == S_OK), "Got unexpected hr %#x.\n", hr);
3918
3919 hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, dsrt_tag, 0x0, ARRAY_SIZE(tags), tags, &count);
3920 ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
3921 hr = pScriptGetFontFeatureTags(hdc, &sc, &items[0].a, dsrt_tag, 0x0, ARRAY_SIZE(tags), tags, &count);
3922 ok(hr == E_INVALIDARG || broken(hr == S_OK), "Got unexpected hr %#x.\n", hr);
3923
3924 ScriptFreeCache(&sc);
3925}
static int state
Definition: maze.c:121
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define latn_tag
Definition: usp10.c:142
#define dsrt_tag
Definition: usp10.c:176
#define win_skip
Definition: test.h:163
#define USP_E_SCRIPT_NOT_IN_FONT
Definition: usp10.h:71
ULONG OPENTYPE_TAG
Definition: usp10.h:205

Referenced by START_TEST().

◆ test_ScriptGetFontProperties()

static void test_ScriptGetFontProperties ( HDC  hdc)
static

Definition at line 2507 of file usp10.c.

2508{
2509 HRESULT hr;
2510 SCRIPT_CACHE psc,old_psc;
2512 HFONT font, oldfont;
2513 LOGFONTA lf;
2514 struct enum_font_data efnd;
2515 TEXTMETRICA tmA;
2516 WORD gi[3];
2517 WCHAR str[3];
2518 DWORD i, ret;
2520 static const WCHAR invalids[] = {0x0020, 0x200B, 0xF71B};
2521 /* U+0020: numeric space
2522 U+200B: zero width space
2523 U+F71B: unknown, found by black box testing */
2524 BOOL is_arial, is_times_new_roman, is_arabic = (system_lang_id == LANG_ARABIC);
2525
2526 /* Some sanity checks for ScriptGetFontProperties */
2527
2529 ok( hr == E_INVALIDARG, "(NULL,NULL,NULL), expected E_INVALIDARG, got %08x\n", hr);
2530
2532 ok( hr == E_INVALIDARG, "(NULL,NULL,&sfp), expected E_INVALIDARG, got %08x\n", hr);
2533
2534 /* Set psc to NULL, to be able to check if a pointer is returned in psc */
2535 psc = NULL;
2537 ok( hr == E_INVALIDARG, "(NULL,&psc,NULL), expected E_INVALIDARG, got %08x\n", hr);
2538 ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
2539
2540 /* Set psc to NULL, to be able to check if a pointer is returned in psc */
2541 psc = NULL;
2543 ok( hr == E_PENDING, "(NULL,&psc,&sfp), expected E_PENDING, got %08x\n", hr);
2544 ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
2545
2547 ok( hr == E_INVALIDARG, "(hdc,NULL,NULL), expected E_INVALIDARG, got %08x\n", hr);
2548
2550 ok( hr == E_INVALIDARG, "(hdc,NULL,&sfp), expected E_INVALIDARG, got %08x\n", hr);
2551
2552 /* Set psc to NULL, to be able to check if a pointer is returned in psc */
2553 psc = NULL;
2555 ok( hr == E_INVALIDARG, "(hdc,&psc,NULL), expected E_INVALIDARG, got %08x\n", hr);
2556 ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
2557
2558 /* Pass an invalid sfp */
2559 psc = NULL;
2560 sfp.cBytes = sizeof(SCRIPT_FONTPROPERTIES) - 1;
2562 ok( hr == E_INVALIDARG, "(hdc,&psc,&sfp) invalid, expected E_INVALIDARG, got %08x\n", hr);
2563 ok( psc != NULL, "Expected a pointer in psc, got NULL\n");
2564 ok( sfp.cBytes == sizeof(SCRIPT_FONTPROPERTIES) - 1, "Unexpected cBytes.\n");
2566 ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
2567
2568 /* Give it the correct cBytes, we don't care about what's coming back */
2569 sfp.cBytes = sizeof(SCRIPT_FONTPROPERTIES);
2570 psc = NULL;
2572 ok( hr == S_OK, "(hdc,&psc,&sfp) partly initialized, expected S_OK, got %08x\n", hr);
2573 ok( psc != NULL, "Expected a pointer in psc, got NULL\n");
2574
2575 /* Save the psc pointer */
2576 old_psc = psc;
2577 /* Now a NULL hdc again */
2579 ok( hr == S_OK, "(NULL,&psc,&sfp), expected S_OK, got %08x\n", hr);
2580 ok( psc == old_psc, "Expected psc not to be changed, was %p is now %p\n", old_psc, psc);
2582 ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
2583
2584 memset(&lf, 0, sizeof(lf));
2586 efnd.total = 0;
2588
2589 for (i = 0; i < efnd.total; i++)
2590 {
2591 if (strlen((char *)efnd.elf[i].elfFullName) >= LF_FACESIZE)
2592 {
2593 trace("Font name to long to test: %s\n",(char *)efnd.elf[i].elfFullName);
2594 continue;
2595 }
2596 lstrcpyA(lf.lfFaceName, (char *)efnd.elf[i].elfFullName);
2598 oldfont = SelectObject(hdc, font);
2599
2600 sfp.cBytes = sizeof(SCRIPT_FONTPROPERTIES);
2601 psc = NULL;
2602 hr = ScriptGetFontProperties(hdc, &psc, &sfp);
2603 ok(hr == S_OK, "ScriptGetFontProperties expected S_OK, got %08x\n", hr);
2605 {
2606 trace("bitmap font %s\n", lf.lfFaceName);
2607 trace("wgBlank %04x\n", sfp.wgBlank);
2608 trace("wgDefault %04x\n", sfp.wgDefault);
2609 trace("wgInvalid %04x\n", sfp.wgInvalid);
2610 trace("wgKashida %04x\n", sfp.wgKashida);
2611 trace("iKashidaWidth %d\n", sfp.iKashidaWidth);
2612 }
2613
2614 ret = GetTextMetricsA(hdc, &tmA);
2615 ok(ret != 0, "GetTextMetricsA failed!\n");
2616
2618 ok(ret != GDI_ERROR, "GetGlyphIndicesW failed!\n");
2619
2620 ok(sfp.wgBlank == tmA.tmBreakChar || sfp.wgBlank == gi[0], "bitmap font %s wgBlank %04x tmBreakChar %04x Space %04x\n", lf.lfFaceName, sfp.wgBlank, tmA.tmBreakChar, gi[0]);
2621
2622 ok(sfp.wgDefault == 0 || sfp.wgDefault == tmA.tmDefaultChar || broken(sfp.wgDefault == (0x100 | tmA.tmDefaultChar)), "bitmap font %s wgDefault %04x, tmDefaultChar %04x\n", lf.lfFaceName, sfp.wgDefault, tmA.tmDefaultChar);
2623
2624 ok(sfp.wgInvalid == sfp.wgBlank || broken(is_arabic), "bitmap font %s wgInvalid %02x wgBlank %02x\n", lf.lfFaceName, sfp.wgInvalid, sfp.wgBlank);
2625
2626 ok(sfp.wgKashida == 0xFFFF || broken(is_arabic), "bitmap font %s wgKashida %02x\n", lf.lfFaceName, sfp.wgKashida);
2627
2629
2630 SelectObject(hdc, oldfont);
2632 }
2633
2634 efnd.total = 0;
2636
2637 for (i = 0; i < efnd.total; i++)
2638 {
2639 if (strlen((char *)efnd.elf[i].elfFullName) >= LF_FACESIZE)
2640 {
2641 trace("Font name to long to test: %s\n",(char *)efnd.elf[i].elfFullName);
2642 continue;
2643 }
2644 lstrcpyA(lf.lfFaceName, (char *)efnd.elf[i].elfFullName);
2646 oldfont = SelectObject(hdc, font);
2647
2648 sfp.cBytes = sizeof(SCRIPT_FONTPROPERTIES);
2649 psc = NULL;
2650 hr = ScriptGetFontProperties(hdc, &psc, &sfp);
2651 ok(hr == S_OK, "ScriptGetFontProperties expected S_OK, got %08x\n", hr);
2653 {
2654 trace("truetype font %s\n", lf.lfFaceName);
2655 trace("wgBlank %04x\n", sfp.wgBlank);
2656 trace("wgDefault %04x\n", sfp.wgDefault);
2657 trace("wgInvalid %04x\n", sfp.wgInvalid);
2658 trace("wgKashida %04x\n", sfp.wgKashida);
2659 trace("iKashidaWidth %d\n", sfp.iKashidaWidth);
2660 }
2661
2662 str[0] = 0x0020; /* U+0020: numeric space */
2663 ret = GetGlyphIndicesW(hdc, str, 1, gi, 0);
2664 ok(ret != GDI_ERROR, "GetGlyphIndicesW failed!\n");
2665 ok(sfp.wgBlank == gi[0], "truetype font %s wgBlank %04x gi[0] %04x\n", lf.lfFaceName, sfp.wgBlank, gi[0]);
2666
2667 ok(sfp.wgDefault == 0 || broken(is_arabic), "truetype font %s wgDefault %04x\n", lf.lfFaceName, sfp.wgDefault);
2668
2670 ok(ret != GDI_ERROR, "GetGlyphIndicesW failed!\n");
2671 if (gi[2] != 0xFFFF) /* index of default non exist char */
2672 ok(sfp.wgInvalid == gi[2], "truetype font %s wgInvalid %04x gi[2] %04x\n", lf.lfFaceName, sfp.wgInvalid, gi[2]);
2673 else if (gi[1] != 0xFFFF)
2674 ok(sfp.wgInvalid == gi[1], "truetype font %s wgInvalid %04x gi[1] %04x\n", lf.lfFaceName, sfp.wgInvalid, gi[1]);
2675 else if (gi[0] != 0xFFFF)
2676 ok(sfp.wgInvalid == gi[0], "truetype font %s wgInvalid %04x gi[0] %04x\n", lf.lfFaceName, sfp.wgInvalid, gi[0]);
2677 else
2678 ok(sfp.wgInvalid == 0, "truetype font %s wgInvalid %04x expect 0\n", lf.lfFaceName, sfp.wgInvalid);
2679
2680 str[0] = 0x0640; /* U+0640: kashida */
2682 ok(ret != GDI_ERROR, "GetGlyphIndicesW failed!\n");
2683 is_arial = !lstrcmpA(lf.lfFaceName, "Arial");
2684 is_times_new_roman= !lstrcmpA(lf.lfFaceName, "Times New Roman");
2685 ok(sfp.wgKashida == gi[0] || broken(is_arial || is_times_new_roman) || broken(is_arabic), "truetype font %s wgKashida %04x gi[0] %04x\n", lf.lfFaceName, sfp.wgKashida, gi[0]);
2686
2688
2689 SelectObject(hdc, oldfont);
2691 }
2692}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define LF_FACESIZE
Definition: dimm.idl:39
LANGID WINAPI GetSystemDefaultLangID(void)
Definition: locale.c:1193
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4194
HRESULT WINAPI ScriptGetFontProperties(HDC hdc, SCRIPT_CACHE *psc, SCRIPT_FONTPROPERTIES *sfp)
Definition: usp10.c:1176
static WORD system_lang_id
Definition: font.c:67
static INT CALLBACK enum_bitmap_font_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
Definition: usp10.c:2475
static INT CALLBACK enum_truetype_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
Definition: usp10.c:2491
Definition: mk_font.cpp:20
const WCHAR * str
#define LANG_ARABIC
Definition: nls.h:29
#define PRIMARYLANGID(l)
Definition: nls.h:16
int winetest_interactive
BYTE lfCharSet
Definition: dimm.idl:50
struct tag_SCRIPT_FONTPROPERTIES SCRIPT_FONTPROPERTIES
int WINAPI EnumFontFamiliesA(_In_ HDC, _In_opt_ LPCSTR, _In_ FONTENUMPROCA, _In_ LPARAM)
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
Definition: text.c:200
#define GGI_MARK_NONEXISTING_GLYPHS
Definition: wingdi.h:1085

Referenced by START_TEST().

◆ test_ScriptGetGlyphABCWidth()

static void test_ScriptGetGlyphABCWidth ( HDC  hdc)
static

Definition at line 3466 of file usp10.c.

3467{
3468 HRESULT hr;
3469 SCRIPT_CACHE sc = NULL;
3470 HFONT hfont, prev_hfont;
3472 ABC abc, abc2;
3473 LOGFONTA lf;
3474 WORD glyph;
3475 INT width;
3476 DWORD ret;
3477
3478 glyph = 0;
3479 ret = GetGlyphIndicesA(hdc, "a", 1, &glyph, 0);
3480 ok(ret == 1, "Failed to get glyph index.\n");
3481 ok(glyph != 0, "Unexpected glyph index.\n");
3482
3484 ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr);
3485
3486 hr = ScriptGetGlyphABCWidth(NULL, &sc, glyph, NULL);
3487 ok(broken(hr == E_PENDING) ||
3488 hr == E_INVALIDARG, /* WIN7 */
3489 "expected E_INVALIDARG, got 0x%08x\n", hr);
3490
3491 hr = ScriptGetGlyphABCWidth(NULL, &sc, glyph, &abc);
3492 ok(hr == E_PENDING, "expected E_PENDING, got 0x%08x\n", hr);
3493
3494 if (0) { /* crashes on WinXP */
3495 hr = ScriptGetGlyphABCWidth(hdc, &sc, glyph, NULL);
3496 ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr);
3497 }
3498
3499 hr = ScriptGetGlyphABCWidth(hdc, &sc, glyph, &abc);
3500 ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
3501 ok(abc.abcB != 0, "Unexpected width.\n");
3502
3503 ret = GetCharABCWidthsI(hdc, glyph, 1, NULL, &abc2);
3504 ok(ret, "Failed to get char width.\n");
3505 ok(!memcmp(&abc, &abc2, sizeof(abc)), "Unexpected width.\n");
3506
3507 ScriptFreeCache(&sc);
3508
3509 /* Bitmap font */
3510 memset(&lf, 0, sizeof(lf));
3511 strcpy(lf.lfFaceName, "System");
3512 lf.lfHeight = 20;
3513
3515 prev_hfont = SelectObject(hdc, hfont);
3516
3518 ok(ret, "Failed to get text metrics.\n");
3519 ok(!(tm.tmPitchAndFamily & TMPF_TRUETYPE), "Unexpected TrueType font.\n");
3520 ok(tm.tmPitchAndFamily & TMPF_FIXED_PITCH, "Unexpected fixed pitch font.\n");
3521
3522 glyph = 0;
3523 ret = GetGlyphIndicesA(hdc, "i", 1, &glyph, 0);
3524 ok(ret == 1, "Failed to get glyph index.\n");
3525 ok(glyph != 0, "Unexpected glyph index.\n");
3526
3527 sc = NULL;
3528 hr = ScriptGetGlyphABCWidth(hdc, &sc, glyph, &abc);
3529 ok(hr == S_OK, "Failed to get glyph width, hr %#x.\n", hr);
3530 ok(abc.abcB != 0, "Unexpected width.\n");
3531
3532 ret = GetCharWidthI(hdc, glyph, 1, NULL, &width);
3533 ok(ret, "Failed to get char width.\n");
3534 abc2.abcA = abc2.abcC = 0;
3535 abc2.abcB = width;
3536 ok(!memcmp(&abc, &abc2, sizeof(abc)), "Unexpected width.\n");
3537
3538 SelectObject(hdc, prev_hfont);
3540
3541 ScriptFreeCache(&sc);
3542}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
HRESULT WINAPI ScriptGetGlyphABCWidth(HDC hdc, SCRIPT_CACHE *psc, WORD glyph, ABC *abc)
Definition: usp10.c:3708
GLint GLint GLsizei width
Definition: gl.h:1546
static UINT UINT LPWORD LPABC abc
Definition: font.c:44
Definition: wingdi.h:1410
int abcA
Definition: wingdi.h:1411
UINT abcB
Definition: wingdi.h:1412
int abcC
Definition: wingdi.h:1413
int32_t INT
Definition: typedefs.h:58
BOOL WINAPI GetCharWidthI(_In_ HDC hdc, _In_ UINT giFirst, _In_ UINT cgi, _In_reads_opt_(cgi) LPWORD pgi, _Out_writes_(cgi) LPINT piWidths)
#define TMPF_TRUETYPE
Definition: wingdi.h:1313
#define TMPF_FIXED_PITCH
Definition: wingdi.h:1311
BOOL WINAPI GetCharABCWidthsI(_In_ HDC hdc, _In_ UINT giFirst, _In_ UINT cgi, _In_reads_opt_(cgi) LPWORD pgi, _Out_writes_(cgi) LPABC pabc)
DWORD WINAPI GetGlyphIndicesA(_In_ HDC hdc, _In_reads_(c) LPCSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)

Referenced by START_TEST().

◆ test_ScriptGetLogicalWidths()

static void test_ScriptGetLogicalWidths ( void  )
static

Definition at line 3951 of file usp10.c.

3952{
3953 SCRIPT_ANALYSIS sa = { 0 };
3954 unsigned int i, j;
3955
3956 for (i = 0; i < ARRAY_SIZE(logical_width_tests); ++i)
3957 {
3958 const struct logical_width_test *ptr = logical_width_tests + i;
3959 SCRIPT_VISATTR attrs[3];
3960 int widths[3];
3961 HRESULT hr;
3962
3963 memset(attrs, 0, sizeof(attrs));
3964 for (j = 0; j < ptr->glyph_count; j++)
3965 {
3966 attrs[j].fClusterStart = ptr->clusterstart[j];
3967 attrs[j].fDiacritic = ptr->diacritic[j];
3968 attrs[j].fZeroWidth = ptr->zerowidth[j];
3969 }
3970
3971 hr = ScriptGetLogicalWidths(&sa, ptr->char_count, ptr->glyph_count, ptr->advances, ptr->map, attrs, widths);
3972 ok(hr == S_OK, "got 0x%08x\n", hr);
3973
3974 todo_wine_if(ptr->todo)
3975 ok(!memcmp(ptr->widths, widths, sizeof(widths)), "test %u: got wrong widths\n", i);
3976 }
3977}
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
HRESULT WINAPI ScriptGetLogicalWidths(const SCRIPT_ANALYSIS *sa, int nbchars, int nbglyphs, const int *advances, const WORD *log_clust, const SCRIPT_VISATTR *sva, int *widths)
Definition: usp10.c:3998
GLdouble n
Definition: glext.h:7729
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
static PVOID ptr
Definition: dispmode.c:27
static const struct logical_width_test logical_width_tests[]
Definition: usp10.c:3940
WORD fClusterStart
Definition: usp10.h:179
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList

Referenced by START_TEST().

◆ test_ScriptGetProperties()

static void test_ScriptGetProperties ( void  )
static

Definition at line 3699 of file usp10.c.

3700{
3701 const SCRIPT_PROPERTIES **props;
3702 HRESULT hr;
3703 int num;
3704
3706 ok(hr == E_INVALIDARG, "ScriptGetProperties succeeded\n");
3707
3709 ok(hr == S_OK, "ScriptGetProperties failed: 0x%08x\n", hr);
3710
3712 ok(hr == S_OK, "ScriptGetProperties failed: 0x%08x\n", hr);
3713
3715 ok(hr == S_OK, "ScriptGetProperties failed: 0x%08x\n", hr);
3716}
GLuint GLuint num
Definition: glext.h:9618
static const WCHAR props[]
Definition: wbemdisp.c:288

Referenced by START_TEST().

◆ test_ScriptIsComplex()

static void test_ScriptIsComplex ( void  )
static

Definition at line 3979 of file usp10.c.

3980{
3981 static const WCHAR testW[] = {0x202a,'1',0x202c,0};
3982 static const WCHAR test2W[] = {'1',0};
3983 static const struct complex_test
3984 {
3985 const WCHAR *text;
3986 DWORD flags;
3987 HRESULT hr;
3988 BOOL todo;
3989 } complex_tests[] =
3990 {
3991 { test2W, SIC_ASCIIDIGIT, S_OK },
3992 { test2W, SIC_COMPLEX, S_FALSE },
3993 { test2W, SIC_COMPLEX | SIC_ASCIIDIGIT, S_OK },
3996 { testW, SIC_COMPLEX, S_OK },
3997 { testW, 0, S_FALSE },
3998 };
3999 unsigned int i;
4000 HRESULT hr;
4001
4002 hr = ScriptIsComplex(NULL, 0, 0);
4003 ok(hr == E_INVALIDARG || broken(hr == S_FALSE) /* winxp/vista */, "got 0x%08x\n", hr);
4004
4005 if (hr == E_INVALIDARG)
4006 {
4007 hr = ScriptIsComplex(NULL, 1, 0);
4008 ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
4009 }
4010
4011 hr = ScriptIsComplex(test2W, -1, SIC_ASCIIDIGIT);
4012 ok(hr == E_INVALIDARG || broken(hr == S_FALSE) /* winxp/vista */, "got 0x%08x\n", hr);
4013
4014 hr = ScriptIsComplex(test2W, 0, SIC_ASCIIDIGIT);
4015 ok(hr == S_FALSE, "got 0x%08x\n", hr);
4016
4017 for (i = 0; i < ARRAY_SIZE(complex_tests); ++i)
4018 {
4019 hr = ScriptIsComplex(complex_tests[i].text, lstrlenW(complex_tests[i].text), complex_tests[i].flags);
4020 todo_wine_if(complex_tests[i].todo)
4021 ok(hr == complex_tests[i].hr, "%u: got %#x, expected %#x, flags %#x\n", i, hr, complex_tests[i].hr,
4022 complex_tests[i].flags);
4023 }
4024
4025 hr = ScriptIsComplex(test2W, 1, ~0u);
4026 ok(hr == S_OK, "got 0x%08x\n", hr);
4027
4028 hr = ScriptIsComplex(testW, 3, 0);
4029 ok(hr == S_FALSE, "got 0x%08x\n", hr);
4030
4032 ok(hr == S_OK, "got 0x%08x\n", hr);
4033
4035 ok(hr == S_OK, "got 0x%08x\n", hr);
4036
4037 hr = ScriptIsComplex(test2W, 1, SIC_COMPLEX);
4038 ok(hr == S_FALSE, "got 0x%08x\n", hr);
4039}
const WCHAR * text
Definition: package.c:1799
HRESULT WINAPI ScriptIsComplex(const WCHAR *chars, int len, DWORD flag)
Definition: usp10.c:3074
GLbitfield flags
Definition: glext.h:7161
static const WCHAR testW[]
Definition: jsregexp.c:44
BOOL todo
Definition: filedlg.c:313
#define SIC_COMPLEX
Definition: usp10.h:56
#define SIC_NEUTRAL
Definition: usp10.h:58
#define SIC_ASCIIDIGIT
Definition: usp10.h:57

Referenced by START_TEST().

◆ test_ScriptItemize()

static void test_ScriptItemize ( void  )
static

Definition at line 180 of file usp10.c.

181{
182 static const WCHAR test1[] = {'t', 'e', 's', 't',0};
183 static const itemTest t11[2] = {{{0,0,0,0,0,0},0,0,0,0,0,latn_tag,FALSE},{{0,0,0,0,0,0},4,0,0,0,0,-1}};
184 static const itemTest t12[2] = {{{0,0,0,0,0,0},0,0,0,2,0,latn_tag,FALSE},{{0,0,0,0,0,0},4,0,0,0,0,-1,FALSE}};
185
186 static const WCHAR test1b[] = {' ', ' ', ' ', ' ',0};
187 static const itemTest t1b1[2] = {{{0,0,0,0,0,0},0,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},4,0,0,0,0,-1,FALSE}};
188 static const itemTest t1b2[2] = {{{0,0,0,0,0,0},0,1,1,1,0,0,FALSE},{{0,0,0,0,0,0},4,0,0,0,0,-1,FALSE}};
189
190 static const WCHAR test1c[] = {' ', ' ', ' ', '1', '2', ' ',0};
191 static const itemTest t1c1[2] = {{{0,0,0,0,0,0},0,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
192 static const itemTest t1c2[4] = {{{0,0,0,0,0,0},0,1,1,1,0,0,FALSE},{{0,0,0,0,0,0},3,0,1,2,0,0,FALSE},{{0,0,0,0,0,0},5,1,1,1,0,0,FALSE},{{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
193
194 /* Arabic, English*/
195 static const WCHAR test2[] = {'1','2','3','-','5','2',0x064a,0x064f,0x0633,0x0627,0x0648,0x0650,0x064a,'7','1','.',0};
196 static const itemTest t21[7] = {{{0,0,0,0,0,0},0,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},3,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},4,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},6,1,1,1,0,arab_tag,FALSE},{{0,0,0,0,0,0},13,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},15,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},16,0,0,0,0,-1,FALSE}};
197 static const itemTest t22[5] = {{{0,0,0,0,0,0},0,0,0,2,0,0,FALSE},{{0,0,0,0,0,0},6,1,1,1,0,arab_tag,FALSE},{{0,0,0,0,0,0},13,0,1,2,0,0,FALSE},{{0,0,0,0,0,0},15,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},16,0,0,0,0,-1,FALSE}};
198 static const itemTest t23[5] = {{{0,0,0,0,0,0},0,0,1,2,0,0,FALSE},{{0,0,0,0,0,0},6,1,1,1,0,arab_tag,FALSE},{{0,0,0,0,0,0},13,0,1,2,0,0,FALSE},{{0,0,0,0,0,0},15,1,1,1,0,0,FALSE},{{0,0,0,0,0,0},16,0,0,0,0,-1,FALSE}};
199 static const itemTest t24[5] = {{{0,0,0,0,0,0},0,0,0,0,1,0,FALSE},
200 {{0,0,0,0,0,0},6,0,0,0,1,arab_tag,FALSE},
201 {{0,0,0,0,0,0},13,0,1,0,1,0,FALSE},
202 {{0,0,0,0,0,0},15,0,0,0,1,0,FALSE},
203 {{0,0,0,0,0,0},16,0,0,0,0,-1,FALSE}};
204
205 static const WCHAR test2b[] = {'A','B','C','-','D','E','F',' ',0x0621,0x0623,0x0624,0};
206 static const itemTest t2b1[5] = {{{0,0,0,0,0,0},0,0,0,0,0,latn_tag,FALSE},{{0,0,0,0,0,0},3,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},4,0,0,0,0,latn_tag,FALSE},{{0,0,0,0,0,0},8,1,1,1,0,arab_tag,FALSE},{{0,0,0,0,0,0},11,0,0,0,0,-1,FALSE}};
207 static const itemTest t2b2[5] = {{{0,0,0,0,0,0},0,0,0,2,0,latn_tag,FALSE},{{0,0,0,0,0,0},3,0,0,2,0,0,FALSE},{{0,0,0,0,0,0},4,0,0,2,0,latn_tag,FALSE},{{0,0,0,0,0,0},7,1,1,1,0,arab_tag,FALSE},{{0,0,0,0,0,0},11,0,0,0,0,-1,FALSE}};
208 static const itemTest t2b3[3] = {{{0,0,0,0,0,0},0,0,0,2,0,latn_tag,FALSE},{{0,0,0,0,0,0},7,1,1,1,0,arab_tag,FALSE},{{0,0,0,0,0,0},11,0,0,0,0,-1,FALSE}};
209 static const itemTest t2b4[5] = {{{0,0,0,0,0,0},0,0,0,0,1,latn_tag,FALSE},
210 {{0,0,0,0,0,0},3,0,0,0,1,0,FALSE},
211 {{0,0,0,0,0,0},4,0,0,0,1,latn_tag,FALSE},
212 {{0,0,0,0,0,0},8,0,0,0,1,arab_tag,FALSE},
213 {{0,0,0,0,0,0},11,0,0,0,0,-1,FALSE}};
214 static const int b2[2] = {4,4};
215
216 /* leading space */
217 static const WCHAR test2c[] = {' ',0x0621,0x0623,0x0624,'A','B','C','-','D','E','F',0};
218 static const itemTest t2c1[5] = {{{0,0,0,0,0,0},0,1,1,1,0,arab_tag,FALSE},{{0,0,0,0,0,0},4,0,0,0,0,latn_tag,FALSE},{{0,0,0,0,0,0},7,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},8,0,0,0,0,latn_tag,FALSE},{{0,0,0,0,0,0},11,0,0,0,0,-1,FALSE}};
219 static const itemTest t2c2[6] = {{{0,0,0,0,0,0},0,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},1,1,1,1,0,arab_tag,FALSE},{{0,0,0,0,0,0},4,0,0,0,0,latn_tag,FALSE},{{0,0,0,0,0,0},7,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},8,0,0,0,0,latn_tag,FALSE},{{0,0,0,0,0,0},11,0,0,0,0,-1,FALSE}};
220 static const itemTest t2c3[5] = {{{0,0,0,0,0,0},0,1,1,1,0,arab_tag,FALSE},{{0,0,0,0,0,0},4,0,0,2,0,latn_tag,FALSE},{{0,0,0,0,0,0},7,0,0,2,0,0,FALSE},{{0,0,0,0,0,0},8,0,0,2,0,latn_tag,FALSE},{{0,0,0,0,0,0},11,0,0,0,0,-1,FALSE}};
221 static const itemTest t2c4[3] = {{{0,0,0,0,0,0},0,1,1,1,0,arab_tag,FALSE},{{0,0,0,0,0,0},4,0,0,2,0,latn_tag,FALSE},{{0,0,0,0,0,0},11,0,0,0,0,-1,FALSE}};
222 static const itemTest t2c5[5] = {{{0,0,0,0,0,0},0,0,0,0,1,arab_tag,FALSE},
223 {{0,0,0,0,0,0},4,0,0,0,1,latn_tag,FALSE},
224 {{0,0,0,0,0,0},7,0,0,0,1,0,FALSE},
225 {{0,0,0,0,0,0},8,0,0,0,1,latn_tag,FALSE},
226 {{0,0,0,0,0,0},11,0,0,0,0,-1,FALSE}};
227
228 /* trailing space */
229 static const WCHAR test2d[] = {'A','B','C','-','D','E','F',0x0621,0x0623,0x0624,' ',0};
230 static const itemTest t2d1[5] = {{{0,0,0,0,0,0},0,0,0,0,0,latn_tag,FALSE},{{0,0,0,0,0,0},3,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},4,0,0,0,0,latn_tag,FALSE},{{0,0,0,0,0,0},7,1,1,1,0,arab_tag,FALSE},{{0,0,0,0,0,0},11,0,0,0,0,-1,FALSE}};
231 static const itemTest t2d2[6] = {{{0,0,0,0,0,0},0,0,0,0,0,latn_tag,FALSE},{{0,0,0,0,0,0},3,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},4,0,0,0,0,latn_tag,FALSE},{{0,0,0,0,0,0},7,1,1,1,0,arab_tag,FALSE},{{0,0,0,0,0,0},10,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},11,0,0,0,0,-1,FALSE}};
232 static const itemTest t2d3[5] = {{{0,0,0,0,0,0},0,0,0,2,0,latn_tag,FALSE},{{0,0,0,0,0,0},3,0,0,2,0,0,FALSE},{{0,0,0,0,0,0},4,0,0,2,0,latn_tag,FALSE},{{0,0,0,0,0,0},7,1,1,1,0,arab_tag,FALSE},{{0,0,0,0,0,0},11,0,0,0,0,-1,FALSE}};
233 static const itemTest t2d4[3] = {{{0,0,0,0,0,0},0,0,0,2,0,latn_tag,FALSE},{{0,0,0,0,0,0},7,1,1,1,0,arab_tag,FALSE},{{0,0,0,0,0,0},11,0,0,0,0,-1,FALSE}};
234 static const itemTest t2d5[5] = {{{0,0,0,0,0,0},0,0,0,0,1,latn_tag,FALSE},
235 {{0,0,0,0,0,0},3,0,0,0,1,0,FALSE},
236 {{0,0,0,0,0,0},4,0,0,0,1,latn_tag,FALSE},
237 {{0,0,0,0,0,0},7,0,0,0,1,arab_tag,FALSE},
238 {{0,0,0,0,0,0},11,0,0,0,0,-1,FALSE}};
239
240 /* Thai */
241 static const WCHAR test3[] =
242{0x0e04,0x0e27,0x0e32,0x0e21,0x0e1e,0x0e22,0x0e32,0x0e22,0x0e32, 0x0e21
243,0x0e2d,0x0e22,0x0e39,0x0e48,0x0e17,0x0e35,0x0e48,0x0e44,0x0e2b,0x0e19
244,0x0e04,0x0e27,0x0e32,0x0e21,0x0e2a, 0x0e33,0x0e40,0x0e23,0x0e47,0x0e08,
245 0x0e2d,0x0e22,0x0e39,0x0e48,0x0e17,0x0e35,0x0e48,0x0e19,0x0e31,0x0e48,0x0e19,0};
246
247 static const itemTest t31[2] = {{{0,0,0,0,0,0},0,0,0,0,0,thai_tag,FALSE},{{0,0,0,0,0,0},41,0,0,0,0,-1,FALSE}};
248 static const itemTest t32[2] = {{{0,0,0,0,0,0},0,0,0,2,0,thai_tag,FALSE},{{0,0,0,0,0,0},41,0,0,0,0,-1,FALSE}};
249
250 static const WCHAR test4[] = {'1','2','3','-','5','2',' ','i','s',' ','7','1','.',0};
251
252 static const itemTest t41[6] = {{{0,0,0,0,0,0},0,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},3,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},4,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},7,0,0,0,0,latn_tag,FALSE},{{0,0,0,0,0,0},10,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},12,0,0,0,0,-1,FALSE}};
253 static const itemTest t42[5] = {{{0,0,0,0,0,0},0,0,1,2,0,0,FALSE},{{0,0,0,0,0,0},6,1,1,1,0,0,FALSE},{{0,0,0,0,0,0},7,0,0,2,0,latn_tag,FALSE},{{0,0,0,0,0,0},10,0,0,2,0,0,FALSE},{{0,0,0,0,0,0},12,0,0,0,0,-1,FALSE}};
254 static const itemTest t43[4] = {{{0,0,0,0,0,0},0,0,1,2,0,0,FALSE},{{0,0,0,0,0,0},6,1,1,1,0,0,FALSE},{{0,0,0,0,0,0},7,0,0,2,0,latn_tag,FALSE},{{0,0,0,0,0,0},12,0,0,0,0,-1,FALSE}};
255 static const int b43[2] = {4,4};
256
257 /* Arabic */
258 static const WCHAR test5[] = {0x0627,0x0644,0x0635,0x0651,0x0650,0x062d,0x0629,0x064f,' ',0x062a,0x064e,
259 0x0627,0x062c,0x064c,' ',0x0639,0x064e,0x0644,0x0649,' ',
260 0x0631,0x064f,0x0624,0x0648,0x0633,0x0650,' ',0x0627,0x0644,
261 0x0623,0x0635,0x0650,0x062d,0x0651,0x064e,0x0627,0x0621,0x0650,0};
262 static const itemTest t51[2] = {{{0,0,0,0,0,0},0,1,1,1,0,arab_tag,FALSE},{{0,0,0,0,0,0},38,0,0,0,0,-1,FALSE}};
263 static const itemTest t52[2] = {{{0,0,0,0,0,0},0,0,0,0,1,arab_tag,FALSE},
264 {{0,0,0,0,0,0},38,0,0,0,0,-1,FALSE}};
265
266
267 /* Hebrew */
268 static const WCHAR test6[] = {0x05e9, 0x05dc, 0x05d5, 0x05dd, '.',0};
269 static const itemTest t61[3] = {{{0,0,0,0,0,0},0,1,1,1,0,hebr_tag,TRUE,{-1,0,0,0,-1,-1}},{{0,0,0,0,0,0},4,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},5,0,0,0,0,-1,FALSE}};
270 static const itemTest t62[3] = {{{0,0,0,0,0,0},0,1,1,1,0,hebr_tag,FALSE},{{0,0,0,0,0,0},4,1,1,1,0,0,FALSE},{{0,0,0,0,0,0},5,0,0,0,0,-1,FALSE}};
271 static const itemTest t63[2] = {{{0,0,0,0,0,0},0,1,1,1,0,hebr_tag,FALSE},{{0,0,0,0,0,0},5,0,0,0,0,-1,FALSE}};
272 static const itemTest t64[3] = {{{0,0,0,0,0,0},0,0,0,0,1,hebr_tag,FALSE},
273 {{0,0,0,0,0,0},4,0,0,0,1,0,FALSE},
274 {{0,0,0,0,0,0},5,0,0,0,0,-1,FALSE}};
275
276 static const int b63[2] = {2,2};
277 static const WCHAR test7[] = {'p','a','r','t',' ','o','n','e',' ',0x05d7, 0x05dc, 0x05e7, ' ', 0x05e9, 0x05ea, 0x05d9, 0x05d9, 0x05dd, ' ','p','a','r','t',' ','t','h','r','e','e', 0};
278 static const itemTest t71[4] = {{{0,0,0,0,0,0},0,0,0,0,0,latn_tag,FALSE},{{0,0,0,0,0,0},9,1,1,1,0,hebr_tag,TRUE,{-1,0,0,0,-1,-1}},{{0,0,0,0,0,0},19,0,0,0,0,latn_tag,FALSE},{{0,0,0,0,0,0},29,0,0,0,0,-1,FALSE}};
279 static const itemTest t72[4] = {{{0,0,0,0,0,0},0,0,0,0,0,latn_tag,FALSE},{{0,0,0,0,0,0},9,1,1,1,0,hebr_tag,FALSE},{{0,0,0,0,0,0},18,0,0,0,0,latn_tag,FALSE},{{0,0,0,0,0,0},29,0,0,0,0,-1,FALSE}};
280 static const itemTest t73[4] = {{{0,0,0,0,0,0},0,0,0,2,0,latn_tag,FALSE},{{0,0,0,0,0,0},8,1,1,1,0,hebr_tag,FALSE},{{0,0,0,0,0,0},19,0,0,2,0,latn_tag,FALSE},{{0,0,0,0,0,0},29,0,0,0,0,-1,FALSE}};
281 static const itemTest t74[4] = {{{0,0,0,0,0,0},0,0,0,0,1,latn_tag,FALSE},
282 {{0,0,0,0,0,0},9,0,0,0,1,hebr_tag,FALSE},
283 {{0,0,0,0,0,0},19,0,0,0,1,latn_tag,FALSE},
284 {{0,0,0,0,0,0},29,0,0,0,0,-1,FALSE}};
285
286 static const WCHAR test8[] = {0x0633, 0x0644, 0x0627, 0x0645,0};
287 static const itemTest t81[2] = {{{0,0,0,0,0,0},0,1,1,1,0,arab_tag,FALSE},{{0,0,0,0,0,0},4,0,0,0,0,-1,FALSE}};
288 static const itemTest t82[2] = {{{0,0,0,0,0,0},0,0,0,0,1,arab_tag,FALSE},
289 {{0,0,0,0,0,0},4,0,0,0,0,-1,FALSE}};
290
291 /* Syriac (Like Arabic )*/
292 static const WCHAR test9[] = {0x0710, 0x0712, 0x0712, 0x0714, '.',0};
293 static const itemTest t91[3] = {{{0,0,0,0,0,0},0,1,1,1,0,syrc_tag,FALSE},{{0,0,0,0,0,0},4,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},5,0,0,0,0,-1,FALSE}};
294 static const itemTest t92[3] = {{{0,0,0,0,0,0},0,1,1,1,0,syrc_tag},{{0,0,0,0,0,0},4,1,1,1,0,0,FALSE},{{0,0,0,0,0,0},5,0,0,0,0,-1,FALSE}};
295 static const itemTest t93[2] = {{{0,0,0,0,0,0},0,1,1,1,0,syrc_tag,FALSE},{{0,0,0,0,0,0},5,0,0,0,0,-1,FALSE}};
296 static const itemTest t94[3] = {{{0,0,0,0,0,0},0,0,0,0,1,syrc_tag,FALSE},
297 {{0,0,0,0,0,0},4,0,0,0,1,0,FALSE},
298 {{0,0,0,0,0,0},5,0,0,0,0,-1,FALSE}};
299 static const int b93[2] = {2,2};
300
301 static const WCHAR test10[] = {0x0717, 0x0718, 0x071a, 0x071b,0};
302 static const itemTest t101[2] = {{{0,0,0,0,0,0},0,1,1,1,0,syrc_tag,FALSE},{{0,0,0,0,0,0},4,0,0,0,0,-1,FALSE}};
303 static const itemTest t102[2] = {{{0,0,0,0,0,0},0,0,0,0,1,syrc_tag,FALSE},
304 {{0,0,0,0,0,0},4,0,0,0,0,-1,FALSE}};
305
306 /* Devanagari */
307 static const WCHAR test11[] = {0x0926, 0x0947, 0x0935, 0x0928, 0x093e, 0x0917, 0x0930, 0x0940};
308 static const itemTest t111[2] = {{{0,0,0,0,0,0},0,0,0,0,0,deva_tag,FALSE},{{0,0,0,0,0,0},8,0,0,0,0,-1,FALSE}};
309 static const itemTest t112[2] = {{{0,0,0,0,0,0},0,0,0,2,0,deva_tag,FALSE},{{0,0,0,0,0,0},8,0,0,0,0,-1,FALSE}};
310
311 /* Bengali */
312 static const WCHAR test12[] = {0x09ac, 0x09be, 0x0982, 0x09b2, 0x09be};
313 static const itemTest t121[2] = {{{0,0,0,0,0,0},0,0,0,0,0,beng_tag,FALSE},{{0,0,0,0,0,0},5,0,0,0,0,-1,FALSE}};
314 static const itemTest t122[2] = {{{0,0,0,0,0,0},0,0,0,2,0,beng_tag,FALSE},{{0,0,0,0,0,0},5,0,0,0,0,-1,FALSE}};
315
316 /* Gurmukhi */
317 static const WCHAR test13[] = {0x0a17, 0x0a41, 0x0a30, 0x0a2e, 0x0a41, 0x0a16, 0x0a40};
318 static const itemTest t131[2] = {{{0,0,0,0,0,0},0,0,0,0,0,guru_tag,FALSE},{{0,0,0,0,0,0},7,0,0,0,0,-1,FALSE}};
319 static const itemTest t132[2] = {{{0,0,0,0,0,0},0,0,0,2,0,guru_tag,FALSE},{{0,0,0,0,0,0},7,0,0,0,0,-1,FALSE}};
320
321 /* Gujarati */
322 static const WCHAR test14[] = {0x0a97, 0x0ac1, 0x0a9c, 0x0ab0, 0x0abe, 0x0aa4, 0x0ac0};
323 static const itemTest t141[2] = {{{0,0,0,0,0,0},0,0,0,0,0,gujr_tag,FALSE},{{0,0,0,0,0,0},7,0,0,0,0,-1,FALSE}};
324 static const itemTest t142[2] = {{{0,0,0,0,0,0},0,0,0,2,0,gujr_tag,FALSE},{{0,0,0,0,0,0},7,0,0,0,0,-1,FALSE}};
325
326 /* Oriya */
327 static const WCHAR test15[] = {0x0b13, 0x0b21, 0x0b3c, 0x0b3f, 0x0b06};
328 static const itemTest t151[2] = {{{0,0,0,0,0,0},0,0,0,0,0,orya_tag,FALSE},{{0,0,0,0,0,0},5,0,0,0,0,-1,FALSE}};
329 static const itemTest t152[2] = {{{0,0,0,0,0,0},0,0,0,2,0,orya_tag,FALSE},{{0,0,0,0,0,0},5,0,0,0,0,-1,FALSE}};
330
331 /* Tamil */
332 static const WCHAR test16[] = {0x0ba4, 0x0bae, 0x0bbf, 0x0bb4, 0x0bcd};
333 static const itemTest t161[2] = {{{0,0,0,0,0,0},0,0,0,0,0,taml_tag,FALSE},{{0,0,0,0,0,0},5,0,0,0,0,-1,FALSE}};
334 static const itemTest t162[2] = {{{0,0,0,0,0,0},0,0,0,2,0,taml_tag,FALSE},{{0,0,0,0,0,0},5,0,0,0,0,-1,FALSE}};
335
336 /* Telugu */
337 static const WCHAR test17[] = {0x0c24, 0x0c46, 0x0c32, 0x0c41, 0x0c17, 0x0c41};
338 static const itemTest t171[2] = {{{0,0,0,0,0,0},0,0,0,0,0,telu_tag,FALSE},{{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
339 static const itemTest t172[2] = {{{0,0,0,0,0,0},0,0,0,2,0,telu_tag,FALSE},{{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
340
341 /* Kannada */
342 static const WCHAR test18[] = {0x0c95, 0x0ca8, 0x0ccd, 0x0ca8, 0x0ca1};
343 static const itemTest t181[2] = {{{0,0,0,0,0,0},0,0,0,0,0,knda_tag,FALSE},{{0,0,0,0,0,0},5,0,0,0,0,-1,FALSE}};
344 static const itemTest t182[2] = {{{0,0,0,0,0,0},0,0,0,2,0,knda_tag,FALSE},{{0,0,0,0,0,0},5,0,0,0,0,-1,FALSE}};
345
346 /* Malayalam */
347 static const WCHAR test19[] = {0x0d2e, 0x0d32, 0x0d2f, 0x0d3e, 0x0d33, 0x0d02};
348 static const itemTest t191[2] = {{{0,0,0,0,0,0},0,0,0,0,0,mlym_tag,FALSE},{{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
349 static const itemTest t192[2] = {{{0,0,0,0,0,0},0,0,0,2,0,mlym_tag,FALSE},{{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
350
351 /* Diacritical */
352 static const WCHAR test20[] = {0x0309,'a','b','c','d',0};
353 static const itemTest t201[3] = {{{0,0,0,0,0,0},0,0,0,0,0x0,0,FALSE},{{0,0,0,0,0,0},1,0,0,0,0,latn_tag,FALSE},{{0,0,0,0,0,0},5,0,0,0,0,-1,FALSE}};
354 static const itemTest t202[3] = {{{0,0,0,0,0,0},0,0,0,2,0,0,TRUE,{-1,1,1,1,-1,-1}},{{0,0,0,0,0,0},1,0,0,2,0,latn_tag,FALSE},{{0,0,0,0,0,0},5,0,0,0,0,-1,FALSE}};
355
356 static const WCHAR test21[] = {0x0710, 0x0712, 0x0308, 0x0712, 0x0714,0};
357 static const itemTest t211[2] = {{{0,0,0,0,0,0},0,1,1,1,0,syrc_tag,FALSE},{{0,0,0,0,0,0},5,0,0,0,0,-1,FALSE}};
358 static const itemTest t212[2] = {{{0,0,0,0,0,0},0,0,0,0,1,syrc_tag,FALSE},
359 {{0,0,0,0,0,0},5,0,0,0,0,-1,FALSE}};
360
361 /* Latin Punctuation */
362 static const WCHAR test22[] = {'#','$',',','!','\"','*',0};
363 static const itemTest t221[3] = {{{0,0,0,0,0,0},0,0,0,0,0,latn_tag,FALSE},{{0,0,0,0,0,0},3,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
364 static const itemTest t222[3] = {{{0,0,0,0,0,0},0,1,1,1,0,latn_tag,FALSE},{{0,0,0,0,0,0},3,1,1,1,0,0,FALSE},{{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
365 static const itemTest t223[2] = {{{0,0,0,0,0,0},0,1,1,1,0,latn_tag,FALSE},{{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
366 static const int b222[2] = {1,1};
367 static const int b223[2] = {2,2};
368
369 /* Number 2*/
370 static const WCHAR test23[] = {'1','2','3',0x00b2,0x00b3,0x2070,0};
371 static const itemTest t231[3] = {{{0,0,0,0,0,0},0,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},3,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
372 static const itemTest t232[3] = {{{0,0,0,0,0,0},0,0,1,2,0,0,FALSE},{{0,0,0,0,0,0},3,0,1,2,0,0,FALSE},{{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
373
374 /* Myanmar */
375 static const WCHAR test24[] = {0x1019,0x103c,0x1014,0x103a,0x1019,0x102c,0x1021,0x1000,0x1039,0x1001,0x101b,0x102c};
376 static const itemTest t241[2] = {{{0,0,0,0,0,0},0,0,0,0,0,mymr_tag,FALSE},{{0,0,0,0,0,0},12,0,0,0,0,-1,FALSE}};
377 static const itemTest t242[2] = {{{0,0,0,0,0,0},0,0,0,2,0,mymr_tag,TRUE,{-1,1,1,1,-1,-1}},{{0,0,0,0,0,0},12,0,0,0,0,-1,FALSE}};
378
379 /* Tai Le */
380 static const WCHAR test25[] = {0x1956,0x196d,0x1970,0x1956,0x196c,0x1973,0x1951,0x1968,0x1952,0x1970};
381 static const itemTest t251[2] = {{{0,0,0,0,0,0},0,0,0,0,0,tale_tag,TRUE,{-1,-1,-1,-1,-1,latn_tag}},{{0,0,0,0,0,0},10,0,0,0,0,-1,FALSE}};
382 static const itemTest t252[2] = {{{0,0,0,0,0,0},0,0,0,2,0,tale_tag,TRUE,{-1,1,1,1,-1,latn_tag}},{{0,0,0,0,0,0},10,0,0,0,0,-1,FALSE}};
383
384 /* New Tai Lue */
385 static const WCHAR test26[] = {0x1992,0x19c4};
386 static const itemTest t261[2] = {{{0,0,0,0,0,0},0,0,0,0,0,talu_tag,TRUE,{-1,-1,-1,-1,-1,latn_tag}},{{0,0,0,0,0,0},2,0,0,0,0,-1,FALSE}};
387 static const itemTest t262[2] = {{{0,0,0,0,0,0},0,0,0,2,0,talu_tag,TRUE,{-1,1,1,1,-1,latn_tag}},{{0,0,0,0,0,0},2,0,0,0,0,-1,FALSE}};
388
389 /* Khmer */
390 static const WCHAR test27[] = {0x1781,0x17c1,0x1798,0x179a,0x1797,0x17b6,0x179f,0x17b6};
391 static const itemTest t271[2] = {{{0,0,0,0,0,0},0,0,0,0,0,khmr_tag,FALSE},{{0,0,0,0,0,0},8,0,0,0,0,-1,FALSE}};
392 static const itemTest t272[2] = {{{0,0,0,0,0,0},0,0,0,2,0,khmr_tag,TRUE,{-1,1,1,1,-1,-1}},{{0,0,0,0,0,0},8,0,0,0,0,-1,FALSE}};
393
394 /* CJK Han */
395 static const WCHAR test28[] = {0x8bed,0x7d20,0x6587,0x5b57};
396 static const itemTest t281[2] = {{{0,0,0,0,0,0},0,0,0,0,0,hani_tag,FALSE},{{0,0,0,0,0,0},4,0,0,0,0,-1,FALSE}};
397 static const itemTest t282[2] = {{{0,0,0,0,0,0},0,0,0,2,0,hani_tag,FALSE},{{0,0,0,0,0,0},4,0,0,0,0,-1,FALSE}};
398
399 /* Ideographic */
400 static const WCHAR test29[] = {0x2ff0,0x2ff3,0x2ffb,0x2ff0,0x65e5,0x65e5,0x5de5,0x7f51,0x4e02,0x4e5e};
401 static const itemTest t291[3] = {{{0,0,0,0,0,0},0,0,0,0,0,hani_tag,FALSE},{{0,0,0,0,0,0},4,0,0,0,0,hani_tag,FALSE},{{0,0,0,0,0,0},10,0,0,0,0,-1,FALSE}};
402 static const itemTest t292[3] = {{{0,0,0,0,0,0},0,1,1,1,0,hani_tag,FALSE},{{0,0,0,0,0,0},4,0,0,2,0,hani_tag,FALSE},{{0,0,0,0,0,0},10,0,0,0,0,-1,FALSE}};
403
404 /* Bopomofo */
405 static const WCHAR test30[] = {0x3113,0x3128,0x3127,0x3123,0x3108,0x3128,0x310f,0x3120};
406 static const itemTest t301[2] = {{{0,0,0,0,0,0},0,0,0,0,0,bopo_tag,FALSE},{{0,0,0,0,0,0},8,0,0,0,0,-1,FALSE}};
407 static const itemTest t302[2] = {{{0,0,0,0,0,0},0,0,0,2,0,bopo_tag,FALSE},{{0,0,0,0,0,0},8,0,0,0,0,-1,FALSE}};
408
409 /* Kana */
410 static const WCHAR test31[] = {0x3072,0x3089,0x304b,0x306a,0x30ab,0x30bf,0x30ab,0x30ca};
411 static const itemTest t311[2] = {{{0,0,0,0,0,0},0,0,0,0,0,kana_tag,FALSE},{{0,0,0,0,0,0},8,0,0,0,0,-1,FALSE}};
412 static const itemTest t312[2] = {{{0,0,0,0,0,0},0,0,0,2,0,kana_tag,FALSE},{{0,0,0,0,0,0},8,0,0,0,0,-1,FALSE}};
413 static const int b311[2] = {2,2};
414 static const int b312[2] = {2,2};
415
416 /* Hangul */
417 static const WCHAR test32[] = {0xd55c,0xad6d,0xc5b4};
418 static const itemTest t321[2] = {{{0,0,0,0,0,0},0,0,0,0,0,hang_tag,FALSE},{{0,0,0,0,0,0},3,0,0,0,0,-1,FALSE}};
419 static const itemTest t322[2] = {{{0,0,0,0,0,0},0,0,0,2,0,hang_tag,FALSE},{{0,0,0,0,0,0},3,0,0,0,0,-1,FALSE}};
420
421 /* Yi */
422 static const WCHAR test33[] = {0xa188,0xa320,0xa071,0xa0b7};
423 static const itemTest t331[2] = {{{0,0,0,0,0,0},0,0,0,0,0,yi_tag,FALSE},{{0,0,0,0,0,0},4,0,0,0,0,-1,FALSE}};
424 static const itemTest t332[2] = {{{0,0,0,0,0,0},0,0,0,2,0,yi_tag,FALSE},{{0,0,0,0,0,0},4,0,0,0,0,-1,FALSE}};
425
426 /* Ethiopic */
427 static const WCHAR test34[] = {0x130d,0x12d5,0x12dd};
428 static const itemTest t341[2] = {{{0,0,0,0,0,0},0,0,0,0,0,ethi_tag,FALSE},{{0,0,0,0,0,0},3,0,0,0,0,-1,FALSE}};
429 static const itemTest t342[2] = {{{0,0,0,0,0,0},0,0,0,2,0,ethi_tag,FALSE},{{0,0,0,0,0,0},3,0,0,0,0,-1,FALSE}};
430 static const int b342[2] = {2,2};
431
432 /* Mongolian */
433 static const WCHAR test35[] = {0x182e,0x1823,0x1829,0x182d,0x1823,0x182f,0x0020,0x182a,0x1822,0x1834,0x1822,0x182d,0x180c};
434 static const itemTest t351[2] = {{{0,0,0,0,0,0},0,0,0,0,0,mong_tag,FALSE},{{0,0,0,0,0,0},13,0,0,0,0,-1,FALSE}};
435 static const int b351[2] = {2,2};
436 static const itemTest t352[2] = {{{0,0,0,0,0,0},0,0,0,2,0,mong_tag,TRUE,{-1,1,1,1,-1,-1}},{{0,0,0,0,0,0},13,0,0,0,0,-1,FALSE}};
437 static const int b352[2] = {2,3};
438 static const itemTest t353[2] = {{{0,0,0,0,1,0},0,0,0,0,1,mong_tag,TRUE,{-1,-1,-1,-1,0,0}},{{0,0,0,0,0,0},13,0,0,0,0,-1,FALSE}};
439
440 /* Tifinagh */
441 static const WCHAR test36[] = {0x2d5c,0x2d49,0x2d3c,0x2d49,0x2d4f,0x2d30,0x2d56};
442 static const itemTest t361[2] = {{{0,0,0,0,0,0},0,0,0,0,0,tfng_tag,TRUE,{-1,-1,-1,-1,-1,latn_tag}},{{0,0,0,0,0,0},7,0,0,0,0,-1,FALSE}};
443 static const itemTest t362[2] = {{{0,0,0,0,0,0},0,0,0,2,0,tfng_tag,TRUE,{-1,1,1,1,-1,latn_tag}},{{0,0,0,0,0,0},7,0,0,0,0,-1,FALSE}};
444
445 /* N'Ko */
446 static const WCHAR test37[] = {0x07d2,0x07de,0x07cf};
447 static const itemTest t371[2] = {{{0,0,0,0,0,0},0,1,1,1,0,nko_tag,TRUE,{-1,0,0,0,-1,arab_tag}},{{0,0,0,0,0,0},3,0,0,0,0,-1,FALSE}};
448 static const itemTest t372[2] = {{{0,0,0,0,0,0},0,1,1,1,0,nko_tag,TRUE,{-1,0,0,2,-1,arab_tag}},{{0,0,0,0,0,0},3,0,0,0,0,-1,FALSE}};
449 static const itemTest t373[2] = {{{0,0,0,0,0,0},0,0,0,0,1,nko_tag,TRUE,{-1,-1,-1,2,0,arab_tag}}, {{0,0,0,0,0,0},3,0,0,0,0,-1,FALSE}};
450
451 /* Vai */
452 static const WCHAR test38[] = {0xa559,0xa524};
453 static const itemTest t381[2] = {{{0,0,0,0,0,0},0,0,0,0,0,vai_tag,TRUE,{-1,-1,-1,-1,-1,latn_tag}},{{0,0,0,0,0,0},2,0,0,0,0,-1,FALSE}};
454 static const itemTest t382[2] = {{{0,0,0,0,0,0},0,0,0,2,0,vai_tag,TRUE,{-1,1,1,1,-1,latn_tag}},{{0,0,0,0,0,0},2,0,0,0,0,-1,FALSE}};
455
456 /* Cherokee */
457 static const WCHAR test39[] = {0x13e3,0x13b3,0x13a9,0x0020,0x13a6,0x13ec,0x13c2,0x13af,0x13cd,0x13d7};
458 static const itemTest t391[2] = {{{0,0,0,0,0,0},0,0,0,0,0,cher_tag,FALSE},{{0,0,0,0,0,0},10,0,0,0,0,-1,FALSE}};
459 static const itemTest t392[2] = {{{0,0,0,0,0,0},0,0,0,2,0,cher_tag,TRUE,{-1,1,1,1,-1,-1}},{{0,0,0,0,0,0},10,0,0,0,0,-1,FALSE}};
460
461 /* Canadian Aboriginal Syllabics */
462 static const WCHAR test40[] = {0x1403,0x14c4,0x1483,0x144e,0x1450,0x1466};
463 static const itemTest t401[2] = {{{0,0,0,0,0,0},0,0,0,0,0,cans_tag,FALSE},{{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
464 static const itemTest t402[2] = {{{0,0,0,0,0,0},0,0,0,2,0,cans_tag,TRUE,{-1,1,1,1,-1,-1}},{{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
465
466 /* Ogham */
467 static const WCHAR test41[] = {0x169b,0x1691,0x168c,0x1690,0x168b,0x169c};
468 static const itemTest t411[2] = {{{0,0,0,0,0,0},0,0,0,0,0,ogam_tag,FALSE},{{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
469 static const itemTest t412[4] = {{{0,0,0,0,0,0},0,1,1,1,0,ogam_tag,FALSE},{{0,0,0,0,0,0},1,0,0,2,0,ogam_tag,FALSE},{{0,0,0,0,0,0},5,1,1,1,0,ogam_tag,FALSE},{{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
470 static const int b412[2] = {1,1};
471
472 /* Runic */
473 static const WCHAR test42[] = {0x16a0,0x16a1,0x16a2,0x16a3,0x16a4,0x16a5};
474 static const itemTest t421[2] = {{{0,0,0,0,0,0},0,0,0,0,0,runr_tag,FALSE},{{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
475 static const itemTest t422[4] = {{{0,0,0,0,0,0},0,0,0,2,0,runr_tag,TRUE,{-1,1,1,1,-1,-1}},{{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
476
477 /* Braille */
478 static const WCHAR test43[] = {0x280f,0x2817,0x2811,0x280d,0x280a,0x2811,0x2817};
479 static const itemTest t431[2] = {{{0,0,0,0,0,0},0,0,0,0,0,brai_tag,FALSE},{{0,0,0,0,0,0},7,0,0,0,0,-1,FALSE}};
480 static const itemTest t432[4] = {{{0,0,0,0,0,0},0,0,0,2,0,brai_tag,TRUE,{-1,1,1,1,-1,-1}},{{0,0,0,0,0,0},7,0,0,0,0,-1,FALSE}};
481
482 /* Private and Surrogates Area */
483 static const WCHAR test44[] = {0xe000, 0xe001, 0xd800, 0xd801};
484 static const itemTest t441[3] = {{{0,0,0,0,0,0},0,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},2,0,0,0,0,0,FALSE},{{0,0,0,0,0,0},4,0,0,0,0,-1,FALSE}};
485 static const itemTest t442[4] = {{{0,0,0,0,0,0},0,0,0,2,0,0,TRUE,{-1,1,1,1,-1,-1}},{{0,0,0,0,0,0},2,0,0,2,0,0,TRUE,{-1,1,1,1,-1,-1}},{{0,0,0,0,0,0},4,0,0,0,0,-1,FALSE}};
486
487 /* Deseret */
488 static const WCHAR test45[] = {0xd801,0xdc19,0xd801,0xdc32,0xd801,0xdc4c,0xd801,0xdc3c,0xd801,0xdc32,0xd801,0xdc4b,0xd801,0xdc2f,0xd801,0xdc4c,0xd801,0xdc3b,0xd801,0xdc32,0xd801,0xdc4a,0xd801,0xdc28};
489 static const itemTest t451[2] = {{{0,0,0,0,0,0},0,0,0,0,0,dsrt_tag,TRUE,{-1,-1,-1,-1,-1,0x0}},{{0,0,0,0,0,0},24,0,0,0,0,-1,FALSE}};
490 static const itemTest t452[2] = {{{0,0,0,0,0,0},0,0,0,2,0,dsrt_tag,TRUE,{-1,1,1,1,-1,0x0}},{{0,0,0,0,0,0},24,0,0,0,0,-1,FALSE}};
491
492 /* Osmanya */
493 static const WCHAR test46[] = {0xd801,0xdc8b,0xd801,0xdc98,0xd801,0xdc88,0xd801,0xdc91,0xd801,0xdc9b,0xd801,0xdc92,0xd801,0xdc95,0xd801,0xdc80};
494 static const itemTest t461[2] = {{{0,0,0,0,0,0},0,0,0,0,0,osma_tag,TRUE,{-1,-1,-1,-1,-1,0x0}},{{0,0,0,0,0,0},16,0,0,0,0,-1,FALSE}};
495 static const itemTest t462[2] = {{{0,0,0,0,0,0},0,0,0,2,0,osma_tag,TRUE,{-1,1,1,1,-1,0x0}},{{0,0,0,0,0,0},16,0,0,0,0,-1,FALSE}};
496
497 /* Mathematical Alphanumeric Symbols */
498 static const WCHAR test47[] = {0xd835,0xdc00,0xd835,0xdc35,0xd835,0xdc6a,0xd835,0xdc9f,0xd835,0xdcd4,0xd835,0xdd09,0xd835,0xdd3e,0xd835,0xdd73,0xd835,0xdda8,0xd835,0xdddd,0xd835,0xde12,0xd835,0xde47,0xd835,0xde7c};
499 static const itemTest t471[2] = {{{0,0,0,0,0,0},0,0,0,0,0,math_tag,TRUE,{-1,-1,-1,-1,-1,0x0}},{{0,0,0,0,0,0},26,0,0,0,0,-1,FALSE}};
500 static const itemTest t472[2] = {{{0,0,0,0,0,0},0,0,0,2,0,math_tag,TRUE,{-1,1,1,1,-1,0x0}},{{0,0,0,0,0,0},26,0,0,0,0,-1,FALSE}};
501
502 /* Mathematical and Numeric combinations */
503 /* These have a leading hebrew character to force complicated itemization */
504 static const WCHAR test48[] = {0x05e9,' ','1','2','3','.'};
505 static const itemTest t481[4] = {{{0,0,0,0,0,0},0,1,1,1,0,hebr_tag,FALSE},
506 {{0,0,0,0,0},2,0,1,2,0,0,FALSE},{{0,0,0,0,0},5,0,0,0,0,0,FALSE},
507 {{0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
508 static const itemTest t482[4] = {{{0,0,0,0,0,0},0,0,0,0,1,hebr_tag,FALSE},
509 {{0,0,0,0,0,0},2,0,1,0,1,0,FALSE},
510 {{0,0,0,0,0,0},5,0,0,0,1,0,FALSE},
511 {{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
512
513 static const WCHAR test49[] = {0x05e9,' ','1','2','.','1','2'};
514 static const itemTest t491[3] = {{{0,0,0,0,0,0},0,1,1,1,0,hebr_tag,FALSE},
515 {{0,0,0,0,0},2,0,1,2,0,0,FALSE},{{0,0,0,0,0},7,0,0,0,0,-1,FALSE}};
516 static const itemTest t492[3] = {{{0,0,0,0,0,0},0,0,0,0,1,hebr_tag,FALSE},
517 {{0,0,0,0,0,0},2,0,1,0,1,0,FALSE},
518 {{0,0,0,0,0,0},7,0,0,0,0,-1,FALSE}};
519
520 static const WCHAR test50[] = {0x05e9,' ','.','1','2','3'};
521 static const itemTest t501[4] = {{{0,0,0,0,0,0},0,1,1,1,0,hebr_tag,FALSE},
522 {{0,0,0,0,0},2,1,1,1,0,0,FALSE},{{0,0,0,0,0},3,0,1,2,0,0,FALSE},
523 {{0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
524 static const itemTest t502[4] = {{{0,0,0,0,0,0},0,0,0,0,1,hebr_tag,FALSE},
525 {{0,0,0,0,0,0},2,0,0,0,1,0,FALSE},
526 {{0,0,0,0,0,0},3,0,1,0,1,0,FALSE},
527 {{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}};
528
529 static const WCHAR test51[] = {0x05e9,' ','a','b','.','1','2'};
530 static const itemTest