ReactOS  0.4.13-dev-92-gf251225
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 2405 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 )
unsigned int ULONG
Definition: retypes.h:1

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 2911 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 2839 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);
1305  DeleteObject(*hfont);
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);
1342  DeleteObject(*hfont);
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 UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
static int CALLBACK enumFontProc(const LOGFONTA *lpelfe, const TEXTMETRICA *lpntme, DWORD FontType, LPARAM lParam)
Definition: usp10.c:1244
WORD result[10]
Definition: usp10.c:58
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define DEFAULT_CHARSET
Definition: wingdi.h:383
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
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
WCHAR check[10]
Definition: usp10.c:57
static HFONT hfont
void __winetest_cdecl winetest_trace(const char *msg,...)
unsigned short WORD
Definition: ntddk_ex.h:93
void check(CONTEXT *pContext)
Definition: NtContinue.c:61
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
HDC hdc
Definition: main.c:9
GLenum GLint * range
Definition: glext.h:7539
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
void __winetest_cdecl winetest_skip(const char *msg,...)
int WINAPI EnumFontFamiliesExA(_In_ HDC, _In_ PLOGFONTA, _In_ FONTENUMPROCA, _In_ LPARAM, _In_ DWORD)
#define GDI_ERROR
Definition: wingdi.h:1291
#define memset(x, y, z)
Definition: compat.h:39
LPARAM lParam
Definition: combotst.c:139

◆ _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 2913 of file usp10.c.

2914 {
2915  int iX, iCP, i;
2916  int icChars, icGlyphs;
2917  int piCP;
2918  int clusterSize;
2919  HRESULT hr;
2920  SCRIPT_VISATTR psva[10];
2921  int piTrailing;
2922  int direction;
2923 
2924  memset(psva,0,sizeof(psva));
2925  direction = (psa->fRTL)?-1:+1;
2926 
2927  for(iX = -1, i = iCP = 0; i < cChars; i++)
2928  {
2929  if (offsets[i] != iX)
2930  {
2931  iX = offsets[i];
2932  iCP = i;
2933  }
2934  icChars = cChars;
2935  icGlyphs = cGlyphs;
2936  hr = ScriptXtoCP(iX, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piCP, &piTrailing);
2937  ok_(__FILE__,line)(hr == S_OK, "ScriptXtoCP: should return S_OK not %08x\n", hr);
2938  ok_(__FILE__,line)(piCP == iCP, "ScriptXtoCP: iX=%d should return piCP=%d not %d\n", iX, iCP, piCP);
2939  ok_(__FILE__,line)(piTrailing == 0, "ScriptXtoCP: iX=%d should return piTrailing=0 not %d\n", iX, piTrailing);
2940  }
2941 
2942  for(iX = -2, i = 0; i < cChars; i++)
2943  {
2944  if (offsets[i]+direction != iX)
2945  {
2946  iX = offsets[i] + direction;
2947  iCP = i;
2948  }
2949  icChars = cChars;
2950  icGlyphs = cGlyphs;
2951  hr = ScriptXtoCP(iX, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piCP, &piTrailing);
2952  ok_(__FILE__,line)(hr == S_OK, "ScriptXtoCP leading: should return S_OK not %08x\n", hr);
2953  ok_(__FILE__,line)(piCP == iCP, "ScriptXtoCP leading: iX=%d should return piCP=%d not %d\n", iX, iCP, piCP);
2954  ok_(__FILE__,line)(piTrailing == 0, "ScriptXtoCP leading: iX=%d should return piTrailing=0 not %d\n", iX, piTrailing);
2955  }
2956 
2957  for(clusterSize = 0, iCP = 0, iX = -2, i = 0; i < cChars; i++)
2958  {
2959  clusterSize++;
2960  if (offsets[i] != offsets[i+1])
2961  {
2962  iX = offsets[i+1]-direction;
2963  icChars = cChars;
2964  icGlyphs = cGlyphs;
2965  hr = ScriptXtoCP(iX, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piCP, &piTrailing);
2966  ok_(__FILE__,line)(hr == S_OK, "ScriptXtoCP trailing: should return S_OK not %08x\n", hr);
2967  ok_(__FILE__,line)(piCP == iCP, "ScriptXtoCP trailing: iX=%d should return piCP=%d not %d\n", iX, iCP, piCP);
2968  ok_(__FILE__,line)(piTrailing == clusterSize, "ScriptXtoCP trailing: iX=%d should return piTrailing=%d not %d\n", iX, clusterSize, piTrailing);
2969  iCP = i+1;
2970  clusterSize = 0;
2971  }
2972  }
2973 }
HRESULT hr
Definition: shlfolder.c:183
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
#define ok_(x1, x2)
_In_ FONTOBJ _In_ ULONG _In_ ULONG cGlyphs
Definition: winddi.h:3799
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
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:2852
Definition: parser.c:48
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
#define memset(x, y, z)
Definition: compat.h:39

◆ _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 2841 of file usp10.c.

2842 {
2843  int iX, iCP;
2844  int icChars, icGlyphs;
2845  int piCP, piX;
2846  HRESULT hr;
2847  SCRIPT_VISATTR psva[10];
2848  int piTrailing;
2849  BOOL fTrailing;
2850  int direction;
2851 
2852  memset(psva,0,sizeof(psva));
2853  direction = (psa->fRTL)?-1:+1;
2854 
2855  for(iCP = 0; iCP < cChars; iCP++)
2856  {
2857  iX = offsets[iCP];
2858  icChars = cChars;
2859  icGlyphs = cGlyphs;
2860  hr = ScriptXtoCP(iX, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piCP, &piTrailing);
2861  winetest_ok(hr == S_OK, "ScriptXtoCP: should return S_OK not %08x\n", hr);
2862  winetest_ok(piCP == iCP, "ScriptXtoCP: iX=%d should return piCP=%d not %d\n", iX, iCP, piCP);
2863  winetest_ok(piTrailing == 0, "ScriptXtoCP: iX=%d should return piTrailing=0 not %d\n", iX, piTrailing);
2864  }
2865 
2866  for(iCP = 0; iCP < cChars; iCP++)
2867  {
2868  iX = offsets[iCP]+direction;
2869  icChars = cChars;
2870  icGlyphs = cGlyphs;
2871  hr = ScriptXtoCP(iX, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piCP, &piTrailing);
2872  winetest_ok(hr == S_OK, "ScriptXtoCP leading: should return S_OK not %08x\n", hr);
2873  winetest_ok(piCP == iCP, "ScriptXtoCP leading: iX=%d should return piCP=%d not %d\n", iX, iCP, piCP);
2874  winetest_ok(piTrailing == 0, "ScriptXtoCP leading: iX=%d should return piTrailing=0 not %d\n", iX, piTrailing);
2875  }
2876 
2877  for(iCP = 0; iCP < cChars; iCP++)
2878  {
2879  iX = offsets[iCP+1]-direction;
2880  icChars = cChars;
2881  icGlyphs = cGlyphs;
2882  hr = ScriptXtoCP(iX, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piCP, &piTrailing);
2883  winetest_ok(hr == S_OK, "ScriptXtoCP trailing: should return S_OK not %08x\n", hr);
2884  winetest_ok(piCP == iCP, "ScriptXtoCP trailing: iX=%d should return piCP=%d not %d\n", iX, iCP, piCP);
2885  winetest_ok(piTrailing == 1, "ScriptXtoCP trailing: iX=%d should return piTrailing=1 not %d\n", iX, piTrailing);
2886  }
2887 
2888  for(iCP = 0; iCP <= cChars+1; iCP++)
2889  {
2890  fTrailing = FALSE;
2891  icChars = cChars;
2892  icGlyphs = cGlyphs;
2893  hr = ScriptCPtoX(iCP, fTrailing, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piX);
2894  winetest_ok(hr == S_OK, "ScriptCPtoX: should return S_OK not %08x\n", hr);
2895  winetest_ok(piX == offsets[iCP],
2896  "ScriptCPtoX: iCP=%d should return piX=%d not %d\n", iCP, offsets[iCP], piX);
2897  }
2898 
2899  for(iCP = 0; iCP <= cChars+1; iCP++)
2900  {
2901  fTrailing = TRUE;
2902  icChars = cChars;
2903  icGlyphs = cGlyphs;
2904  hr = ScriptCPtoX(iCP, fTrailing, icChars, icGlyphs, pwLogClust, psva, piAdvance, psa, &piX);
2905  winetest_ok(hr == S_OK, "ScriptCPtoX trailing: should return S_OK not %08x\n", hr);
2906  winetest_ok(piX == offsets[iCP+1],
2907  "ScriptCPtoX trailing: iCP=%d should return piX=%d not %d\n", iCP, offsets[iCP+1], piX);
2908  }
2909 }
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
_In_ FONTOBJ _In_ ULONG _In_ ULONG cGlyphs
Definition: winddi.h:3799
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:2648
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:2852
unsigned int BOOL
Definition: ntddk_ex.h:94
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
void __winetest_cdecl winetest_ok(int condition, const char *msg,...)
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
#define memset(x, y, z)
Definition: compat.h:39

◆ _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 }
const char * tags[7 *8]
Definition: apphelp.c:213
HRESULT hr
Definition: shlfolder.c:183
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
int nItems
Definition: appswitch.c:56
#define todo_wine_if(is_todo)
Definition: test.h:155
void __winetest_cdecl winetest_ok(int condition, const char *msg,...)
LONG HRESULT
Definition: typedefs.h:77
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:1851
static const WCHAR Control[]
Definition: interface.c:27
#define broken(x)
Definition: _sntprintf.h:21
#define S_OK
Definition: intsafe.h:59
#define min(a, b)
Definition: monoChain.cc:55
unsigned int ULONG
Definition: retypes.h:1
void __winetest_cdecl winetest_win_skip(const char *msg,...)
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
static TCHAR * items[]
Definition: page1.c:45
#define SCRIPT_UNDEFINED
Definition: usp10.h:69

