You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

200 lines
5.1 KiB

  1. unit utsTypes;
  2. {$IFDEF FPC}
  3. {$mode objfpc}{$H+}
  4. {$ENDIF}
  5. interface
  6. type
  7. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  8. //Enumerations//////////////////////////////////////////////////////////////////////////////////////////////////////////
  9. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  10. {$Z4}
  11. TtsCodePage = (
  12. tsUTF8,
  13. tsISO_8859_1,
  14. tsISO_8859_2,
  15. tsISO_8859_3,
  16. tsISO_8859_4,
  17. tsISO_8859_5,
  18. tsISO_8859_6,
  19. tsISO_8859_7,
  20. tsISO_8859_8,
  21. tsISO_8859_9,
  22. tsISO_8859_10,
  23. tsISO_8859_11,
  24. tsISO_8859_13,
  25. tsISO_8859_14,
  26. tsISO_8859_15,
  27. tsISO_8859_16,
  28. tsISO_037,
  29. tsISO_437,
  30. tsISO_500,
  31. tsISO_737,
  32. tsISO_775,
  33. tsISO_850,
  34. tsISO_852,
  35. tsISO_855,
  36. tsISO_857,
  37. tsISO_860,
  38. tsISO_861,
  39. tsISO_862,
  40. tsISO_863,
  41. tsISO_864,
  42. tsISO_865,
  43. tsISO_866,
  44. tsISO_869,
  45. tsISO_874,
  46. tsISO_875,
  47. tsISO_1026,
  48. tsISO_1250,
  49. tsISO_1251,
  50. tsISO_1252,
  51. tsISO_1253,
  52. tsISO_1254,
  53. tsISO_1255,
  54. tsISO_1256,
  55. tsISO_1257,
  56. tsISO_1258);
  57. TtsFormat = (
  58. tsFormatEmpty,
  59. tsFormatRGBA8,
  60. tsFormatLumAlpha8,
  61. tsFormatAlpha8,
  62. tsFormatLum8);
  63. TtsVertAlignment = (
  64. tsVertAlignTop,
  65. tsVertAlignCenter,
  66. tsVertAlignBottom);
  67. TtsHorzAlignment = (
  68. tsHorzAlignLeft,
  69. tsHorzAlignCenter,
  70. tsHorzAlignRight,
  71. tsHorzAlignJustify);
  72. TtsClipping = (
  73. tsClipNone, // no clipping
  74. tsClipWordBorder, // draw all words that have at least one pixel inside the box
  75. tsClipCharBorder, // draw all chars that have at least one pixel inside the box
  76. tsClipWordComplete, // draw all words that are completly inside the box
  77. tsClipCharComplete // draw all chars that are completly inside the box
  78. );
  79. TtsAntiAliasing = (
  80. tsAANone,
  81. tsAANormal);
  82. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  83. //Flags/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  84. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  85. TtsBlockFlag = (
  86. tsBlockFlagWordWrap
  87. );
  88. TtsBlockFlags = set of TtsBlockFlag;
  89. TtsFontStyle = (
  90. tsStyleBold,
  91. tsStyleItalic,
  92. tsStyleUnderline,
  93. tsStyleStrikeout);
  94. TtsFontStyles = set of TtsFontStyle;
  95. TtsColorChannel = (
  96. tsChannelRed,
  97. tsChannelGreen,
  98. tsChannelBlue,
  99. tsChannelAlpha);
  100. TtsColorChannels = set of TtsColorChannel;
  101. TtsImageMode = (
  102. tsModeIgnore,
  103. tsModeReplace,
  104. tsModeModulate);
  105. TtsImageModes = array[TtsColorChannel] of TtsImageMode;
  106. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  107. //Structures////////////////////////////////////////////////////////////////////////////////////////////////////////////
  108. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  109. TtsRenderRef = Pointer;
  110. PtsCodePageValues = ^TtsCodePageValues;
  111. TtsCodePageValues = array [AnsiChar] of word;
  112. PtsColor4f = ^TtsColor4f;
  113. TtsColor4f = packed record
  114. case Boolean of
  115. true: (r, g, b, a: Single);
  116. false: (arr: array[0..3] of Single);
  117. end;
  118. PtsPosition = ^TtsPosition;
  119. TtsPosition = packed record
  120. x, y: Integer;
  121. end;
  122. PtsRect = ^TtsRect;
  123. TtsRect = packed record
  124. case Byte of
  125. 0: (TopLeft: TtsPosition; BottomRight: TtsPosition);
  126. 1: (Left, Top, Right, Bottom: Integer);
  127. end;
  128. TtsVector4f = array[0..3] of Single;
  129. TtsMatrix4f = array[0..3] of TtsVector4f;
  130. TtsGlyphMetric = packed record
  131. GlyphOrigin: TtsPosition;
  132. GlyphRect: TtsRect;
  133. Advance: Integer;
  134. end;
  135. TtsTextMetric = packed record
  136. Ascent: Integer;
  137. Descent: Integer;
  138. ExternalLeading: Integer;
  139. BaseLineOffset: Integer;
  140. CharSpacing: Integer;
  141. LineHeight: Integer;
  142. LineSpacing: Integer;
  143. end;
  144. TtsFontNames = packed record
  145. Fontname: String;
  146. Copyright: String;
  147. Facename: String;
  148. Stylename: String;
  149. Fullname: String;
  150. end;
  151. TtsFontMetric = packed record
  152. Size: Integer;
  153. Style: TtsFontStyles;
  154. AntiAliasing: TtsAntiAliasing;
  155. DefaultChar: WideChar;
  156. __reserved: SmallInt;
  157. Ascent: Integer;
  158. Descent: Integer;
  159. ExternalLeading: Integer;
  160. BaseLineOffset: Integer;
  161. UnderlinePos: Integer;
  162. UnderlineSize: Integer;
  163. StrikeoutPos: Integer;
  164. StrikeoutSize: Integer;
  165. end;
  166. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  167. //Callbacks/////////////////////////////////////////////////////////////////////////////////////////////////////////////
  168. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  169. TtsBlendValueFunc = function(const aSrc, aDst: Single): Single;
  170. TtsBlendColorFunc = function(const aSrc, aDst: TtsColor4f): TtsColor4f;
  171. implementation
  172. end.