usp10.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. /**
  2. * This file is part of the mingw-w64 runtime package.
  3. * No warranty is given; refer to the file DISCLAIMER within this package.
  4. */
  5. #ifndef __usp10__
  6. #define __usp10__
  7. #include <winapifamily.h>
  8. #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
  9. #include <windows.h>
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. #define USPBUILD 0400
  14. #define SCRIPT_UNDEFINED 0
  15. #if !defined (UNISCRIBE_OPENTYPE) && (_WIN32_WINNT >= 0x0600)
  16. #define UNISCRIBE_OPENTYPE 0x0100
  17. #endif
  18. #if UNISCRIBE_OPENTYPE >= 0x0100
  19. #define SCRIPT_TAG_UNKNOWN 0x00000000
  20. #endif
  21. #define USP_E_SCRIPT_NOT_IN_FONT MAKE_HRESULT (SEVERITY_ERROR, FACILITY_ITF, 0x200)
  22. #define SGCM_RTL 0x00000001
  23. #define SSA_PASSWORD 0x00000001
  24. #define SSA_TAB 0x00000002
  25. #define SSA_CLIP 0x00000004
  26. #define SSA_FIT 0x00000008
  27. #define SSA_DZWG 0x00000010
  28. #define SSA_FALLBACK 0x00000020
  29. #define SSA_BREAK 0x00000040
  30. #define SSA_GLYPHS 0x00000080
  31. #define SSA_RTL 0x00000100
  32. #define SSA_GCP 0x00000200
  33. #define SSA_HOTKEY 0x00000400
  34. #define SSA_METAFILE 0x00000800
  35. #define SSA_LINK 0x00001000
  36. #define SSA_HIDEHOTKEY 0x00002000
  37. #define SSA_HOTKEYONLY 0x00002400
  38. #define SSA_FULLMEASURE 0x04000000
  39. #define SSA_LPKANSIFALLBACK 0x08000000
  40. #define SSA_PIDX 0x10000000
  41. #define SSA_LAYOUTRTL 0x20000000
  42. #define SSA_DONTGLYPH 0x40000000
  43. #define SSA_NOKASHIDA 0x80000000
  44. #define SIC_COMPLEX 1
  45. #define SIC_ASCIIDIGIT 2
  46. #define SIC_NEUTRAL 4
  47. #define SCRIPT_DIGITSUBSTITUTE_CONTEXT 0
  48. #define SCRIPT_DIGITSUBSTITUTE_NONE 1
  49. #define SCRIPT_DIGITSUBSTITUTE_NATIONAL 2
  50. #define SCRIPT_DIGITSUBSTITUTE_TRADITIONAL 3
  51. typedef void *SCRIPT_CACHE;
  52. typedef void *SCRIPT_STRING_ANALYSIS;
  53. #if UNISCRIBE_OPENTYPE >= 0x0100
  54. typedef ULONG OPENTYPE_TAG;
  55. #endif
  56. typedef struct tag_SCRIPT_CONTROL {
  57. DWORD uDefaultLanguage :16;
  58. DWORD fContextDigits :1;
  59. DWORD fInvertPreBoundDir :1;
  60. DWORD fInvertPostBoundDir :1;
  61. DWORD fLinkStringBefore :1;
  62. DWORD fLinkStringAfter :1;
  63. DWORD fNeutralOverride :1;
  64. DWORD fNumericOverride :1;
  65. DWORD fLegacyBidiClass :1;
  66. DWORD fMergeNeutralItems :1;
  67. DWORD fUseStandardBidi :1;
  68. DWORD fReserved :6;
  69. } SCRIPT_CONTROL;
  70. typedef struct tag_SCRIPT_STATE {
  71. WORD uBidiLevel :5;
  72. WORD fOverrideDirection :1;
  73. WORD fInhibitSymSwap :1;
  74. WORD fCharShape :1;
  75. WORD fDigitSubstitute :1;
  76. WORD fInhibitLigate :1;
  77. WORD fDisplayZWG :1;
  78. WORD fArabicNumContext :1;
  79. WORD fGcpClusters :1;
  80. WORD fReserved :1;
  81. WORD fEngineReserved :2;
  82. } SCRIPT_STATE;
  83. typedef struct tag_SCRIPT_ANALYSIS {
  84. WORD eScript :10;
  85. WORD fRTL :1;
  86. WORD fLayoutRTL :1;
  87. WORD fLinkBefore :1;
  88. WORD fLinkAfter :1;
  89. WORD fLogicalOrder :1;
  90. WORD fNoGlyphIndex :1;
  91. SCRIPT_STATE s;
  92. } SCRIPT_ANALYSIS;
  93. typedef struct tag_SCRIPT_ITEM {
  94. int iCharPos;
  95. SCRIPT_ANALYSIS a;
  96. } SCRIPT_ITEM;
  97. typedef enum tag_SCRIPT_JUSTIFY {
  98. SCRIPT_JUSTIFY_NONE = 0,
  99. SCRIPT_JUSTIFY_ARABIC_BLANK = 1,
  100. SCRIPT_JUSTIFY_CHARACTER = 2,
  101. SCRIPT_JUSTIFY_RESERVED1 = 3,
  102. SCRIPT_JUSTIFY_BLANK = 4,
  103. SCRIPT_JUSTIFY_RESERVED2 = 5,
  104. SCRIPT_JUSTIFY_RESERVED3 = 6,
  105. SCRIPT_JUSTIFY_ARABIC_NORMAL = 7,
  106. SCRIPT_JUSTIFY_ARABIC_KASHIDA = 8,
  107. SCRIPT_JUSTIFY_ARABIC_ALEF = 9,
  108. SCRIPT_JUSTIFY_ARABIC_HA = 10,
  109. SCRIPT_JUSTIFY_ARABIC_RA = 11,
  110. SCRIPT_JUSTIFY_ARABIC_BA = 12,
  111. SCRIPT_JUSTIFY_ARABIC_BARA = 13,
  112. SCRIPT_JUSTIFY_ARABIC_SEEN = 14,
  113. SCRIPT_JUSTIFY_ARABIC_SEEN_M = 15,
  114. } SCRIPT_JUSTIFY;
  115. typedef struct tag_SCRIPT_VISATTR {
  116. WORD uJustification :4;
  117. WORD fClusterStart :1;
  118. WORD fDiacritic :1;
  119. WORD fZeroWidth :1;
  120. WORD fReserved :1;
  121. WORD fShapeReserved :8;
  122. } SCRIPT_VISATTR;
  123. #ifndef LSDEFS_DEFINED
  124. typedef struct tagGOFFSET {
  125. LONG du;
  126. LONG dv;
  127. } GOFFSET;
  128. #endif
  129. typedef struct tag_SCRIPT_LOGATTR {
  130. BYTE fSoftBreak :1;
  131. BYTE fWhiteSpace :1;
  132. BYTE fCharStop :1;
  133. BYTE fWordStop :1;
  134. BYTE fInvalid :1;
  135. BYTE fReserved :3;
  136. } SCRIPT_LOGATTR;
  137. typedef struct {
  138. DWORD langid :16;
  139. DWORD fNumeric :1;
  140. DWORD fComplex :1;
  141. DWORD fNeedsWordBreaking :1;
  142. DWORD fNeedsCaretInfo :1;
  143. DWORD bCharSet :8;
  144. DWORD fControl :1;
  145. DWORD fPrivateUseArea :1;
  146. DWORD fNeedsCharacterJustify :1;
  147. DWORD fInvalidGlyph :1;
  148. DWORD fInvalidLogAttr :1;
  149. DWORD fCDM :1;
  150. DWORD fAmbiguousCharSet :1;
  151. DWORD fClusterSizeVaries :1;
  152. DWORD fRejectInvalid :1;
  153. } SCRIPT_PROPERTIES;
  154. typedef struct {
  155. int cBytes;
  156. WORD wgBlank;
  157. WORD wgDefault;
  158. WORD wgInvalid;
  159. WORD wgKashida;
  160. int iKashidaWidth;
  161. } SCRIPT_FONTPROPERTIES;
  162. typedef struct tag_SCRIPT_TABDEF {
  163. int cTabStops;
  164. int iScale;
  165. int *pTabStops;
  166. int iTabOrigin;
  167. } SCRIPT_TABDEF;
  168. typedef struct tag_SCRIPT_DIGITSUBSTITUTE {
  169. DWORD NationalDigitLanguage :16;
  170. DWORD TraditionalDigitLanguage :16;
  171. DWORD DigitSubstitute :8;
  172. DWORD dwReserved;
  173. } SCRIPT_DIGITSUBSTITUTE;
  174. #if UNISCRIBE_OPENTYPE >= 0x0100
  175. typedef struct opentype_feature_record {
  176. OPENTYPE_TAG tagFeature;
  177. LONG lParameter;
  178. } OPENTYPE_FEATURE_RECORD;
  179. typedef struct textrange_properties {
  180. OPENTYPE_FEATURE_RECORD *potfRecords;
  181. int cotfRecords;
  182. } TEXTRANGE_PROPERTIES;
  183. typedef struct script_charprop {
  184. WORD fCanGlyphAlone : 1;
  185. WORD reserved : 15;
  186. } SCRIPT_CHARPROP;
  187. typedef struct script_glyphprop {
  188. SCRIPT_VISATTR sva;
  189. WORD reserved;
  190. } SCRIPT_GLYPHPROP;
  191. #endif
  192. HRESULT WINAPI ScriptFreeCache (SCRIPT_CACHE *psc);
  193. HRESULT WINAPI ScriptItemize (const WCHAR *pwcInChars, int cInChars, int cMaxItems, const SCRIPT_CONTROL *psControl, const SCRIPT_STATE *psState, SCRIPT_ITEM *pItems, int *pcItems);
  194. HRESULT WINAPI ScriptLayout (int cRuns, const BYTE *pbLevel, int *piVisualToLogical, int *piLogicalToVisual);
  195. HRESULT WINAPI ScriptShape (HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcChars, int cChars, int cMaxGlyphs, SCRIPT_ANALYSIS *psa, WORD *pwOutGlyphs, WORD *pwLogClust, SCRIPT_VISATTR *psva, int *pcGlyphs);
  196. HRESULT WINAPI ScriptPlace (HDC hdc, SCRIPT_CACHE *psc, const WORD *pwGlyphs, int cGlyphs, const SCRIPT_VISATTR *psva, SCRIPT_ANALYSIS *psa, int *piAdvance, GOFFSET *pGoffset, ABC *pABC);
  197. HRESULT WINAPI ScriptTextOut (const HDC hdc, SCRIPT_CACHE *psc, int x, int y, UINT fuOptions, const RECT *lprc, const SCRIPT_ANALYSIS *psa, const WCHAR *pwcReserved, int iReserved, const WORD *pwGlyphs, int cGlyphs, const int *piAdvance, const int *piJustify, const GOFFSET *pGoffset);
  198. HRESULT WINAPI ScriptJustify (const SCRIPT_VISATTR *psva, const int *piAdvance, int cGlyphs, int iDx, int iMinKashida, int *piJustify);
  199. HRESULT WINAPI ScriptBreak (const WCHAR *pwcChars, int cChars, const SCRIPT_ANALYSIS *psa, SCRIPT_LOGATTR *psla);
  200. HRESULT WINAPI ScriptCPtoX (int iCP, WINBOOL fTrailing, int cChars, int cGlyphs, const WORD *pwLogClust, const SCRIPT_VISATTR *psva, const int *piAdvance, const SCRIPT_ANALYSIS *psa, int *piX);
  201. 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);
  202. HRESULT WINAPI ScriptGetLogicalWidths (const SCRIPT_ANALYSIS *psa, int cChars, int cGlyphs, const int *piGlyphWidth, const WORD *pwLogClust, const SCRIPT_VISATTR *psva, int *piDx);
  203. HRESULT WINAPI ScriptApplyLogicalWidth (const int *piDx, int cChars, int cGlyphs, const WORD *pwLogClust, const SCRIPT_VISATTR *psva, const int *piAdvance, const SCRIPT_ANALYSIS *psa, ABC *pABC, int *piJustify);
  204. HRESULT WINAPI ScriptGetCMap (HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcInChars, int cChars, DWORD dwFlags, WORD *pwOutGlyphs);
  205. HRESULT WINAPI ScriptGetGlyphABCWidth (HDC hdc, SCRIPT_CACHE *psc, WORD wGlyph, ABC *pABC);
  206. HRESULT WINAPI ScriptGetProperties (const SCRIPT_PROPERTIES ***ppSp, int *piNumScripts);
  207. HRESULT WINAPI ScriptGetFontProperties (HDC hdc, SCRIPT_CACHE *psc, SCRIPT_FONTPROPERTIES *sfp);
  208. HRESULT WINAPI ScriptCacheGetHeight (HDC hdc, SCRIPT_CACHE *psc, long *tmHeight);
  209. HRESULT WINAPI ScriptStringAnalyse (HDC hdc, const void *pString, int cString, int cGlyphs, int iCharset, DWORD dwFlags, int iReqWidth, SCRIPT_CONTROL *psControl, SCRIPT_STATE *psState, const int *piDx, SCRIPT_TABDEF *pTabdef, const BYTE *pbInClass, SCRIPT_STRING_ANALYSIS *pssa);
  210. HRESULT WINAPI ScriptStringFree (SCRIPT_STRING_ANALYSIS *pssa);
  211. const SIZE *WINAPI ScriptString_pSize (SCRIPT_STRING_ANALYSIS ssa);
  212. const int *WINAPI ScriptString_pcOutChars (SCRIPT_STRING_ANALYSIS ssa);
  213. const SCRIPT_LOGATTR *WINAPI ScriptString_pLogAttr (SCRIPT_STRING_ANALYSIS ssa);
  214. HRESULT WINAPI ScriptStringGetOrder (SCRIPT_STRING_ANALYSIS ssa, UINT *puOrder);
  215. HRESULT WINAPI ScriptStringCPtoX (SCRIPT_STRING_ANALYSIS ssa, int icp, WINBOOL fTrailing, int *pX);
  216. HRESULT WINAPI ScriptStringXtoCP (SCRIPT_STRING_ANALYSIS ssa, int iX, int *piCh, int *piTrailing);
  217. HRESULT WINAPI ScriptStringGetLogicalWidths (SCRIPT_STRING_ANALYSIS ssa, int *piDx);
  218. HRESULT WINAPI ScriptStringValidate (SCRIPT_STRING_ANALYSIS ssa);
  219. HRESULT WINAPI ScriptStringOut (SCRIPT_STRING_ANALYSIS ssa, int iX, int iY, UINT uOptions, const RECT *prc, int iMinSel, int iMaxSel, WINBOOL fDisabled);
  220. HRESULT WINAPI ScriptIsComplex (const WCHAR *pwcInChars, int cInChars, DWORD dwFlags);
  221. HRESULT WINAPI ScriptRecordDigitSubstitution (LCID Locale, SCRIPT_DIGITSUBSTITUTE *psds);
  222. HRESULT WINAPI ScriptApplyDigitSubstitution (const SCRIPT_DIGITSUBSTITUTE *psds, SCRIPT_CONTROL *psc, SCRIPT_STATE *pss);
  223. #if UNISCRIBE_OPENTYPE >= 0x0100
  224. HRESULT WINAPI ScriptShapeOpenType (HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS *psa, OPENTYPE_TAG tagScript, OPENTYPE_TAG tagLangSys, int *rcRangeChars, TEXTRANGE_PROPERTIES **rpRangeProperties, int cRanges, const WCHAR *pwcChars, int cChars, int cMaxGlyphs, WORD *pwLogClust, SCRIPT_CHARPROP *pCharProps, WORD *pwOutGlyphs, SCRIPT_GLYPHPROP *pOutGlyphProps, int *pcGlyphs);
  225. HRESULT WINAPI ScriptPlaceOpenType (HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS *psa, OPENTYPE_TAG tagScript, OPENTYPE_TAG tagLangSys, int *rcRangeChars, TEXTRANGE_PROPERTIES **rpRangeProperties, int cRanges, const WCHAR *pwcChars, WORD *pwLogClust, SCRIPT_CHARPROP *pCharProps, int cChars, const WORD *pwGlyphs, const SCRIPT_GLYPHPROP *pGlyphProps, int cGlyphs, int *piAdvance, GOFFSET *pGoffset, ABC *pABC);
  226. HRESULT WINAPI ScriptItemizeOpenType (const WCHAR *pwcInChars, int cInChars, int cMaxItems, const SCRIPT_CONTROL *psControl, const SCRIPT_STATE *psState, SCRIPT_ITEM *pItems, OPENTYPE_TAG *pScriptTags, int *pcItems);
  227. HRESULT WINAPI ScriptGetFontScriptTags (HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS *psa, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags);
  228. HRESULT WINAPI ScriptGetFontLanguageTags (HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS *psa, OPENTYPE_TAG tagScript, int cMaxTags, OPENTYPE_TAG *pLangsysTags, int *pcTags);
  229. HRESULT WINAPI ScriptGetFontFeatureTags (HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS *psa, OPENTYPE_TAG tagScript, OPENTYPE_TAG tagLangSys, int cMaxTags, OPENTYPE_TAG *pFeatureTags, int *pcTags);
  230. HRESULT WINAPI ScriptGetFontAlternateGlyphs (HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS *psa, OPENTYPE_TAG tagScript, OPENTYPE_TAG tagLangSys, OPENTYPE_TAG tagFeature, WORD wGlyphId, int cMaxAlternates, WORD *pAlternateGlyphs, int *pcAlternates);
  231. HRESULT WINAPI ScriptSubstituteSingleGlyph (HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS *psa, OPENTYPE_TAG tagScript, OPENTYPE_TAG tagLangSys, OPENTYPE_TAG tagFeature, LONG lParameter, WORD wGlyphId, WORD *pwOutGlyphId);
  232. HRESULT WINAPI ScriptPositionSingleGlyph (HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS *psa, OPENTYPE_TAG tagScript, OPENTYPE_TAG tagLangSys, OPENTYPE_TAG tagFeature, LONG lParameter, WORD wGlyphId, int iAdvance, GOFFSET GOffset, int *piOutAdvance, GOFFSET *pOutGoffset);
  233. #endif
  234. #ifdef __cplusplus
  235. }
  236. #endif
  237. #endif
  238. #endif