◆ _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  {
1068  todo_wine_if(tags[item] == syrc_tag && !x)
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 
1216 cleanup:
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 }
const char * tags[7 *8]
Definition: apphelp.c:213
HRESULT hr
Definition: shlfolder.c:183
static CHAR string2[MAX_PATH]
Definition: automation.c:468
HRESULT WINAPI ScriptGetProperties(const SCRIPT_PROPERTIES ***props, int *num)
Definition: usp10.c:1152
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static UINT UINT LPWORD glyphs
Definition: font.c:44
SCRIPT_ANALYSIS a
Definition: usp10.h:151
#define syrc_tag
Definition: usp10.c:146
#define thaa_tag
Definition: usp10.c:147
smooth NULL
Definition: ftsmooth.c:416
#define todo_wine_if(is_todo)
Definition: test.h:155
void __winetest_cdecl winetest_trace(const char *msg,...)
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
void __winetest_cdecl winetest_ok(int condition, const char *msg,...)
LONG HRESULT
Definition: typedefs.h:77
unsigned short WORD
Definition: ntddk_ex.h:93
HDC hdc
Definition: main.c:9
static const WCHAR Control[]
Definition: interface.c:27
#define broken(x)
Definition: _sntprintf.h:21
#define S_OK
Definition: intsafe.h:59
static ATOM item
Definition: dde.c:856
WORD fLogicalOrder
Definition: usp10.h:144
#define arab_tag
Definition: usp10.c:143
HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *psc)
Definition: usp10.c:1078
unsigned int ULONG
Definition: retypes.h:1
void __winetest_cdecl winetest_win_skip(const char *msg,...)
char * cleanup(char *str)
Definition: wpickclick.c:99
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define memset(x, y, z)
Definition: compat.h:39
#define HeapFree(x, y, z)
Definition: compat.h:394
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ create_test_window()

static HWND create_test_window ( void  )
static

Definition at line 3319 of file usp10.c.

3320 {
3321  HWND hwnd = CreateWindowExA(0, "Static", "", WS_POPUP, 0, 0, 100, 100, 0, 0, 0, NULL);
3322  ok(hwnd != NULL, "Failed to create test window.\n");
3323 
3325  UpdateWindow(hwnd);
3326 
3327  return hwnd;
3328 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI UpdateWindow(_In_ HWND)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
#define SW_SHOW
Definition: winuser.h:769
#define WS_POPUP
Definition: pedump.c:616
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)

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 2413 of file usp10.c.

2414 {
2415  struct enum_font_data *efnd = (struct enum_font_data *)lParam;
2416 
2417  if (type & (TRUETYPE_FONTTYPE | DEVICE_FONTTYPE)) return 1;
2418 
2419  if (efnd->total < MAX_ENUM_FONTS)
2420  {
2421  efnd->elf[efnd->total++] = *(ENUMLOGFONTA*)lf;
2422  }
2423  else
2424  trace("enum tests invalid; you have more than %d fonts\n", MAX_ENUM_FONTS);
2425 
2426  return 1;
2427 }
#define trace(...)
Definition: kmt_test.h:217
#define DEVICE_FONTTYPE
Definition: wingdi.h:1090
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
ENUMLOGFONTA elf[MAX_ENUM_FONTS]
Definition: usp10.c:2410
#define MAX_ENUM_FONTS
Definition: usp10.c:2405
LOGFONTA * lf
Definition: font.c:2789
LPARAM lParam
Definition: combotst.c:139
#define TRUETYPE_FONTTYPE
Definition: wingdi.h:1091

Referenced by test_ScriptGetFontProperties().

◆ enum_proc()

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

Definition at line 3576 of file usp10.c.

3577 {
3578  HRESULT hr;
3580  SCRIPT_CONTROL sc;
3581  SCRIPT_STATE ss;
3582  LCID lcid_old;
3583 
3584  if (!IsValidLocale(lcid, LCID_INSTALLED)) return TRUE;
3585 
3586  memset(&sds, 0, sizeof(sds));
3587  memset(&sc, 0, sizeof(sc));
3588  memset(&ss, 0, sizeof(ss));
3589 
3590  lcid_old = GetThreadLocale();
3591  if (!SetThreadLocale(lcid)) return TRUE;
3592 
3593  hr = ScriptRecordDigitSubstitution(lcid, &sds);
3594  ok(hr == S_OK, "ScriptRecordDigitSubstitution failed: 0x%08x\n", hr);
3595 
3596  hr = ScriptApplyDigitSubstitution(&sds, &sc, &ss);
3597  ok(hr == S_OK, "ScriptApplyDigitSubstitution failed: 0x%08x\n", hr);
3598 
3599  SetThreadLocale(lcid_old);
3600  return TRUE;
3601 }
#define TRUE
Definition: types.h:120
HRESULT WINAPI ScriptApplyDigitSubstitution(const SCRIPT_DIGITSUBSTITUTE *sds, SCRIPT_CONTROL *sc, SCRIPT_STATE *ss)
Definition: usp10.c:1273
HRESULT hr
Definition: shlfolder.c:183
DWORD LCID
Definition: nls.h:13
#define LCID_INSTALLED
Definition: winnls.h:198
BOOL WINAPI SetThreadLocale(LCID lcid)
Definition: lang.c:1468
#define ok(value,...)
LONG HRESULT
Definition: typedefs.h:77
BOOL WINAPI IsValidLocale(LCID lcid, DWORD flags)
Definition: lang.c:1548
#define S_OK
Definition: intsafe.h:59
#define ss
Definition: i386-dis.c:432
#define memset(x, y, z)
Definition: compat.h:39
HRESULT WINAPI ScriptRecordDigitSubstitution(LCID locale, SCRIPT_DIGITSUBSTITUTE *sds)
Definition: usp10.c:1207
LCID WINAPI GetThreadLocale(void)
Definition: lang.c:1449

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 2429 of file usp10.c.

2430 {
2431  struct enum_font_data *efnd = (struct enum_font_data *)lParam;
2432 
2433  if (!(type & (TRUETYPE_FONTTYPE | DEVICE_FONTTYPE))) return 1;
2434 
2435  if (efnd->total < MAX_ENUM_FONTS)
2436  {
2437  efnd->elf[efnd->total++] = *(ENUMLOGFONTA*)lf;
2438  }
2439  else
2440  trace("enum tests invalid; you have more than %d fonts\n", MAX_ENUM_FONTS);
2441 
2442  return 1;
2443 }
#define trace(...)
Definition: kmt_test.h:217
#define DEVICE_FONTTYPE
Definition: wingdi.h:1090
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
ENUMLOGFONTA elf[MAX_ENUM_FONTS]
Definition: usp10.c:2410
#define MAX_ENUM_FONTS
Definition: usp10.c:2405
LOGFONTA * lf
Definition: font.c:2789
LPARAM lParam
Definition: combotst.c:139
#define TRUETYPE_FONTTYPE
Definition: wingdi.h:1091

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 }
#define DWORD
Definition: nt_native.h:44
LOGFONTA lf
Definition: usp10.c:1241
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
GLenum GLint GLuint mask
Definition: glext.h:6028
unsigned int idx
Definition: utils.c:41
FONTSIGNATURE ntmFontSig
Definition: wingdi.h:2650
BYTE range
Definition: usp10.c:1240
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
DWORD fsUsb[4]
Definition: wingdi.h:1520
LPARAM lParam
Definition: combotst.c:139
#define TRUETYPE_FONTTYPE
Definition: wingdi.h:1091

Referenced by _find_font_for_range().

◆ HRESULT()

static HRESULT ( WINAPI pScriptItemizeOpenType) const
static

◆ init_tests()

static void init_tests ( void  )
static

Definition at line 4113 of file usp10.c.

4114 {
4115  HMODULE module = GetModuleHandleA("usp10.dll");
4116 
4117  ok(module != 0, "Expected usp10.dll to be loaded.\n");
4118 
4119  pScriptItemizeOpenType = (void *)GetProcAddress(module, "ScriptItemizeOpenType");
4120  pScriptShapeOpenType = (void *)GetProcAddress(module, "ScriptShapeOpenType");
4121  pScriptGetFontScriptTags = (void *)GetProcAddress(module, "ScriptGetFontScriptTags");
4122  pScriptGetFontLanguageTags = (void *)GetProcAddress(module, "ScriptGetFontLanguageTags");
4123  pScriptGetFontFeatureTags = (void *)GetProcAddress(module, "ScriptGetFontFeatureTags");
4124 }
#define ok(value,...)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:819
#define GetProcAddress(x, y)
Definition: compat.h:410

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 }
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
GLenum GLint GLuint mask
Definition: glext.h:6028
static FILE * out
Definition: regtests2xml.c:44
unsigned long DWORD
Definition: ntddk_ex.h:95

Referenced by test_ScriptItemize_surrogates().

◆ START_TEST()

START_TEST ( usp10  )

Definition at line 4126 of file usp10.c.

4127 {
4128  HWND hwnd;
4129  HDC hdc;
4130  LOGFONTA lf;
4131  HFONT hfont;
4132 
4133  unsigned short pwOutGlyphs[256];
4134 
4135  /* We need a valid HDC to drive a lot of Script functions which requires the following *
4136  * to set up for the tests. */
4137  hwnd = CreateWindowExA(0, "static", "", WS_POPUP, 0,0,100,100,
4138  0, 0, 0, NULL);
4139  assert(hwnd != 0);
4141  UpdateWindow(hwnd);
4142 
4143  hdc = GetDC(hwnd); /* We now have a hdc */
4144  ok( hdc != NULL, "HDC failed to be created %p\n", hdc);
4145 
4146  memset(&lf, 0, sizeof(LOGFONTA));
4147  lstrcpyA(lf.lfFaceName, "Tahoma");
4148  lf.lfHeight = 10;
4149  lf.lfWeight = 3;
4150  lf.lfWidth = 10;
4151 
4153  ok(hfont != NULL, "SelectObject failed: %p\n", hfont);
4154 
4155  init_tests();
4156 
4166 
4171  test_ScriptXtoX();
4175 
4179  test_ScriptBreak();
4180  test_newlines();
4181 
4184 
4187 
4188  ReleaseDC(hwnd, hdc);
4190 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static void test_ScriptGetCMap(HDC hdc, unsigned short pwOutGlyphs[256])
Definition: usp10.c:2307
HDC WINAPI GetDC(_In_opt_ HWND)
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
static void init_tests(void)
Definition: usp10.c:4113
static void test_ScriptBreak(void)
Definition: usp10.c:3654
static HDC
Definition: imagelist.c:92
BOOL WINAPI UpdateWindow(_In_ HWND)
static void test_digit_substitution(void)
Definition: usp10.c:3603
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
#define assert(x)
Definition: debug.h:53
static void test_ScriptShapeOpenType(HDC hdc)
Definition: usp10.c:1357
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
static void test_ScriptGetFontFunctions(HDC hdc)
Definition: usp10.c:3748
BOOL WINAPI DestroyWindow(_In_ HWND)
static void test_ScriptItemize_surrogates(void)
Definition: usp10.c:942
static void test_ScriptTextOut2(HDC hdc)
Definition: usp10.c:2718
static void test_ScriptString(HDC hdc)
Definition: usp10.c:3104
static void test_ScriptPlace(HDC hdc)
Definition: usp10.c:2091
LONG lfHeight
Definition: dimm.idl:42
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define ok(value,...)
LONG lfWeight
Definition: dimm.idl:46
smooth NULL
Definition: ftsmooth.c:416
static void test_newlines(void)
Definition: usp10.c:3711
#define SW_SHOW
Definition: winuser.h:769
static HFONT hfont
LOGFONTA * lf
Definition: font.c:2789
LONG lfWidth
Definition: dimm.idl:43
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
HDC hdc
Definition: main.c:9
static void test_ScriptShape(HDC hdc)
Definition: usp10.c:1831
static void test_ScriptString_pSize(HDC hdc)
Definition: usp10.c:3977
static void test_ScriptCacheGetHeight(HDC hdc)
Definition: usp10.c:3330
static void test_ScriptGetGlyphABCWidth(HDC hdc)
Definition: usp10.c:3402
static void test_script_cache_reuse(void)
Definition: usp10.c:4007
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_ScriptGetFontProperties(HDC hdc)
Definition: usp10.c:2445
static void test_ScriptTextOut(HDC hdc)
Definition: usp10.c:2632
static void test_ScriptXtoX(void)
Definition: usp10.c:2975
#define WS_POPUP
Definition: pedump.c:616
static void test_ScriptItemIzeShapePlace(HDC hdc, unsigned short pwOutGlyphs[256])
Definition: usp10.c:2159
static void test_ScriptGetLogicalWidths(void)
Definition: usp10.c:3887
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
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)
static void test_ScriptTextOut3(HDC hdc)
Definition: usp10.c:2785
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
static void test_ScriptIsComplex(void)
Definition: usp10.c:3915
static void test_ScriptItemize(void)
Definition: usp10.c:180
static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
Definition: usp10.c:3173
static void test_ScriptGetProperties(void)
Definition: usp10.c:3635
static void test_ScriptLayout(void)
Definition: usp10.c:3480
#define memset(x, y, z)
Definition: compat.h:39

◆ test_digit_substitution()

static void test_digit_substitution ( void  )
static

Definition at line 3603 of file usp10.c.

3604 {
3605  BOOL ret;
3606  unsigned int i;
3607  static const LGRPID groups[] =
3608  {
3611  LGRPID_BALTIC,
3612  LGRPID_GREEK,
3616  LGRPID_KOREAN,
3619  LGRPID_THAI,
3620  LGRPID_HEBREW,
3621  LGRPID_ARABIC,
3623  LGRPID_INDIC,
3626  };
3627 
3628  for (i = 0; i < ARRAY_SIZE(groups); ++i)
3629  {
3631  ok(ret, "EnumLanguageGroupLocalesA failed unexpectedly: %u\n", GetLastError());
3632  }
3633 }
#define LGRPID_KOREAN
Definition: winnls.h:464
DWORD LGRPID
Definition: winnls.h:517
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define LGRPID_ARABIC
Definition: winnls.h:469
#define LGRPID_TURKISH
Definition: winnls.h:462
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
#define LGRPID_VIETNAMESE
Definition: winnls.h:470
GLsizei GLuint * groups
Definition: glext.h:11113
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
static BOOL CALLBACK enum_proc(LGRPID group, LCID lcid, LPSTR locale, LONG_PTR lparam)
Definition: usp10.c:3576
#define LGRPID_HEBREW
Definition: winnls.h:468
#define LGRPID_INDIC
Definition: winnls.h:471
int ret
#define LGRPID_CENTRAL_EUROPE
Definition: winnls.h:458
#define LGRPID_SIMPLIFIED_CHINESE
Definition: winnls.h:466
#define LGRPID_TRADITIONAL_CHINESE
Definition: winnls.h:465
#define ARRAY_SIZE(a)
Definition: main.h:24
#define LGRPID_CYRILLIC
Definition: winnls.h:461
#define LGRPID_GREEK
Definition: winnls.h:460
#define LGRPID_JAPANESE
Definition: winnls.h:463
#define LGRPID_BALTIC
Definition: winnls.h:459
#define LGRPID_GEORGIAN
Definition: winnls.h:472
#define LGRPID_THAI
Definition: winnls.h:467
#define LGRPID_WESTERN_EUROPE
Definition: winnls.h:457
BOOL WINAPI EnumLanguageGroupLocalesA(LANGGROUPLOCALE_ENUMPROCA pLangGrpLcEnumProc, LGRPID lgrpid, DWORD dwFlags, LONG_PTR lParam)
Definition: lang.c:3115
#define LGRPID_ARMENIAN
Definition: winnls.h:473

Referenced by START_TEST().

◆ test_newlines()

static void test_newlines ( void  )
static

Definition at line 3711 of file usp10.c.

3712 {
3713  static const WCHAR test1[] = {'t','e','x','t','\r','t','e','x','t',0};
3714  static const WCHAR test2[] = {'t','e','x','t','\n','t','e','x','t',0};
3715  static const WCHAR test3[] = {'t','e','x','t','\r','\n','t','e','x','t',0};
3716  static const WCHAR test4[] = {'t','e','x','t','\n','\r','t','e','x','t',0};
3717  static const WCHAR test5[] = {'1','2','3','4','\n','\r','1','2','3','4',0};
3718  SCRIPT_ITEM items[5];
3719  HRESULT hr;
3720  int count;
3721 
3722  count = 0;
3724  ok(hr == S_OK, "ScriptItemize failed: 0x%08x\n", hr);
3725  ok(count == 3, "got %d expected 3\n", count);
3726 
3727  count = 0;
3729  ok(hr == S_OK, "ScriptItemize failed: 0x%08x\n", hr);
3730  ok(count == 3, "got %d expected 3\n", count);
3731 
3732  count = 0;
3734  ok(hr == S_OK, "ScriptItemize failed: 0x%08x\n", hr);
3735  ok(count == 4, "got %d expected 4\n", count);
3736 
3737  count = 0;
3739  ok(hr == S_OK, "ScriptItemize failed: 0x%08x\n", hr);
3740  ok(count == 4, "got %d expected 4\n", count);
3741 
3742  count = 0;
3744  ok(hr == S_OK, "ScriptItemize failed: 0x%08x\n", hr);
3745  ok(count == 4, "got %d expected 4\n", count);
3746 }
HRESULT hr
Definition: shlfolder.c:183
void test3(void)
Definition: hivetest.c:423
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define lstrlenW
Definition: compat.h:407
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
void test1(void)
Definition: hivetest.c:366
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:1851
void test2(void)
Definition: regtest.c:173
#define S_OK
Definition: intsafe.h:59
void test5(void)
Definition: hivetest.c:623
static TCHAR * items[]
Definition: page1.c:45
void test4(void)
Definition: hivetest.c:461

Referenced by START_TEST().

◆ test_script_cache_reuse()

static void test_script_cache_reuse ( void  )
static

Definition at line 4007 of file usp10.c.

4008 {
4009  HRESULT hr;
4010  HWND hwnd1, hwnd2;
4011  HDC hdc1, hdc2;
4012  LOGFONTA lf;
4013  HFONT hfont1, hfont2;
4014  HFONT prev_hfont1, prev_hfont2;
4015  SCRIPT_CACHE sc = NULL;
4016  SCRIPT_CACHE sc2;
4017  LONG height;
4018 
4019  hwnd1 = create_test_window();
4020  hwnd2 = create_test_window();
4021 
4022  hdc1 = GetDC(hwnd1);
4023  hdc2 = GetDC(hwnd2);
4024  ok(hdc1 != NULL && hdc2 != NULL, "Failed to get window dc.\n");
4025 
4026  memset(&lf, 0, sizeof(LOGFONTA));
4027  lstrcpyA(lf.lfFaceName, "Tahoma");
4028 
4029  lf.lfHeight = 10;
4030  hfont1 = CreateFontIndirectA(&lf);
4031  ok(hfont1 != NULL, "CreateFontIndirectA failed\n");
4032  hfont2 = CreateFontIndirectA(&lf);
4033  ok(hfont2 != NULL, "CreateFontIndirectA failed\n");
4034  ok(hfont1 != hfont2, "Expected fonts %p and %p to differ\n", hfont1, hfont2);
4035 
4036  prev_hfont1 = SelectObject(hdc1, hfont1);
4037  ok(prev_hfont1 != NULL, "SelectObject failed: %p\n", prev_hfont1);
4038  prev_hfont2 = SelectObject(hdc2, hfont1);
4039  ok(prev_hfont2 != NULL, "SelectObject failed: %p\n", prev_hfont2);
4040 
4041  /* Get a script cache */
4042  hr = ScriptCacheGetHeight(hdc1, &sc, &height);
4043  ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
4044  ok(sc != NULL, "Script cache is NULL\n");
4045 
4046  /* Same font, same DC -> same SCRIPT_CACHE */
4047  sc2 = NULL;
4048  hr = ScriptCacheGetHeight(hdc1, &sc2, &height);
4049  ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
4050  ok(sc2 != NULL, "Script cache is NULL\n");
4051  ok(sc == sc2, "Expected caches %p, %p to be identical\n", sc, sc2);
4052  ScriptFreeCache(&sc2);
4053 
4054  /* Same font in different DC -> same SCRIPT_CACHE */
4055  sc2 = NULL;
4056  hr = ScriptCacheGetHeight(hdc2, &sc2, &height);
4057  ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
4058  ok(sc2 != NULL, "Script cache is NULL\n");
4059  ok(sc == sc2, "Expected caches %p, %p to be identical\n", sc, sc2);
4060  ScriptFreeCache(&sc2);
4061 
4062  /* Same font face & size, but different font handle */
4063  ok(SelectObject(hdc1, hfont2) != NULL, "SelectObject failed\n");
4064  ok(SelectObject(hdc2, hfont2) != NULL, "SelectObject failed\n");
4065 
4066  sc2 = NULL;
4067  hr = ScriptCacheGetHeight(hdc1, &sc2, &height);
4068  ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
4069  ok(sc2 != NULL, "Script cache is NULL\n");
4070  ok(sc == sc2, "Expected caches %p, %p to be identical\n", sc, sc2);
4071  ScriptFreeCache(&sc2);
4072 
4073  sc2 = NULL;
4074  hr = ScriptCacheGetHeight(hdc2, &sc2, &height);
4075  ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
4076  ok(sc2 != NULL, "Script cache is NULL\n");
4077  ok(sc == sc2, "Expected caches %p, %p to be identical\n", sc, sc2);
4078  ScriptFreeCache(&sc2);
4079 
4080  /* Different font size -- now we get a different SCRIPT_CACHE */
4081  SelectObject(hdc1, prev_hfont1);
4082  SelectObject(hdc2, prev_hfont2);
4083  DeleteObject(hfont2);
4084  lf.lfHeight = 20;
4085  hfont2 = CreateFontIndirectA(&lf);
4086  ok(hfont2 != NULL, "CreateFontIndirectA failed\n");
4087  ok(SelectObject(hdc1, hfont2) != NULL, "SelectObject failed\n");
4088  ok(SelectObject(hdc2, hfont2) != NULL, "SelectObject failed\n");
4089 
4090  sc2 = NULL;
4091  hr = ScriptCacheGetHeight(hdc1, &sc2, &height);
4092  ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
4093  ok(sc2 != NULL, "Script cache is NULL\n");
4094  ok(sc != sc2, "Expected caches %p, %p to be different\n", sc, sc2);
4095  ScriptFreeCache(&sc2);
4096 
4097  sc2 = NULL;
4098  hr = ScriptCacheGetHeight(hdc2, &sc2, &height);
4099  ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
4100  ok(sc2 != NULL, "Script cache is NULL\n");
4101  ok(sc != sc2, "Expected caches %p, %p to be different\n", sc, sc2);
4102  ScriptFreeCache(&sc2);
4103 
4104  ScriptFreeCache(&sc);
4105  SelectObject(hdc1, prev_hfont1);
4106  SelectObject(hdc2, prev_hfont2);
4107  DeleteObject(hfont1);
4108  DeleteObject(hfont2);
4109  DestroyWindow(hwnd1);
4110  DestroyWindow(hwnd2);
4111 }
HRESULT hr
Definition: shlfolder.c:183
HDC WINAPI GetDC(_In_opt_ HWND)
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
BOOL WINAPI DestroyWindow(_In_ HWND)
HDC hdc2
Definition: SelectObject.c:10
long LONG
Definition: pedump.c:60
LONG lfHeight
Definition: dimm.idl:42
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
HDC hdc1
Definition: SelectObject.c:10
LONG HRESULT
Definition: typedefs.h:77
LOGFONTA * lf
Definition: font.c:2789
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
static HWND create_test_window(void)
Definition: usp10.c:3319
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define S_OK
Definition: intsafe.h:59
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *psc)
Definition: usp10.c:1078
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
#define memset(x, y, z)
Definition: compat.h:39
HRESULT WINAPI ScriptCacheGetHeight(HDC hdc, SCRIPT_CACHE *psc, LONG *height)
Definition: usp10.c:3675

Referenced by START_TEST().

◆ test_ScriptBreak()

static void test_ScriptBreak ( void  )
static

Definition at line 3654 of file usp10.c.

3655 {
3656  static const WCHAR test[] = {' ','\r','\n',0};
3657  SCRIPT_ITEM items[4];
3658  SCRIPT_LOGATTR la;
3659  HRESULT hr;
3660 
3661  hr = ScriptItemize(test, 3, 4, NULL, NULL, items, NULL);
3662  ok(hr == S_OK, "ScriptItemize should return S_OK not %08x\n", hr);
3663 
3664  /*
3665  * This Test crashes pre Vista.
3666 
3667  hr = ScriptBreak(test, 1, &items[0].a, NULL);
3668  ok(hr == E_INVALIDARG, "ScriptBreak should return E_INVALIDARG not %08x\n", hr);
3669  */
3670 
3671  hr = ScriptBreak(test, 0, &items[0].a, &la);
3672  ok(hr == E_FAIL || broken(hr == S_OK), "ScriptBreak should return E_FAIL not %08x\n", hr);
3673 
3674  hr = ScriptBreak(test, -1, &items[0].a, &la);
3675  ok(hr == E_INVALIDARG || broken(hr == S_OK), "ScriptBreak should return E_INVALIDARG not %08x\n", hr);
3676 
3677  memset(&la, 0, sizeof(la));
3678  hr = ScriptBreak(test, 1, &items[0].a, &la);
3679  ok(hr == S_OK, "ScriptBreak should return S_OK not %08x\n", hr);
3680 
3681  ok(!la.fSoftBreak, "fSoftBreak set\n");
3682  ok(la.fWhiteSpace, "fWhiteSpace not set\n");
3683  ok(la.fCharStop, "fCharStop not set\n");
3684  ok(!la.fWordStop, "fWordStop set\n");
3685  ok(!la.fInvalid, "fInvalid set\n");
3686  ok(!la.fReserved, "fReserved set\n");
3687 
3688  memset(&la, 0, sizeof(la));
3689  hr = ScriptBreak(test + 1, 1, &items[1].a, &la);
3690  ok(hr == S_OK, "ScriptBreak should return S_OK not %08x\n", hr);
3691 
3692  ok(!la.fSoftBreak, "fSoftBreak set\n");
3693  ok(!la.fWhiteSpace, "fWhiteSpace set\n");
3694  ok(la.fCharStop, "fCharStop not set\n");
3695  ok(!la.fWordStop, "fWordStop set\n");
3696  ok(!la.fInvalid, "fInvalid set\n");
3697  ok(!la.fReserved, "fReserved set\n");
3698 
3699  memset(&la, 0, sizeof(la));
3700  hr = ScriptBreak(test + 2, 1, &items[2].a, &la);
3701  ok(hr == S_OK, "ScriptBreak should return S_OK not %08x\n", hr);
3702 
3703  ok(!la.fSoftBreak, "fSoftBreak set\n");
3704  ok(!la.fWhiteSpace, "fWhiteSpace set\n");
3705  ok(la.fCharStop, "fCharStop not set\n");
3706  ok(!la.fWordStop, "fWordStop set\n");
3707  ok(!la.fInvalid, "fInvalid set\n");
3708  ok(!la.fReserved, "fReserved set\n");
3709 }
HRESULT hr
Definition: shlfolder.c:183
#define test
Definition: rosglue.h:37
#define E_FAIL
Definition: ddrawi.h:102
#define ok(value,...)
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
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:1851
#define broken(x)
Definition: _sntprintf.h:21
#define S_OK
Definition: intsafe.h:59
BYTE fWhiteSpace
Definition: usp10.h:188
HRESULT WINAPI ScriptBreak(const WCHAR *chars, int count, const SCRIPT_ANALYSIS *sa, SCRIPT_LOGATTR *la)
Definition: usp10.c:3045
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
static TCHAR * items[]
Definition: page1.c:45
#define memset(x, y, z)
Definition: compat.h:39

Referenced by START_TEST().

◆ test_ScriptCacheGetHeight()

static void test_ScriptCacheGetHeight ( HDC  hdc)
static

Definition at line 3330 of file usp10.c.

3331 {
3332  HFONT hfont, prev_hfont;
3333  SCRIPT_CACHE sc = NULL;
3334  LONG height, height2;
3335  TEXTMETRICW tm;
3336  LOGFONTA lf;
3337  HRESULT hr;
3338  HWND hwnd;
3339  HDC hdc2;
3340 
3342  ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr);
3343 
3344  hr = ScriptCacheGetHeight(NULL, &sc, NULL);
3345  ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr);
3346 
3347  hr = ScriptCacheGetHeight(NULL, &sc, &height);
3348  ok(hr == E_PENDING, "expected E_PENDING, got 0x%08x\n", hr);
3349 
3350  height = 123;
3352  ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
3353  ok(height == 123, "Unexpected height.\n");
3354 
3355  memset(&tm, 0, sizeof(tm));
3356  GetTextMetricsW(hdc, &tm);
3357  ok(tm.tmHeight > 0, "Unexpected tmHeight %u.\n", tm.tmHeight);
3358 
3359  height = 0;
3360  hr = ScriptCacheGetHeight(hdc, &sc, &height);
3361  ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
3362  ok(height == tm.tmHeight, "expected height > 0\n");
3363 
3364  /* Try again with NULL dc. */
3365  height2 = 0;
3366  hr = ScriptCacheGetHeight(NULL, &sc, &height2);
3367  ok(hr == S_OK, "Failed to get cached height, hr %#x.\n", hr);
3368  ok(height2 == height, "Unexpected height %u.\n", height2);
3369 
3371 
3372  hdc2 = GetDC(hwnd);
3373  ok(hdc2 != NULL, "Failed to get window dc.\n");
3374 
3375  memset(&lf, 0, sizeof(LOGFONTA));
3376  lstrcpyA(lf.lfFaceName, "Tahoma");
3377  lf.lfHeight = -32;
3378 
3380  ok(hfont != NULL, "Failed to create font.\n");
3381 
3382  prev_hfont = SelectObject(hdc2, hfont);
3383 
3384  memset(&tm, 0, sizeof(tm));
3385  GetTextMetricsW(hdc2, &tm);
3386  ok(tm.tmHeight > height, "Unexpected tmHeight %u.\n", tm.tmHeight);
3387 
3388  height2 = 0;
3389  hr = ScriptCacheGetHeight(hdc2, &sc, &height2);
3390  ok(hr == S_OK, "Failed to get cached height, hr %#x.\n", hr);
3391  ok(height2 == height, "Unexpected height.\n");
3392 
3393  SelectObject(hdc2, prev_hfont);
3395 
3396  ReleaseDC(hwnd, hdc2);
3398 
3399  ScriptFreeCache(&sc);
3400 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
HRESULT hr
Definition: shlfolder.c:183
HDC WINAPI GetDC(_In_opt_ HWND)
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
BOOL WINAPI DestroyWindow(_In_ HWND)
HDC hdc2
Definition: SelectObject.c:10
long LONG
Definition: pedump.c:60
LONG lfHeight
Definition: dimm.idl:42
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define ok(value,...)
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static HFONT hfont
LONG HRESULT
Definition: typedefs.h:77
LOGFONTA * lf
Definition: font.c:2789
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
HDC hdc
Definition: main.c:9
Definition: time.h:76
static HWND create_test_window(void)
Definition: usp10.c:3319
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define S_OK
Definition: intsafe.h:59
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *psc)
Definition: usp10.c:1078
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
#define E_PENDING
Definition: dinput.h:172
#define memset(x, y, z)
Definition: compat.h:39
HRESULT WINAPI ScriptCacheGetHeight(HDC hdc, SCRIPT_CACHE *psc, LONG *height)
Definition: usp10.c:3675

Referenced by START_TEST().

◆ test_ScriptGetCMap()

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

Definition at line 2307 of file usp10.c.

2308 {
2309  HRESULT hr;
2310  SCRIPT_CACHE psc = NULL;
2311  int cInChars;
2312  int cChars;
2313  unsigned short pwOutGlyphs2[256];
2314  unsigned short pwOutGlyphs3[256];
2315  DWORD dwFlags;
2316  int cnt;
2317 
2318  static const WCHAR TestItem1[] = {'T', 'e', 's', 't', 'a', 0};
2319  static const WCHAR TestItem2[] = {0x202B, 'i', 'n', 0x202C,0};
2320  static const WCHAR TestItem3[] = {'a','b','c','d','(','<','{','[',0x2039,0};
2321  static const WCHAR TestItem3b[] = {'a','b','c','d',')','>','}',']',0x203A,0};
2322 
2323  /* Check to make sure that SCRIPT_CACHE gets allocated ok */
2324  dwFlags = 0;
2325  cInChars = cChars = 5;
2326  /* Some sanity checks for ScriptGetCMap */
2327 
2328  hr = ScriptGetCMap(NULL, NULL, NULL, 0, 0, NULL);
2329  ok( hr == E_INVALIDARG, "(NULL,NULL,NULL,0,0,NULL), "
2330  "expected E_INVALIDARG, got %08x\n", hr);
2331 
2332  hr = ScriptGetCMap(NULL, NULL, TestItem1, cInChars, dwFlags, pwOutGlyphs3);
2333  ok( hr == E_INVALIDARG, "(NULL,NULL,TestItem1, cInChars, dwFlags, pwOutGlyphs3), "
2334  "expected E_INVALIDARG, got %08x\n", hr);
2335 
2336  /* Set psc to NULL, to be able to check if a pointer is returned in psc */
2337  psc = NULL;
2338  hr = ScriptGetCMap(NULL, &psc, TestItem1, cInChars, 0, pwOutGlyphs3);
2339  ok( hr == E_PENDING, "(NULL,&psc,NULL,0,0,NULL), expected E_PENDING, "
2340  "got %08x\n", hr);
2341  ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
2342 
2343  /* Set psc to NULL but add hdc, to be able to check if a pointer is returned in psc */
2344  psc = NULL;
2345  hr = ScriptGetCMap(hdc, &psc, TestItem1, cInChars, 0, pwOutGlyphs3);
2346  ok( hr == S_OK, "ScriptGetCMap(NULL,&psc,NULL,0,0,NULL), expected S_OK, "
2347  "got %08x\n", hr);
2348  ok( psc != NULL, "ScritpGetCMap expected psc to be not NULL\n");
2349  ScriptFreeCache( &psc);
2350 
2351  /* Set psc to NULL, to be able to check if a pointer is returned in psc */
2352  psc = NULL;
2353  hr = ScriptGetCMap(NULL, &psc, TestItem1, cInChars, dwFlags, pwOutGlyphs3);
2354  ok( hr == E_PENDING, "(NULL,&psc,), expected E_PENDING, got %08x\n", hr);
2355  ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
2356  /* Check to see if the results are the same as those returned by ScriptShape */
2357  hr = ScriptGetCMap(hdc, &psc, TestItem1, cInChars, dwFlags, pwOutGlyphs3);
2358  ok (hr == S_OK, "ScriptGetCMap should return S_OK not (%08x)\n", hr);
2359  ok (psc != NULL, "psc should not be null and have SCRIPT_CACHE buffer address\n");
2360  for (cnt=0; cnt < cChars && pwOutGlyphs[cnt] == pwOutGlyphs3[cnt]; cnt++) {}
2361  ok (cnt == cInChars, "Translation not correct. WCHAR %d - %04x != %04x\n",
2362  cnt, pwOutGlyphs[cnt], pwOutGlyphs3[cnt]);
2363 
2364  ScriptFreeCache( &psc);
2365  ok (!psc, "psc is not null after ScriptFreeCache\n");
2366 
2367  /* ScriptGetCMap returns whatever font defines, no special treatment for control chars */
2368  cInChars = cChars = 4;
2369  GetGlyphIndicesW(hdc, TestItem2, cInChars, pwOutGlyphs2, 0);
2370 
2371  hr = ScriptGetCMap(hdc, &psc, TestItem2, cInChars, dwFlags, pwOutGlyphs3);
2372  if (pwOutGlyphs3[0] == 0 || pwOutGlyphs3[3] == 0)
2373  ok(hr == S_FALSE, "ScriptGetCMap should return S_FALSE not (%08x)\n", hr);
2374  else
2375  ok(hr == S_OK, "ScriptGetCMap should return S_OK not (%08x)\n", hr);
2376 
2377  ok(psc != NULL, "psc should not be null and have SCRIPT_CACHE buffer address\n");
2378  ok(pwOutGlyphs3[0] == pwOutGlyphs2[0], "expected glyph %d, got %d\n", pwOutGlyphs2[0], pwOutGlyphs3[0]);
2379  ok(pwOutGlyphs3[3] == pwOutGlyphs2[3], "expected glyph %d, got %d\n", pwOutGlyphs2[3], pwOutGlyphs3[3]);
2380 
2381  cInChars = cChars = 9;
2382  hr = ScriptGetCMap(hdc, &psc, TestItem3b, cInChars, dwFlags, pwOutGlyphs2);
2383  ok (hr == S_OK, "ScriptGetCMap should return S_OK not (%08x)\n", hr);
2384  ok (psc != NULL, "psc should not be null and have SCRIPT_CACHE buffer address\n");
2385 
2386  cInChars = cChars = 9;
2387  dwFlags = SGCM_RTL;
2388  hr = ScriptGetCMap(hdc, &psc, TestItem3, cInChars, dwFlags, pwOutGlyphs3);
2389  ok (hr == S_OK, "ScriptGetCMap should return S_OK not (%08x)\n", hr);
2390  ok (psc != NULL, "psc should not be null and have SCRIPT_CACHE buffer address\n");
2391  ok(pwOutGlyphs3[0] == pwOutGlyphs2[0], "glyph incorrectly altered\n");
2392  ok(pwOutGlyphs3[1] == pwOutGlyphs2[1], "glyph incorrectly altered\n");
2393  ok(pwOutGlyphs3[2] == pwOutGlyphs2[2], "glyph incorrectly altered\n");
2394  ok(pwOutGlyphs3[3] == pwOutGlyphs2[3], "glyph incorrectly altered\n");
2395  ok(pwOutGlyphs3[4] == pwOutGlyphs2[4], "glyph not mirrored correctly\n");
2396  ok(pwOutGlyphs3[5] == pwOutGlyphs2[5], "glyph not mirrored correctly\n");
2397  ok(pwOutGlyphs3[6] == pwOutGlyphs2[6], "glyph not mirrored correctly\n");
2398  ok(pwOutGlyphs3[7] == pwOutGlyphs2[7], "glyph not mirrored correctly\n");
2399  ok(pwOutGlyphs3[8] == pwOutGlyphs2[8], "glyph not mirrored correctly\n");
2400 
2401  ScriptFreeCache( &psc);
2402  ok (!psc, "psc is not null after ScriptFreeCache\n");
2403 }
HRESULT hr
Definition: shlfolder.c:183
static int cInChars
Definition: usp10.c:62
#define ok(value,...)
#define S_FALSE
Definition: winerror.h:2357
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
HDC hdc
Definition: main.c:9
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define SGCM_RTL
Definition: usp10.h:61
HRESULT WINAPI ScriptGetCMap(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcInChars, int cChars, DWORD dwFlags, WORD *pwOutGlyphs)
Definition: usp10.c:3534
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
#define S_OK
Definition: intsafe.h:59
static SCRIPT_CACHE * psc
Definition: usp10.c:64
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *psc)
Definition: usp10.c:1078
#define E_PENDING
Definition: dinput.h:172

Referenced by START_TEST().

◆ test_ScriptGetFontFunctions()

static void test_ScriptGetFontFunctions ( HDC  hdc)
static

Definition at line 3748 of file usp10.c.

3749 {
3750  static const WCHAR test_phagspa[] = {0xa84f, 0xa861, 0xa843, 0x0020, 0xa863, 0xa861, 0xa859,
3751  0x0020, 0xa850, 0xa85c, 0xa85e};
3752  SCRIPT_CONTROL control;
3753  SCRIPT_CACHE sc = NULL;
3754  SCRIPT_ITEM items[15];
3755  OPENTYPE_TAG tags[5];
3757  int count = 0;
3758  HRESULT hr;
3759 
3760  if (!pScriptGetFontScriptTags || !pScriptGetFontLanguageTags || !pScriptGetFontFeatureTags)
3761  {
3762  win_skip("ScriptGetFontScriptTags, ScriptGetFontLanguageTags or "
3763  "ScriptGetFontFeatureTags not available on this platform.\n");
3764  return;
3765  }
3766 
3767  hr = pScriptGetFontScriptTags(hdc, &sc, NULL, 0, NULL, NULL);
3768  ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3769  ok(!sc, "Got unexpected script cache %p.\n", sc);
3770  hr = pScriptGetFontScriptTags(hdc, &sc, NULL, 0, NULL, &count);
3771  ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3772  ok(!sc, "Got unexpected script cache %p.\n", sc);
3773  hr = pScriptGetFontScriptTags(hdc, &sc, NULL, ARRAY_SIZE(tags), tags, NULL);
3774  ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3775  ok(!sc, "Got unexpected script cache %p.\n", sc);
3776  hr = pScriptGetFontScriptTags(hdc, &sc, NULL, 0, tags, &count);
3777  ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3778  ok(!sc, "Got unexpected script cache %p.\n", sc);
3779  hr = pScriptGetFontScriptTags(NULL, &sc, NULL, ARRAY_SIZE(tags), tags, &count);
3780  ok(hr == E_PENDING, "Got unexpected hr %#x.\n", hr);
3781  ok(!sc, "Got unexpected script cache %p.\n", sc);
3782  hr = pScriptGetFontScriptTags(hdc, &sc, NULL, ARRAY_SIZE(tags), tags, &count);
3783  ok(hr == S_OK || hr == E_OUTOFMEMORY, "Got unexpected hr %#x.\n", hr);
3784  if (hr == S_OK)
3785  ok(count <= 5, "Got unexpected count %d.\n", count);
3786  else
3787  ok(!count, "Got unexpected count %d.\n", count);
3788  ok(!!sc, "Got unexpected script cache %p.\n", sc);
3789 
3790  ScriptFreeCache(&sc);
3791  sc = NULL;
3792 
3793  hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, 0, NULL, NULL);
3794  ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3795  ok(!sc, "Got unexpected script cache %p.\n", sc);
3796  hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, 0, NULL, &count);
3797  ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3798  ok(!sc, "Got unexpected script cache %p.\n", sc);
3799  hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, ARRAY_SIZE(tags), tags, NULL);
3800  ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3801  ok(!sc, "Got unexpected script cache %p.\n", sc);
3802  hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, 0, tags, &count);
3803  ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3804  ok(!sc, "Got unexpected script cache %p.\n", sc);
3805  hr = pScriptGetFontLanguageTags(NULL, &sc, NULL, latn_tag, ARRAY_SIZE(tags), tags, &count);
3806  ok(hr == E_PENDING, "Got unexpected hr %#x.\n", hr);
3807  ok(!sc, "Got unexpected script cache %p.\n", sc);
3808  hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, latn_tag, ARRAY_SIZE(tags), tags, &count);
3809  ok(hr == S_OK || hr == E_OUTOFMEMORY, "Got unexpected hr %#x.\n", hr);
3810  if (hr == S_OK)
3811  ok(count <= 5, "Got unexpected count %d.\n", count);
3812  else
3813  ok(!count, "Got unexpected count %d.\n", count);
3814 
3815  ScriptFreeCache(&sc);
3816  sc = NULL;
3817 
3818  hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, 0, NULL, NULL);
3819  ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3820  ok(!sc, "Got unexpected script cache %p.\n", sc);
3821  hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, 0, NULL, &count);
3822  ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3823  ok(!sc, "Got unexpected script cache %p.\n", sc);
3824  hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, ARRAY_SIZE(tags), tags, NULL);
3825  ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3826  ok(!sc, "Got unexpected script cache %p.\n", sc);
3827  hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, 0, tags, &count);
3828  ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
3829  ok(!sc, "Got unexpected script cache %p.\n", sc);
3830  hr = pScriptGetFontFeatureTags(NULL, &sc, NULL, latn_tag, 0x0, ARRAY_SIZE(tags), tags, &count);
3831  ok(hr == E_PENDING, "Got unexpected hr %#x.\n", hr);
3832  ok(!sc, "Got unexpected script cache %p.\n", sc);
3833  hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, latn_tag, 0x0, ARRAY_SIZE(tags), tags, &count);
3834  ok(hr == S_OK || hr == E_OUTOFMEMORY, "Got unexpected hr %#x.\n", hr);
3835  if (hr == S_OK)
3836  ok(count <= 5, "Got unexpected count %d.\n", count);
3837  else
3838  ok(!count, "Got unexpected count %d.\n", count);
3839 
3840  memset(&control, 0, sizeof(control));
3841  memset(&state, 0, sizeof(state));
3842 
3843  hr = ScriptItemize(test_phagspa, ARRAY_SIZE(test_phagspa), ARRAY_SIZE(items),
3844  &control, &state, items, &count);
3845  ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
3846  memset(tags, 0, sizeof(tags));
3847  hr = pScriptGetFontScriptTags(hdc, &sc, &items[0].a, ARRAY_SIZE(tags), tags, &count);
3848  ok(hr == USP_E_SCRIPT_NOT_IN_FONT || broken(hr == S_OK), "Got unexpected hr %#x.\n", hr);
3849 
3850  hr = pScriptGetFontLanguageTags(hdc, &sc, NULL, dsrt_tag, ARRAY_SIZE(tags), tags, &count);
3851  ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
3852  hr = pScriptGetFontLanguageTags(hdc, &sc, &items[0].a, dsrt_tag, ARRAY_SIZE(tags), tags, &count);
3853  ok(hr == E_INVALIDARG || broken(hr == S_OK), "Got unexpected hr %#x.\n", hr);
3854 
3855  hr = pScriptGetFontFeatureTags(hdc, &sc, NULL, dsrt_tag, 0x0, ARRAY_SIZE(tags), tags, &count);
3856  ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
3857  hr = pScriptGetFontFeatureTags(hdc, &sc, &items[0].a, dsrt_tag, 0x0, ARRAY_SIZE(tags), tags, &count);
3858  ok(hr == E_INVALIDARG || broken(hr == S_OK), "Got unexpected hr %#x.\n", hr);
3859 
3860  ScriptFreeCache(&sc);
3861 }
#define dsrt_tag
Definition: usp10.c:176
const char * tags[7 *8]
Definition: apphelp.c:213
#define USP_E_SCRIPT_NOT_IN_FONT
Definition: usp10.h:71
HRESULT hr
Definition: shlfolder.c:183
GLint x0
Definition: linetemp.h:95
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define ok(value,...)
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define latn_tag
Definition: usp10.c:142
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
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:1851
HDC hdc
Definition: main.c:9
static int state
Definition: maze.c:121
#define broken(x)
Definition: _sntprintf.h:21
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *psc)
Definition: usp10.c:1078
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define E_PENDING
Definition: dinput.h:172
static TCHAR * items[]
Definition: page1.c:45
#define memset(x, y, z)
Definition: compat.h:39
#define win_skip
Definition: test.h:141
ULONG OPENTYPE_TAG
Definition: usp10.h:205

Referenced by START_TEST().

◆ test_ScriptGetFontProperties()

static void test_ScriptGetFontProperties ( HDC  hdc)
static

Definition at line 2445 of file usp10.c.

2446 {
2447  HRESULT hr;
2448  SCRIPT_CACHE psc,old_psc;
2450  HFONT font, oldfont;
2451  LOGFONTA lf;
2452  struct enum_font_data efnd;
2453  TEXTMETRICA tmA;
2454  WORD gi[3];
2455  WCHAR str[3];
2456  DWORD i, ret;
2458  static const WCHAR invalids[] = {0x0020, 0x200B, 0xF71B};
2459  /* U+0020: numeric space
2460  U+200B: zero width space
2461  U+F71B: unknown, found by black box testing */
2462  BOOL is_arial, is_times_new_roman, is_arabic = (system_lang_id == LANG_ARABIC);
2463 
2464  /* Some sanity checks for ScriptGetFontProperties */
2465 
2467  ok( hr == E_INVALIDARG, "(NULL,NULL,NULL), expected E_INVALIDARG, got %08x\n", hr);
2468 
2470  ok( hr == E_INVALIDARG, "(NULL,NULL,&sfp), expected E_INVALIDARG, got %08x\n", hr);
2471 
2472  /* Set psc to NULL, to be able to check if a pointer is returned in psc */
2473  psc = NULL;
2475  ok( hr == E_INVALIDARG, "(NULL,&psc,NULL), expected E_INVALIDARG, got %08x\n", hr);
2476  ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
2477 
2478  /* Set psc to NULL, to be able to check if a pointer is returned in psc */
2479  psc = NULL;
2481  ok( hr == E_PENDING, "(NULL,&psc,&sfp), expected E_PENDING, got %08x\n", hr);
2482  ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
2483 
2485  ok( hr == E_INVALIDARG, "(hdc,NULL,NULL), expected E_INVALIDARG, got %08x\n", hr);
2486 
2488  ok( hr == E_INVALIDARG, "(hdc,NULL,&sfp), expected E_INVALIDARG, got %08x\n", hr);
2489 
2490  /* Set psc to NULL, to be able to check if a pointer is returned in psc */
2491  psc = NULL;
2493  ok( hr == E_INVALIDARG, "(hdc,&psc,NULL), expected E_INVALIDARG, got %08x\n", hr);
2494  ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
2495 
2496  /* Pass an invalid sfp */
2497  psc = NULL;
2498  sfp.cBytes = sizeof(SCRIPT_FONTPROPERTIES) - 1;
2499  hr = ScriptGetFontProperties(hdc,&psc,&sfp);
2500  ok( hr == E_INVALIDARG, "(hdc,&psc,&sfp) invalid, expected E_INVALIDARG, got %08x\n", hr);
2501  ok( psc != NULL, "Expected a pointer in psc, got NULL\n");
2502  ok( sfp.cBytes == sizeof(SCRIPT_FONTPROPERTIES) - 1, "Unexpected cBytes.\n");
2503  ScriptFreeCache(&psc);
2504  ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
2505 
2506  /* Give it the correct cBytes, we don't care about what's coming back */
2507  sfp.cBytes = sizeof(SCRIPT_FONTPROPERTIES);
2508  psc = NULL;
2509  hr = ScriptGetFontProperties(hdc,&psc,&sfp);
2510  ok( hr == S_OK, "(hdc,&psc,&sfp) partly initialized, expected S_OK, got %08x\n", hr);
2511  ok( psc != NULL, "Expected a pointer in psc, got NULL\n");
2512 
2513  /* Save the psc pointer */
2514  old_psc = psc;
2515  /* Now a NULL hdc again */
2517  ok( hr == S_OK, "(NULL,&psc,&sfp), expected S_OK, got %08x\n", hr);
2518  ok( psc == old_psc, "Expected psc not to be changed, was %p is now %p\n", old_psc, psc);
2519  ScriptFreeCache(&psc);
2520  ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
2521 
2522  memset(&lf, 0, sizeof(lf));
2524  efnd.total = 0;
2526 
2527  for (i = 0; i < efnd.total; i++)
2528  {
2529  if (strlen((char *)efnd.elf[i].elfFullName) >= LF_FACESIZE)
2530  {
2531  trace("Font name to long to test: %s\n",(char *)efnd.elf[i].elfFullName);
2532  continue;
2533  }
2534  lstrcpyA(lf.lfFaceName, (char *)efnd.elf[i].elfFullName);
2536  oldfont = SelectObject(hdc, font);
2537 
2538  sfp.cBytes = sizeof(SCRIPT_FONTPROPERTIES);
2539  psc = NULL;
2540  hr = ScriptGetFontProperties(hdc, &psc, &sfp);
2541  ok(hr == S_OK, "ScriptGetFontProperties expected S_OK, got %08x\n", hr);
2543  {
2544  trace("bitmap font %s\n", lf.lfFaceName);
2545  trace("wgBlank %04x\n", sfp.wgBlank);
2546  trace("wgDefault %04x\n", sfp.wgDefault);
2547  trace("wgInvalid %04x\n", sfp.wgInvalid);
2548  trace("wgKashida %04x\n", sfp.wgKashida);
2549  trace("iKashidaWidth %d\n", sfp.iKashidaWidth);
2550  }
2551 
2552  ret = GetTextMetricsA(hdc, &tmA);
2553  ok(ret != 0, "GetTextMetricsA failed!\n");
2554 
2555  ret = GetGlyphIndicesW(hdc, invalids, 1, gi, GGI_MARK_NONEXISTING_GLYPHS);
2556  ok(ret != GDI_ERROR, "GetGlyphIndicesW failed!\n");
2557 
2558  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]);
2559 
2560  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);
2561 
2562  ok(sfp.wgInvalid == sfp.wgBlank || broken(is_arabic), "bitmap font %s wgInvalid %02x wgBlank %02x\n", lf.lfFaceName, sfp.wgInvalid, sfp.wgBlank);
2563 
2564  ok(sfp.wgKashida == 0xFFFF || broken(is_arabic), "bitmap font %s wgKashida %02x\n", lf.lfFaceName, sfp.wgKashida);
2565 
2566  ScriptFreeCache(&psc);
2567 
2568  SelectObject(hdc, oldfont);
2569  DeleteObject(font);
2570  }
2571 
2572  efnd.total = 0;
2574 
2575  for (i = 0; i < efnd.total; i++)
2576  {
2577  if (strlen((char *)efnd.elf[i].elfFullName) >= LF_FACESIZE)
2578  {
2579  trace("Font name to long to test: %s\n",(char *)efnd.elf[i].elfFullName);
2580  continue;
2581  }
2582  lstrcpyA(lf.lfFaceName, (char *)efnd.elf[i].elfFullName);
2584  oldfont = SelectObject(hdc, font);
2585 
2586  sfp.cBytes = sizeof(SCRIPT_FONTPROPERTIES);
2587  psc = NULL;
2588  hr = ScriptGetFontProperties(hdc, &psc, &sfp);
2589  ok(hr == S_OK, "ScriptGetFontProperties expected S_OK, got %08x\n", hr);
2591  {
2592  trace("truetype font %s\n", lf.lfFaceName);
2593  trace("wgBlank %04x\n", sfp.wgBlank);
2594  trace("wgDefault %04x\n", sfp.wgDefault);
2595  trace("wgInvalid %04x\n", sfp.wgInvalid);
2596  trace("wgKashida %04x\n", sfp.wgKashida);
2597  trace("iKashidaWidth %d\n", sfp.iKashidaWidth);
2598  }
2599 
2600  str[0] = 0x0020; /* U+0020: numeric space */
2601  ret = GetGlyphIndicesW(hdc, str, 1, gi, 0);
2602  ok(ret != GDI_ERROR, "GetGlyphIndicesW failed!\n");
2603  ok(sfp.wgBlank == gi[0], "truetype font %s wgBlank %04x gi[0] %04x\n", lf.lfFaceName, sfp.wgBlank, gi[0]);
2604 
2605  ok(sfp.wgDefault == 0 || broken(is_arabic), "truetype font %s wgDefault %04x\n", lf.lfFaceName, sfp.wgDefault);
2606 
2607  ret = GetGlyphIndicesW(hdc, invalids, 3, gi, GGI_MARK_NONEXISTING_GLYPHS);
2608  ok(ret != GDI_ERROR, "GetGlyphIndicesW failed!\n");
2609  if (gi[2] != 0xFFFF) /* index of default non exist char */
2610  ok(sfp.wgInvalid == gi[2], "truetype font %s wgInvalid %04x gi[2] %04x\n", lf.lfFaceName, sfp.wgInvalid, gi[2]);
2611  else if (gi[1] != 0xFFFF)
2612  ok(sfp.wgInvalid == gi[1], "truetype font %s wgInvalid %04x gi[1] %04x\n", lf.lfFaceName, sfp.wgInvalid, gi[1]);
2613  else if (gi[0] != 0xFFFF)
2614  ok(sfp.wgInvalid == gi[0], "truetype font %s wgInvalid %04x gi[0] %04x\n", lf.lfFaceName, sfp.wgInvalid, gi[0]);
2615  else
2616  ok(sfp.wgInvalid == 0, "truetype font %s wgInvalid %04x expect 0\n", lf.lfFaceName, sfp.wgInvalid);
2617 
2618  str[0] = 0x0640; /* U+0640: kashida */
2620  ok(ret != GDI_ERROR, "GetGlyphIndicesW failed!\n");
2621  is_arial = !lstrcmpA(lf.lfFaceName, "Arial");
2622  is_times_new_roman= !lstrcmpA(lf.lfFaceName, "Times New Roman");
2623  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]);
2624 
2625  ScriptFreeCache(&psc);
2626 
2627  SelectObject(hdc, oldfont);
2628  DeleteObject(font);
2629  }
2630 }
#define trace(...)
Definition: kmt_test.h:217
#define LF_FACESIZE
Definition: dimm.idl:39
HRESULT hr
Definition: shlfolder.c:183
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
Definition: mk_font.cpp:20
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
struct tag_SCRIPT_FONTPROPERTIES SCRIPT_FONTPROPERTIES
HRESULT WINAPI ScriptGetFontProperties(HDC hdc, SCRIPT_CACHE *psc, SCRIPT_FONTPROPERTIES *sfp)
Definition: usp10.c:1174
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
BYTE lfCharSet
Definition: dimm.idl:50
#define LANG_ARABIC
Definition: nls.h:29
int winetest_interactive
#define DEFAULT_CHARSET
Definition: wingdi.h:383
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
unsigned int BOOL
Definition: ntddk_ex.h:94
int WINAPI EnumFontFamiliesA(_In_ HDC, _In_opt_ LPCSTR, _In_ FONTENUMPROCA, _In_ LPARAM)
#define ok(value,...)
#define E_INVALIDARG
Definition: ddrawi.h:101
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
Definition: text.c:200
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
LANGID WINAPI GetSystemDefaultLangID(void)
Definition: lang.c:751
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
LOGFONTA * lf
Definition: font.c:2789
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
#define GGI_MARK_NONEXISTING_GLYPHS
Definition: wingdi.h:1067
int ret
HDC hdc
Definition: main.c:9
static INT CALLBACK enum_bitmap_font_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
Definition: usp10.c:2413
#define broken(x)
Definition: _sntprintf.h:21
#define S_OK
Definition: intsafe.h:59
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static INT CALLBACK enum_truetype_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
Definition: usp10.c:2429
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *psc)
Definition: usp10.c:1078
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
#define E_PENDING
Definition: dinput.h:172
#define GDI_ERROR
Definition: wingdi.h:1291
#define memset(x, y, z)
Definition: compat.h:39
static WORD system_lang_id
Definition: font.c:67
#define PRIMARYLANGID(l)
Definition: nls.h:16

Referenced by START_TEST().

◆ test_ScriptGetGlyphABCWidth()

static void test_ScriptGetGlyphABCWidth ( HDC  hdc)
static

Definition at line 3402 of file usp10.c.

3403 {
3404  HRESULT hr;
3405  SCRIPT_CACHE sc = NULL;
3406  HFONT hfont, prev_hfont;
3407  TEXTMETRICA tm;
3408  ABC abc, abc2;
3409  LOGFONTA lf;
3410  WORD glyph;
3411  INT width;
3412  DWORD ret;
3413 
3414  glyph = 0;
3415  ret = GetGlyphIndicesA(hdc, "a", 1, &glyph, 0);
3416  ok(ret == 1, "Failed to get glyph index.\n");
3417  ok(glyph != 0, "Unexpected glyph index.\n");
3418 
3419  hr = ScriptGetGlyphABCWidth(NULL, NULL, glyph, NULL);
3420  ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr);
3421 
3422  hr = ScriptGetGlyphABCWidth(NULL, &sc, glyph, NULL);
3423  ok(broken(hr == E_PENDING) ||
3424  hr == E_INVALIDARG, /* WIN7 */
3425  "expected E_INVALIDARG, got 0x%08x\n", hr);
3426 
3427  hr = ScriptGetGlyphABCWidth(NULL, &sc, glyph, &abc);
3428  ok(hr == E_PENDING, "expected E_PENDING, got 0x%08x\n", hr);
3429 
3430  if (0) { /* crashes on WinXP */
3431  hr = ScriptGetGlyphABCWidth(hdc, &sc, glyph, NULL);
3432  ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr);
3433  }
3434 
3435  hr = ScriptGetGlyphABCWidth(hdc, &sc, glyph, &abc);
3436  ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
3437  ok(abc.abcB != 0, "Unexpected width.\n");
3438 
3439  ret = GetCharABCWidthsI(hdc, glyph, 1, NULL, &abc2);
3440  ok(ret, "Failed to get char width.\n");
3441  ok(!memcmp(&abc, &abc2, sizeof(abc)), "Unexpected width.\n");
3442 
3443  ScriptFreeCache(&sc);
3444 
3445  /* Bitmap font */
3446  memset(&lf, 0, sizeof(lf));
3447  strcpy(lf.lfFaceName, "System");
3448  lf.lfHeight = 20;
3449 
3451  prev_hfont = SelectObject(hdc, hfont);
3452 
3453  ret = GetTextMetricsA(hdc, &tm);
3454  ok(ret, "Failed to get text metrics.\n");
3455  ok(!(tm.tmPitchAndFamily & TMPF_TRUETYPE), "Unexpected TrueType font.\n");
3456  ok(tm.tmPitchAndFamily & TMPF_FIXED_PITCH, "Unexpected fixed pitch font.\n");
3457 
3458  glyph = 0;
3459  ret = GetGlyphIndicesA(hdc, "i", 1, &glyph, 0);
3460  ok(ret == 1, "Failed to get glyph index.\n");
3461  ok(glyph != 0, "Unexpected glyph index.\n");
3462 
3463  sc = NULL;
3464  hr = ScriptGetGlyphABCWidth(hdc, &sc, glyph, &abc);
3465  ok(hr == S_OK, "Failed to get glyph width, hr %#x.\n", hr);
3466  ok(abc.abcB != 0, "Unexpected width.\n");
3467 
3468  ret = GetCharWidthI(hdc, glyph, 1, NULL, &width);
3469  ok(ret, "Failed to get char width.\n");
3470  abc2.abcA = abc2.abcC = 0;
3471  abc2.abcB = width;
3472  ok(!memcmp(&abc, &abc2, sizeof(abc)), "Unexpected width.\n");
3473 
3474  SelectObject(hdc, prev_hfont);
3476 
3477  ScriptFreeCache(&sc);
3478 }
GLint GLint GLsizei width
Definition: gl.h:1546
Definition: wingdi.h:1388
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
HRESULT hr
Definition: shlfolder.c:183
int abcC
Definition: wingdi.h:1391
DWORD WINAPI GetGlyphIndicesA(_In_ HDC hdc, _In_reads_(c) LPCSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
int32_t INT
Definition: typedefs.h:56
BOOL WINAPI GetCharABCWidthsI(_In_ HDC hdc, _In_ UINT giFirst, _In_ UINT cgi, _In_reads_opt_(cgi) LPWORD pgi, _Out_writes_(cgi) LPABC pabc)
#define TMPF_TRUETYPE
Definition: wingdi.h:1295
LONG lfHeight
Definition: dimm.idl:42
#define ok(value,...)
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
Definition: text.c:200
static HFONT hfont
UINT abcB
Definition: wingdi.h:1390
LONG HRESULT
Definition: typedefs.h:77
int abcA
Definition: wingdi.h:1389
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
LOGFONTA * lf
Definition: font.c:2789
int ret
HDC hdc
Definition: main.c:9
Definition: time.h:76
#define broken(x)
Definition: _sntprintf.h:21
#define S_OK
Definition: intsafe.h:59
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *psc)
Definition: usp10.c:1078
HRESULT WINAPI ScriptGetGlyphABCWidth(HDC hdc, SCRIPT_CACHE *psc, WORD glyph, ABC *abc)
Definition: usp10.c:3703
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
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_FIXED_PITCH
Definition: wingdi.h:1293
static UINT UINT LPWORD LPABC abc
Definition: font.c:44
#define E_PENDING
Definition: dinput.h:172
#define memset(x, y, z)
Definition: compat.h:39

Referenced by START_TEST().

◆ test_ScriptGetLogicalWidths()

static void test_ScriptGetLogicalWidths ( void  )
static

Definition at line 3887 of file usp10.c.

3888 {
3889  SCRIPT_ANALYSIS sa = { 0 };
3890  unsigned int i, j;
3891 
3892  for (i = 0; i < ARRAY_SIZE(logical_width_tests); ++i)
3893  {
3894  const struct logical_width_test *ptr = logical_width_tests + i;
3895  SCRIPT_VISATTR attrs[3];
3896  int widths[3];
3897  HRESULT hr;
3898 
3899  memset(attrs, 0, sizeof(attrs));
3900  for (j = 0; j < ptr->glyph_count; j++)
3901  {
3902  attrs[j].fClusterStart = ptr->clusterstart[j];
3903  attrs[j].fDiacritic = ptr->diacritic[j];
3904  attrs[j].fZeroWidth = ptr->zerowidth[j];
3905  }
3906 
3907  hr = ScriptGetLogicalWidths(&sa, ptr->char_count, ptr->glyph_count, ptr->advances, ptr->map, attrs, widths);
3908  ok(hr == S_OK, "got 0x%08x\n", hr);
3909 
3910  todo_wine_if(ptr->todo)
3911  ok(!memcmp(ptr->widths, widths, sizeof(widths)), "test %u: got wrong widths\n", i);
3912  }
3913 }
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
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
HRESULT hr
Definition: shlfolder.c:183
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
GLdouble n
Definition: glext.h:7729
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:3992
#define test
Definition: rosglue.h:37
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
static PVOID ptr
Definition: dispmode.c:27
#define ok(value,...)
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
#define todo_wine_if(is_todo)
Definition: test.h:155
WORD fClusterStart
Definition: usp10.h:179
LONG HRESULT
Definition: typedefs.h:77
static const struct logical_width_test logical_width_tests[]
Definition: usp10.c:3876
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
#define memset(x, y, z)
Definition: compat.h:39
static struct sockaddr_in sa
Definition: adnsresfilter.c:69

Referenced by START_TEST().

◆ test_ScriptGetProperties()

static void test_ScriptGetProperties ( void  )
static

Definition at line 3635 of file usp10.c.

3636 {
3637  const SCRIPT_PROPERTIES **props;
3638  HRESULT hr;
3639  int num;
3640 
3642  ok(hr == E_INVALIDARG, "ScriptGetProperties succeeded\n");
3643 
3645  ok(hr == S_OK, "ScriptGetProperties failed: 0x%08x\n", hr);
3646 
3648  ok(hr == S_OK, "ScriptGetProperties failed: 0x%08x\n", hr);
3649 
3651  ok(hr == S_OK, "ScriptGetProperties failed: 0x%08x\n", hr);
3652 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI ScriptGetProperties(const SCRIPT_PROPERTIES ***props, int *num)
Definition: usp10.c:1152
#define ok(value,...)
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
GLuint GLuint num
Definition: glext.h:9618
#define S_OK
Definition: intsafe.h:59
static const WCHAR props[]
Definition: wbemdisp.c:288

Referenced by START_TEST().

◆ test_ScriptIsComplex()

static void test_ScriptIsComplex ( void  )
static

Definition at line 3915 of file usp10.c.

3916 {
3917  static const WCHAR testW[] = {0x202a,'1',0x202c,0};
3918  static const WCHAR test2W[] = {'1',0};
3919  static const struct complex_test
3920  {
3921  const WCHAR *text;
3922  DWORD flags;
3923  HRESULT hr;
3924  BOOL todo;
3925  } complex_tests[] =
3926  {
3927  { test2W, SIC_ASCIIDIGIT, S_OK },
3928  { test2W, SIC_COMPLEX, S_FALSE },
3929  { test2W, SIC_COMPLEX | SIC_ASCIIDIGIT, S_OK },
3931  { testW, SIC_NEUTRAL, S_FALSE, TRUE },
3932  { testW, SIC_COMPLEX, S_OK },
3933  { testW, 0, S_FALSE },
3934  };
3935  unsigned int i;
3936  HRESULT hr;
3937 
3938  hr = ScriptIsComplex(NULL, 0, 0);
3939  ok(hr == E_INVALIDARG || broken(hr == S_FALSE) /* winxp/vista */, "got 0x%08x\n", hr);
3940 
3941  if (hr == E_INVALIDARG)
3942  {
3943  hr = ScriptIsComplex(NULL, 1, 0);
3944  ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
3945  }
3946 
3947  hr = ScriptIsComplex(test2W, -1, SIC_ASCIIDIGIT);
3948  ok(hr == E_INVALIDARG || broken(hr == S_FALSE) /* winxp/vista */, "got 0x%08x\n", hr);
3949 
3950  hr = ScriptIsComplex(test2W, 0, SIC_ASCIIDIGIT);
3951  ok(hr == S_FALSE, "got 0x%08x\n", hr);
3952 
3953  for (i = 0; i < ARRAY_SIZE(complex_tests); ++i)
3954  {
3955  hr = ScriptIsComplex(complex_tests[i].text, lstrlenW(complex_tests[i].text), complex_tests[i].flags);
3956  todo_wine_if(complex_tests[i].todo)
3957  ok(hr == complex_tests[i].hr, "%u: got %#x, expected %#x, flags %#x\n", i, hr, complex_tests[i].hr,
3958  complex_tests[i].flags);
3959  }
3960 
3961  hr = ScriptIsComplex(test2W, 1, ~0u);
3962  ok(hr == S_OK, "got 0x%08x\n", hr);
3963 
3964  hr = ScriptIsComplex(testW, 3, 0);
3965  ok(hr == S_FALSE, "got 0x%08x\n", hr);
3966 
3968  ok(hr == S_OK, "got 0x%08x\n", hr);
3969 
3971  ok(hr == S_OK, "got 0x%08x\n", hr);
3972 
3973  hr = ScriptIsComplex(test2W, 1, SIC_COMPLEX);
3974  ok(hr == S_FALSE, "got 0x%08x\n", hr);
3975 }
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
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI ScriptIsComplex(const WCHAR *chars, int len, DWORD flag)
Definition: usp10.c:3072
const WCHAR * text
Definition: package.c:1827
BOOL todo
Definition: filedlg.c:313
#define SIC_ASCIIDIGIT
Definition: usp10.h:57
#define lstrlenW
Definition: compat.h:407
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
#define SIC_NEUTRAL
Definition: usp10.h:58
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
#define S_FALSE
Definition: winerror.h:2357
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define todo_wine_if(is_todo)
Definition: test.h:155
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define SIC_COMPLEX
Definition: usp10.h:56
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
#define broken(x)
Definition: _sntprintf.h:21
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
static const WCHAR testW[]
Definition: jsregexp.c:44

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,