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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422
  1. # Content
  2. 1. [Content](#content)
  3. 2. [General](#general)
  4. 3. [Data Types](#data-types)
  5. 1. [Simple](#simple)
  6. 2. [Enumerations](#enumerations)
  7. 3. [Flags](#flags)
  8. 4. [Structures](#structures)
  9. 5. [Callbacks](#callbacks)
  10. 4. [Constants](#constants)
  11. 5. [Functions](#functions)
  12. 1. [General](#general)
  13. 2. [Context](#context)
  14. 3. [Renderer](#renderer)
  15. 4. [Font Creator](#font-creator)
  16. 5. [Font](#font)
  17. 6. [Text Block](#text-block)
  18. 7. [Image](#image)
  19. 8. [Post Processor](#post-processor)
  20. 9. [Char](#char)
  21. ___________________________________________________________________________________
  22. # General
  23. libTextSuite is a library to render text with OpenGl or OpenGLES. The rendered text can be arranged in single lines or text blocks.
  24. - All api functions use the stdcall calling convention!
  25. - All enumerations are 32bit values!
  26. ___________________________________________________________________________________
  27. # Data Types
  28. ## Simple
  29. |Type |Description |
  30. |-------------------|-----------------------------------------------------|
  31. |pointer |pointer with no data type |
  32. |boolean |8bit value (zero is FALSE, all other values are TRUE)|
  33. |int8 |8bit signed integer |
  34. |int16 |16bit signed integer |
  35. |int32 |32bit signed integer |
  36. |int64 |64bit signed integer |
  37. |uint8 |8bit unsigned integer |
  38. |uint16 |16bit unsigned integer |
  39. |uint32 |32bit unsigned integer |
  40. |uint64 |64bit unsigned integer |
  41. |float |32bit floating point |
  42. |double |64bit floating point |
  43. |AnsiChar |uint8 |
  44. |AnsiString |pointer to null terminated AnsiChar string |
  45. |WideChar |uint16 |
  46. |WideString |pointer to null terminated WideChar string |
  47. |Vector4f |array with 4 elements of float |
  48. |Matrix4f |array with 4 elements of Vector4f |
  49. |Handle |pointer |
  50. |ContextHandle |pointer |
  51. |RendererHandle |pointer |
  52. |RenderRefHandle |pointer |
  53. |TextBlockHandle |pointer |
  54. |FontCreatorHandle |pointer |
  55. |FontHandle |pointer |
  56. |PostProcessorHandle|pointer |
  57. |ImageHandle |pointer |
  58. |CharHandle |pointer |
  59. |ImageModes |array with 4 elements of ImageMode |
  60. Pointers to a type are defined as follows: _uint16*_ or _WideChar*_
  61. ## Enumerations
  62. All enumerations are 32bit values!
  63. ### ErrorCode
  64. |Name |Value|
  65. |-----------------------------|----:|
  66. |ErrUnknown | -1|
  67. |ErrNone | 0|
  68. |ErrNotInitialized | 1|
  69. |ErrInvalidEnum | 2|
  70. |ErrInvalidValue | 3|
  71. |ErrInvalidOperation | 4|
  72. |ErrInvalidType | 5|
  73. |ErrInvalidContextHandle | 100|
  74. |ErrInvalidRendererHandle | 101|
  75. |ErrInvalidTextBlockHandle | 102|
  76. |ErrInvalidFontHandle | 103|
  77. |ErrInvalidFontCreatorHandle | 104|
  78. |ErrInvalidImageHandle | 105|
  79. |ErrInvalidPostProcHandle | 106|
  80. ### CodePage
  81. |Name |Value|
  82. |------------|----:|
  83. |UTF8 | 0|
  84. |ISO_8859_1 | 1|
  85. |ISO_8859_2 | 2|
  86. |ISO_8859_3 | 3|
  87. |ISO_8859_4 | 4|
  88. |ISO_8859_5 | 5|
  89. |ISO_8859_6 | 6|
  90. |ISO_8859_7 | 7|
  91. |ISO_8859_8 | 8|
  92. |ISO_8859_9 | 9|
  93. |ISO_8859_10 | 10|
  94. |ISO_8859_11 | 11|
  95. |ISO_8859_13 | 12|
  96. |ISO_8859_14 | 13|
  97. |ISO_8859_15 | 14|
  98. |ISO_8859_16 | 15|
  99. |ISO_037 | 16|
  100. |ISO_437 | 17|
  101. |ISO_500 | 18|
  102. |ISO_737 | 19|
  103. |ISO_775 | 20|
  104. |ISO_850 | 21|
  105. |ISO_852 | 22|
  106. |ISO_855 | 23|
  107. |ISO_857 | 24|
  108. |ISO_860 | 25|
  109. |ISO_861 | 26|
  110. |ISO_862 | 27|
  111. |ISO_863 | 28|
  112. |ISO_864 | 29|
  113. |ISO_865 | 30|
  114. |ISO_866 | 31|
  115. |ISO_869 | 32|
  116. |ISO_874 | 33|
  117. |ISO_875 | 34|
  118. |ISO_1026 | 35|
  119. |ISO_1250 | 36|
  120. |ISO_1251 | 37|
  121. |ISO_1252 | 38|
  122. |ISO_1253 | 39|
  123. |ISO_1254 | 40|
  124. |ISO_1255 | 41|
  125. |ISO_1256 | 42|
  126. |ISO_1257 | 43|
  127. |ISO_1258 | 44|
  128. ### ObjectType
  129. |Name |Value|
  130. |----------------------------|----:|
  131. |ObjTypeUnknown | 0|
  132. |ObjTypeContext | 1|
  133. |ObjTypeRenderer | 2|
  134. |ObjTypeFontCreator | 3|
  135. |ObjTypeFont | 4|
  136. |ObjTypeTextBlock | 5|
  137. |ObjTypeImage | 6|
  138. |ObjTypePostProcessor | 7|
  139. |ObjTypeChar | 8|
  140. ## Format
  141. |Name |Value|
  142. |---------------|----:|
  143. |FormatEmpty | 0|
  144. |FormatRGBA8 | 1|
  145. |FormatLumAlpha8| 2|
  146. |FormatAlpha8 | 3|
  147. |FormatLum8 | 4|
  148. ### RendererType
  149. |Name |Value|
  150. |-----------------|----:|
  151. |RendererUnknown | 0|
  152. |RendererOpenGL | 1|
  153. |RendererOpenGLES | 2|
  154. ### FontCreatorType
  155. |Name |Value|
  156. |-------------------|----:|
  157. |FontCreatorUnknown | 0|
  158. |FontCreatorFreeType| 1|
  159. |FontCreatorGDI | 2|
  160. |FontCreatorCustom | 3|
  161. ### VerticalAlign
  162. |Name |Value|
  163. |---------------|----:|
  164. |VertAlignTop | 0|
  165. |VertAlignCenter| 1|
  166. |VertAlignBottom| 2|
  167. ### HorizontalAlign
  168. |Name |Value|
  169. |----------------|----:|
  170. |HorzAlignLeft | 0|
  171. |HorzAlignCenter | 1|
  172. |HorzAlignRight | 2|
  173. |HorzAlignJustify| 3|
  174. ### Clipping
  175. |Name |Value|
  176. |---------------|----:|
  177. ClipNone | 0|
  178. ClipWordBorder | 1|
  179. ClipCharBorder | 2|
  180. ClipWordComplete| 3|
  181. ClipCharComplete| 4|
  182. ### AntiAliasing
  183. |Name |Value|
  184. |------|----:|
  185. |None | 0|
  186. |Normal| 1|
  187. ### RangeUsage
  188. |Name |Value|
  189. |------------|----:|
  190. |UsageInclude| 0|
  191. |UsageExclude| 1|
  192. ### StreamOrigin
  193. |Name |Value|
  194. |-------------------|----:|
  195. |StreamOriginBegin | 0|
  196. |StreamOriginCurrent| 1|
  197. |StreamOriginEnd | 2|
  198. ### ImageMode
  199. |Name |Value|
  200. |-------------|----:|
  201. |ModeIgnore | 0|
  202. |ModeReplace | 1|
  203. |ModeModulate| 2|
  204. ## Flags
  205. ### TextBlockFlag
  206. |Name |Bit|
  207. |------------------|--:|
  208. |BlockFlagWordWrap | 0|
  209. ### FontStyle
  210. |Name |Bit|
  211. |------------------|--:|
  212. |FontStyleBold | 0|
  213. |FontStyleItalic | 1|
  214. |FontStyleUnderline| 2|
  215. |FontStyleStrikeout| 3|
  216. ### ColorChannels
  217. |Name |Bit|
  218. |-----------------|---|
  219. |ColorChannelRed | 0|
  220. |ColorChannelGreen| 1|
  221. |ColorChannelBlue | 2|
  222. |ColorChannelAlpha| 3|
  223. ## Structures
  224. ### Position
  225. |Value| Type|
  226. |-----|----:|
  227. |X |int32|
  228. |Y |int32|
  229. ### Rect
  230. |Value | Type|
  231. |------------|-------:|
  232. |TopLeft |Position|
  233. |BottomRight |Position|
  234. OR
  235. |Value | Type|
  236. |------------|----------:|
  237. |Left | int32|
  238. |Top | int32|
  239. |Right | int32|
  240. |Bottom | int32|
  241. ### Color
  242. |Value| Type|
  243. |-----|----:|
  244. |R |float|
  245. |G |float|
  246. |B |float|
  247. |A |float|
  248. ### GlyphMetric
  249. |Value | Type|
  250. |------------|----------:|
  251. |GlyphOrigin | Position|
  252. |GlyphRect | Rect|
  253. |Advance | int32|
  254. ### TextMetric
  255. |Value | Type|
  256. |----------------|----:|
  257. |Ascent |int32|
  258. |Descent |int32|
  259. |ExternalLeading |int32|
  260. |BaseLineOffset |int32|
  261. |CharSpacing |int32|
  262. |LineHeight |int32|
  263. |LineSpacing |int32|
  264. ### FontMetric
  265. |Value | Type|
  266. |----------------|--------------:|
  267. |Size |int32 |
  268. |Style |FontStyle |
  269. |AntiAliasing |AntiAliasing |
  270. |DefaultChar |WideChar |
  271. |__reserved |uint16 |
  272. |Ascent |int32 |
  273. |Descent |int32 |
  274. |ExternalLeading |int32 |
  275. |BaseLineOffset |int32 |
  276. |UnderlinePos |int32 |
  277. |UnderlineSize |int32 |
  278. |StrikeoutPos |int32 |
  279. |StrikeoutSize |int32 |
  280. ### StreamData
  281. |Value | Type|
  282. |----------|-----------------:|
  283. |StreamRead|StreamReadCallback|
  284. |StreamSeek|StreamSeekCallback|
  285. ### CustomPostProcessorData
  286. |Value | Type|
  287. |--------|---------------------------:|
  288. |UserArgs| pointer|
  289. |Execute |PostProcessorExecuteCallback|
  290. ### CustomRendererData
  291. |Value | Type|
  292. |-----------|--------------------------:|
  293. |UserArgs |pointer |
  294. |BeginRender|RendererBeginRenderCallback|
  295. |EndRender |RendererEndRenderCallback |
  296. |GetDrawPos |RendererGetDrawPosCallback |
  297. |SetDrawPos |RendererSetDrawPosCallback |
  298. |MoveDrawPos|RendererMoveDrawPosCallback|
  299. |SetColor |RendererSetColorCallback |
  300. |Render |RendererRenderCallback |
  301. |CreateRef |RendererCreateRefCallback |
  302. |FreeRef |RendererFreeRefCallback |
  303. ## Callbacks
  304. All callbacks use the stdcall calling convention!
  305. ### StreamReadCallback
  306. Read data from stream.
  307. | |Name |Type |Description |
  308. |--------------|--------------|-------|--------------------------------|
  309. |__Parameters__|UserArgs |pointer|user arguments |
  310. | |Buffer |pointer|buffer to store read data in |
  311. | |Size |int32 |number of bytes stored in buffer|
  312. |__Returns__ | |int32 |number of read bytes |
  313. ### StreamSeekCallback
  314. Seek position in stream.
  315. | |Name |Type |Description |
  316. |--------------|--------------|------------|--------------------------------|
  317. |__Parameters__|UserArgs |pointer |user arguments |
  318. | |Origin |StreamOrigin|origin to apply offset at |
  319. | |Offset |int32 |number of bytes to move |
  320. |__Returns__ | |int32 |stream position after seek |
  321. ### PostProcessorExecuteCallback
  322. Execute the post processor.
  323. | |Name |Type |Description |
  324. |--------------|--------------|------------|------------------------------------------|
  325. |__Parameters__|CharHandle |CharHandle |Handle of char to apply post processor at |
  326. | |ImageHandle |ImageHandle |Handle of image to apply post processor at|
  327. ### RendererBeginRenderCallback
  328. Begin rendering.
  329. | |Name |Type |Description |
  330. |--------------|--------------|------------|------------------------------------------|
  331. |__Parameters__|UserArgs |pointer |User defined arguments |
  332. ### RendererEndRenderCallback
  333. End rendering.
  334. | |Name |Type |Description |
  335. |--------------|--------------|------------|------------------------------------------|
  336. |__Parameters__|UserArgs |pointer |User defined arguments |
  337. ### RendererGetDrawPosCallback
  338. Get the current draw position.
  339. | |Name |Type |Description |
  340. |--------------|--------------|------------|------------------------------------------|
  341. |__Parameters__|UserArgs |pointer |User defined arguments |
  342. |__Returns__ | |Position |Current draw position |
  343. ### RendererSetDrawPosCallback
  344. Set the current draw position.
  345. | |Name |Type |Description |
  346. |--------------|--------------|------------|------------------------------------------|
  347. |__Parameters__|Position |Position |New draw positionments |
  348. | |UserArgs |pointer |User defined arguments |
  349. ### RendererMoveDrawPosCallback
  350. Move the draw position relative to the current position.
  351. | |Name |Type |Description |
  352. |--------------|--------------|------------|------------------------------------------|
  353. |__Parameters__|Offset |Position |Offset to current position |
  354. | |UserArgs |pointer |User defined arguments |
  355. ### RendererSetColorCallback
  356. Set the current color.
  357. | |Name |Type |Description |
  358. |--------------|--------------|------------|------------------------------------------|
  359. |__Parameters__|Color |Color |New color |
  360. | |UserArgs |pointer |User defined arguments |
  361. ### RendererRenderCallback
  362. Render the given reference. If ForcedWidth is not eqal zero, then render the reference with the given width. This is used for rendereing spaces when the text block uses justify as horizontal alignment.
  363. | |Name |Type |Description |
  364. |--------------|--------------|-----------------|--------------------------------------------------------------|
  365. |__Parameters__|Reference |RenderRefHandle |Handle of reference to render |
  366. | |ForcedWidth |int32 |Forced width of rendered reference. Use default width if zero.|
  367. | |UserArgs |pointer |User defined arguments |
  368. ### RendererCreateRefCallback
  369. Create a new render reference for the given char and image.
  370. | |Name |Type |Description |
  371. |--------------|--------------|-----------------|--------------------------------------------------------------|
  372. |__Parameters__|CharHandle |CharHandle |Handle of char to create reference for |
  373. | |ImageHandle |ImageHandle |Handle of image to create reference for |
  374. | |UserArgs |pointer |User defined arguments |
  375. |__Returns__ | |RenderRefHandle |Current draw position |
  376. ### RendererFreeRefCallback
  377. Destroy the given render reference.
  378. | |Name |Type |Description |
  379. |--------------|--------------|-----------------|--------------------------------------------------------------|
  380. |__Parameters__|RenderRef |RenderRefHandle |Handle of render reference to destroy |
  381. | |UserArgs |pointer |User defined arguments |
  382. ### ImageLoadCallback
  383. Fill the given image pixel with a color.
  384. | |Name |Type |Description |
  385. |--------------|--------------|-----------------|--------------------------------------------------------------|
  386. |__Parameters__|Image |ImageHandle |Handle of image to fill with data |
  387. | |x |int32 |Horizontal pixel position |
  388. | |y |int32 |Vertical pixel position |
  389. | |Pixel |Color |New color of pixel at (x,y) |
  390. | |UserArgs |pointer |User defined arguments |
  391. ### ImageBlendCallback
  392. Merge the to given colors to a new color.
  393. | |Name |Type |Description |
  394. |--------------|--------------|-----------------|--------------------------------------------------------------|
  395. |__Parameters__|Image |ImageHandle |Handle of image to merge to |
  396. | |Source |Color |Color of soure image |
  397. | |Dest |Color |Color of destination image |
  398. | |Result |Color |New color of destination image |
  399. | |UserArgs |pointer |User defined arguments |
  400. ___________________________________________________________________________________
  401. # Constants
  402. ## ImageModes
  403. ### ImageModesReplaceAll
  404. |Index|Value |
  405. |-----|----------:|
  406. |0 |ModeReplace|
  407. |1 |ModeReplace|
  408. |2 |ModeReplace|
  409. |3 |ModeReplace|
  410. ### ImageModesModulateAlpha
  411. |Index|Value |
  412. |-----|-----------:|
  413. |0 |ModeReplace |
  414. |1 |ModeReplace |
  415. |2 |ModeReplace |
  416. |3 |ModeModulate|
  417. ### ImageModesModulateAll
  418. |Index|Value |
  419. |-----|-----------:|
  420. |0 |ModeModulate|
  421. |1 |ModeModulate|
  422. |2 |ModeModulate|
  423. |3 |ModeModulate|
  424. ## ColorChannels
  425. ### ColorChannelsRGB
  426. |Bit | Is set? |
  427. |-----------------|:----------:|
  428. |ColorChannelRed | yes |
  429. |ColorChannelGreen| yes |
  430. |ColorChannelBlue | yes |
  431. |ColorChannelAlpha| no |
  432. ### ColorChannelsRGBA
  433. |Bit | Is set? |
  434. |-----------------|:----------:|
  435. |ColorChannelRed | yes |
  436. |ColorChannelGreen| yes |
  437. |ColorChannelBlue | yes |
  438. |ColorChannelAlpha| yes |
  439. ___________________________________________________________________________________
  440. # Functions
  441. All callbacks use the stdcall calling convention!
  442. ## General
  443. Function that are used to initialize or control the library.
  444. ### ltsInitialize
  445. Initializes the internal library variables. must be called once before using any other function!
  446. | |Name |Type |Description |
  447. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  448. |__Returns__ | |ErrorCode |Error code |
  449. ### ltsGetVersion
  450. Get the version of the library as string.
  451. | |Name |Type |Description |
  452. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  453. |__Returns__ | |AnsiString |Version of the library as string. |
  454. ### ltsGetLastErrorCode
  455. Get the last error code that was raised.
  456. | |Name |Type |Description |
  457. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  458. |__Returns__ | |ErrorCode |Error code of last failed action. |
  459. ### ltsGetLastErrorMsg
  460. Get the last error message as string.
  461. | |Name |Type |Description |
  462. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  463. |__Returns__ | |AnsiString |Last error message as string |
  464. ### ltsFinalize
  465. Cleans up internal library variables. Should be called once before program exits!
  466. | |Name |Type |Description |
  467. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  468. |__Returns__ | |ErrorCode |Error code |
  469. ## Context
  470. The context is a wrapper object that owns all created objects. When you delete the context, all assigned objects will destroyed too. You should create only one context in your application.
  471. ### ltsContextCreate
  472. Create a new context object.
  473. | |Name |Type |Description |
  474. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  475. |__Returns__ | |ContextHandle |Handle of created context or NULL on failure (check ltsGetLastErrorCode for details).|
  476. ### ltsContextGetCodePage
  477. Get the current code page.
  478. | |Name |Type |Description |
  479. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  480. |__Parameters__|Context |ContextHandle |Handle of the context to get the code page for. |
  481. | |Value |CodePage* |Current code page |
  482. |__Returns__ | |ErrorCode |Error code |
  483. ### ltsContextGetDefaultChar
  484. Get the default char of a context. The default char is used when ever a char could not be displayed correctly. The default value is '?'.
  485. | |Name |Type |Description |
  486. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  487. |__Parameters__|Context |ContextHandle |Handle of the context to get the default char for |
  488. | |Value |WideChar* |Current default char |
  489. |__Returns__ | |ErrorCode |Error code |
  490. ### ltsContextSetCodePage
  491. Set the code page of a context.
  492. | |Name |Type |Description |
  493. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  494. |__Parameters__|Context |ContextHandle |Handle of context to set the code page for |
  495. | |Value |CodePage |New code page |
  496. |__Returns__ | |ErrorCode |Error code |
  497. ### ltsContextSetDefaultChar
  498. Set the default char of a context.
  499. | |Name |Type |Description |
  500. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  501. |__Parameters__|Context |ContextHandle |Handle of context to set default char for |
  502. | |Value |WideChar |New default char |
  503. |__Returns__ | |ErrorCode |Error code |
  504. ### ltsContextAnsiToWide
  505. Convert a AnsiString to a WideString using the contexts code page and default char.
  506. | |Name |Type |Description |
  507. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  508. |__Parameters__|Context |ContextHandle |Handle of context to use for convertion |
  509. | |Text |AnsiString |Text to convert to WideString |
  510. |__Returns__ | |WideString |Converted string or NULL on Error (Check ltsGetLastErrorCode for details)|
  511. ### ltsContextDestroy
  512. Destroy a context object.
  513. | |Name |Type |Description |
  514. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  515. |__Parameters__|Context |ContextHandle |Handle of context to destroy |
  516. |__Returns__ | |ErrorCode |Error code |
  517. ## Renderer
  518. Renderers are objects to display text on the screen. You are able to decide which API you want to use for rendering. Out of the box OpenGL and OpenGLES is supported, but you are free to create your own renderer.
  519. ### ltsRendererCreate
  520. Create a new renderer.
  521. | |Name |Type |Description |
  522. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  523. |__Parameters__|Context |ContextHandle |Handle of context to create renderer for |
  524. | |Type |RendererType |Type of renderer to create |
  525. | |Format |Format |Format to use for renderer |
  526. |__Returns__ | |RendererHandle |Handle of created renderer or NULL in failure (check ltsGetLastErrorCode for details)|
  527. ### ltsRendererCustomCreate
  528. Create a custom renderer.
  529. | |Name |Type |Description |
  530. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  531. |__Parameters__|Context |ContextHandle |Handle of context to create renderer for |
  532. | |Format |Format |Format of the renderer |
  533. | |Data |CustomRendererData |Needed data for the custom render context |
  534. |__Returns__ | |RendererHandle |Handle of the created renderer or NULL in failure (Check ltsGetLastErrorCode for details)|
  535. ### ltsRendererBeginBlock
  536. Begin a new text block.
  537. | |Name |Type |Description |
  538. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  539. |__Parameters__|Renderer |RendererHandle |Handle of renderer to create text block for |
  540. | |Top |int32 |Horizontal position of the text block |
  541. | |Left |int32 |Vertical position of the text block |
  542. | |Width |int32 |Width of the text block |
  543. | |Height |int32 |Height of the text block |
  544. | |Flags |TextBlockFlags |Text block flags |
  545. |__Returns__ | |TextBlockHandle |Handle of the created text bolc or NULL on failure (Check ltsGetLastErrorCode for details)|
  546. ### ltsRendererEndBlock
  547. Close text block and render it's content. The text block object will be destroyed.
  548. | |Name |Type |Description |
  549. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  550. |__Parameters__|Renderer |RendererHandle |Handle of renderer |
  551. | |TextBlock |TextBlockHandle |Handle of text block to close |
  552. |__Returns__ | |ErrorCode |Error code |
  553. ### ltsRendererAbortBlock
  554. Close text block and do not render it's content. The text block object will be destroyed.
  555. | |Name |Type |Description |
  556. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  557. |__Parameters__|Renderer |RendererHandle |Handle of renderer |
  558. | |TextBlock |TextBlockHandle |Handle of text block to close |
  559. |__Returns__ | |ErrorCode |Error code |
  560. ### ltsRendererGetTextWidthA
  561. Get width of a given text.
  562. | |Name |Type |Description |
  563. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  564. |__Parameters__|Renderer |RendererHandle |Handle of renderer |
  565. | |Font |FontHandle |Handle of font to use for the text |
  566. | |Text |AnsiString |Text to get width for |
  567. |__Returns__ | |int32 |Width of text of -1 on failure (Check ltsGetLastErrorCode for details)|
  568. ### ltsRendererGetTextWidthW
  569. Get width of a given text.
  570. | |Name |Type |Description |
  571. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  572. |__Parameters__|Renderer |RendererHandle |Handle of renderer |
  573. | |Font |FontHandle |Handle of font to use for the text |
  574. | |Text |WideString |Text to get width for |
  575. |__Returns__ | |int32 |Width of text of -1 on failure (Check ltsGetLastErrorCode for details)|
  576. ### ltsRendererDestroy
  577. Destroy a renderer object.
  578. | |Name |Type |Description |
  579. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  580. |__Parameters__|Renderer |RendererHandle |Handle of renderer to destroy. |
  581. |__Returns__ | |ErrorCode |Error code |
  582. ## Font Creator
  583. Font creators are objects that are used load glyphs for a certain char. Out of the box a GDI and a FreeType font creator are supported, but you are free to write your own one.
  584. ### ltsFontCreatorCreate
  585. Create a new font creator object.
  586. | |Name |Type |Description |
  587. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  588. |__Parameters__|Context |ContextHandle |Handle of context to create font creator for |
  589. | |Type |FontCreatorType |Type of font creator to create |
  590. |__Returns__ | |FontCreatorHandle |Handle of created font creator or NULL on failure (Check ltsGetLastErrorCode for details)|
  591. ### ltsFontCreatorGetFontByName
  592. Load a font by its name.
  593. | |Name |Type |Description |
  594. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  595. |__Parameters__|FontCreator |FontCreatorHandle |Handle of font creator to create font with |
  596. | |Fontname |AnsiString |Name of the font to create |
  597. | |Size |int32 |Size of the font to create |
  598. | |Style |FontStyle |Style of the font to create |
  599. | |AnsiAliasing |AntiAliasing |Anti aliasing of the font to create |
  600. |__Returns__ | |FontHandle |Handle of created font or NULL on failue (Check ltsGetLastErrorCode for details)|
  601. ### ltsFontCreatorGetFontByFile
  602. Load a font from a file.
  603. | |Name |Type |Description |
  604. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  605. |__Parameters__|FontCreator |FontCreatorHandle |Handle of font creator to create font with |
  606. | |Filename |AnsiString |Filename to load font from |
  607. | |Size |int32 |Size of the font to create |
  608. | |Style |FontStyle |Style of the font to create |
  609. | |AnsiAliasing |AntiAliasing |Anti aliasing of the font to create |
  610. |__Returns__ | |FontHandle |Handle of created font or NULL on failue (Check ltsGetLastErrorCode for details)|
  611. ### ltsFontCreatorGetFontByStream
  612. Load a font from a stream.
  613. | |Name |Type |Description |
  614. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  615. |__Parameters__|FontCreator |FontCreatorHandle |Handle of font creator to create font with |
  616. | |Stream |StreamData* |libTextSuite stream interface |
  617. | |Size |int32 |Size of the font to create |
  618. | |Style |FontStyle |Style of the font to create |
  619. | |AnsiAliasing |AntiAliasing |Anti aliasing of the font to create |
  620. |__Returns__ | |FontHandle |Handle of created font or NULL on failue (Check ltsGetLastErrorCode for details)|
  621. ### ltsFontCreatorDestroy
  622. Destroy a font creator object.
  623. | |Name |Type |Description |
  624. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  625. |__Parameters__|FontCreator |FontCreatorHandle |Handle of font creator to destroy |
  626. |__Returns__ | |ErrorCode |Error code |
  627. ## Font
  628. Font objects are used to define the appearance (size, style, ...) of text. They are created using a font creator.
  629. ### ltsFontGetPostProcessor
  630. Get the current post processor object assigned to a font.
  631. | |Name |Type |Description |
  632. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  633. |__Parameters__|Font |FontHandle |Handle of font to get the post processor for |
  634. |__Returns__ | |PostProcessorHandle |Handle of post processor assigned to this font. |
  635. ### ltsFontGetTabWidth
  636. Get the current tab width of a font.
  637. | |Name |Type |Description |
  638. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  639. |__Parameters__|Font |FontHandle |Handle of font to get tab width for |
  640. | |Value |int32* |Tab width of font |
  641. |__Returns__ | |ErrorCode |Error code |
  642. ### ltsFontGetCharSpacing
  643. Get the current char spacing of a font.
  644. | |Name |Type |Description |
  645. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  646. |__Parameters__|Font |FontHandle |Handle of font to get char spacing for |
  647. | |Value |int32* |Char spacing of the font |
  648. |__Returns__ | |ErrorCode |Error code |
  649. ### ltsFontGetLineSpacing
  650. Get the current line spacing of a font.
  651. | |Name |Type |Description |
  652. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  653. |__Parameters__|Font |FontHandle |Handle of font to get line spacing for |
  654. | |Value |int32* |Line spacing of the font |
  655. |__Returns__ | |ErrorCode |Error code |
  656. ### ltsFontGetMetric
  657. Get the metric of a font.
  658. | |Name |Type |Description |
  659. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  660. |__Parameters__|Font |FontHandle |Handle of font to get metric for |
  661. | |Value |FontMetric* |Metric of the font |
  662. |__Returns__ | |ErrorCode |Error code |
  663. ### ltsFontGetFontname
  664. Get the name of a font
  665. | |Name |Type |Description |
  666. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  667. |__Parameters__|Font |FontHandle |Handle of font to get the name for |
  668. |__Returns__ | |AnsiString |Font name or NULL on failure (Check ltsGetLastErrorCode for details)|
  669. ### ltsFontGetFacename
  670. Get the face name of a font
  671. | |Name |Type |Description |
  672. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  673. |__Parameters__|Font |FontHandle |Handle of font to get the face name for |
  674. |__Returns__ | |AnsiString |Face name or NULL on failure (Check ltsGetLastErrorCode for details)|
  675. ### ltsFontGetStylename
  676. Get the style name of a font
  677. | |Name |Type |Description |
  678. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  679. |__Parameters__|Font |FontHandle |Handle of font to get the style name for |
  680. |__Returns__ | |AnsiString |Style name or NULL on failure (Check ltsGetLastErrorCode for details)|
  681. ### ltsFontGetFullname
  682. Get the full name of a font
  683. | |Name |Type |Description |
  684. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  685. |__Parameters__|Font |FontHandle |Handle of font to get the full name for |
  686. |__Returns__ | |AnsiString |Full name or NULL on failure (Check ltsGetLastErrorCode for details)|
  687. ### ltsFontGetCopyright
  688. Get the copyright of a font
  689. | |Name |Type |Description |
  690. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  691. |__Parameters__|Font |FontHandle |Handle of font to get the copyright for |
  692. |__Returns__ | |AnsiString |Copyright or NULL on failure (Check ltsGetLastErrorCode for details)|
  693. ### ltsFontSetPostProcessor
  694. Set the post processor of a font
  695. | |Name |Type |Description |
  696. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  697. |__Parameters__|Font |FontHandle |Handle of font to set the post processor for |
  698. | |PostProcessor |PostProcessorHandle |Handle of post processor to assign to the font |
  699. |__Returns__ | |ErrorCode |Error code |
  700. ### ltsFontSetTabWidth
  701. Set the tab width of a font
  702. | |Name |Type |Description |
  703. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  704. |__Parameters__|Font |FontHandle |Handle of font to set the tab width for |
  705. | |Value |int32* |New tab width of the font |
  706. |__Returns__ | |ErrorCode |Error code |
  707. ### ltsFontSetCharSpacing
  708. Set the char spacing of a font
  709. | |Name |Type |Description |
  710. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  711. |__Parameters__|Font |FontHandle |Handle of font to set the char spacing for |
  712. | |Value |int32* |New char spacing of the font |
  713. |__Returns__ | |ErrorCode |Error code |
  714. ### ltsFontSetLineSpacing
  715. Set the line spacing of a font
  716. | |Name |Type |Description |
  717. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  718. |__Parameters__|Font |FontHandle |Handle of font to set the line spacing for |
  719. | |Value |int32* |New line spacing of the font |
  720. |__Returns__ | |ErrorCode |Error code |
  721. ### ltsFontDestroy
  722. Destroy a font object
  723. | |Name |Type |Description |
  724. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  725. |__Parameters__|Font |FontHandle |Handle of font to destroy |
  726. |__Returns__ | |ErrorCode |Error code |
  727. ## Text Block
  728. Text block objects are used to arrange text in a block: automatic line break, alignment, text color, text font, ...
  729. ### ltsTextBlockGetRect
  730. Get the rect of a text block.
  731. | |Name |Type |Description |
  732. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  733. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to get the rect for |
  734. | |Value |Rect* |Rect of the text block |
  735. |__Returns__ | |ErrorCode |Error code |
  736. ### ltsTextBlockGetWidth
  737. Get the width of a text block.
  738. | |Name |Type |Description |
  739. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  740. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to get the width for |
  741. | |Value |int32* |Width of the text block |
  742. |__Returns__ | |ErrorCode |Error code |
  743. ### ltsTextBlockGetHeight
  744. Get the height of a text block.
  745. | |Name |Type |Description |
  746. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  747. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to get the height for |
  748. | |Value |int32* |Height of the text block |
  749. |__Returns__ | |ErrorCode |Error code |
  750. ### ltsTextBlockGetFlags
  751. Get the flags of a text block.
  752. | |Name |Type |Description |
  753. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  754. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to get the flags for |
  755. | |Value |TextBlockFlags* |Flags of the text block |
  756. |__Returns__ | |ErrorCode |Error code |
  757. ### ltsTextBlockGetTop
  758. Get the vertical position of a text block.
  759. | |Name |Type |Description |
  760. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  761. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to get vertical position for |
  762. | |Value |int32* |Vertical position of the text block |
  763. |__Returns__ | |ErrorCode |Error code |
  764. ### ltsTextBlockGetLeft
  765. Get the horizontal position of a text block.
  766. | |Name |Type |Description |
  767. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  768. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to get horizontal position for |
  769. | |Value |int32* |Horizontal position of the text block |
  770. |__Returns__ | |ErrorCode |Error code |
  771. ### ltsTextBlockGetVertAlign
  772. Get the vertical alignment of a text block.
  773. | |Name |Type |Description |
  774. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  775. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to get vertical alignment for |
  776. | |Value |VerticalAlign* |Vertical alignment of the text block |
  777. |__Returns__ | |ErrorCode |Error code |
  778. ### ltsTextBlockGetHorzAlign
  779. Get the horizontal alignment of a text block.
  780. | |Name |Type |Description |
  781. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  782. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to get horizontal alignment for |
  783. | |Value |HorizontalAlign* |Horizontal alignment of the text block |
  784. |__Returns__ | |ErrorCode |Error code |
  785. ### ltsTextBlockGetClipping
  786. Get the clipping of a text block.
  787. | |Name |Type |Description |
  788. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  789. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to get the clipping for |
  790. | |Value |Clipping* |Clipping of the text block |
  791. |__Returns__ | |ErrorCode |Error code |
  792. ### ltsTextBlockGetColor
  793. Get the current color of a text block.
  794. | |Name |Type |Description |
  795. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  796. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to get the color for |
  797. | |Value |Color* |Current color of the text block |
  798. |__Returns__ | |ErrorCode |Error code |
  799. ### ltsTextBlockGetFont
  800. Get the current font of a text block.
  801. | |Name |Type |Description |
  802. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  803. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to get the font for |
  804. | |Value |FontHandle* |Current font of the text block |
  805. |__Returns__ | |ErrorCode |Error code |
  806. ### ltsTextBlockSetTop
  807. Set the vertical position of a text block.
  808. | |Name |Type |Description |
  809. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  810. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to set the vertical position for |
  811. | |Value |int32 |New vertical position |
  812. |__Returns__ | |ErrorCode |Error code |
  813. ### ltsTextBlockSetLeft
  814. Set the horizontal position of a text block.
  815. | |Name |Type |Description |
  816. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  817. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to set the horizontal position for |
  818. | |Value |int32 |New horizontal position |
  819. |__Returns__ | |ErrorCode |Error code |
  820. ### ltsTextBlockSetVertAlign
  821. Set the vertical alignment of a text block.
  822. | |Name |Type |Description |
  823. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  824. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to set the vertical alignment for |
  825. | |Value |VerticalAlign |New vertical alignment |
  826. |__Returns__ | |ErrorCode |Error code |
  827. ### ltsTextBlockSetHorzAlign
  828. Set the horizontal alignment of a text block.
  829. | |Name |Type |Description |
  830. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  831. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to set the horizontal alignment for |
  832. | |Value |HorizontalAlign |New horizontal alignment |
  833. |__Returns__ | |ErrorCode |Error code |
  834. ### ltsTextBlockSetClipping
  835. Set the clipping of a text block.
  836. | |Name |Type |Description |
  837. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  838. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to set the clipping for |
  839. | |Value |Clipping |New clipping |
  840. |__Returns__ | |ErrorCode |Error code |
  841. ### ltsTextBlockSetColor
  842. Set the color of a text block. This will not affect already written Text!
  843. | |Name |Type |Description |
  844. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  845. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to set the color for |
  846. | |Value |Color |New color |
  847. |__Returns__ | |ErrorCode |Error code |
  848. ### ltsTextBlockSetFont
  849. Set the font of a text block. This will not affect already written text!
  850. | |Name |Type |Description |
  851. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  852. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to set the font for |
  853. | |Value |FontHandle |New font |
  854. |__Returns__ | |ErrorCode |Error code |
  855. ### ltsTextBlockGetActualHeight
  856. Get the actual used height of a text block.
  857. | |Name |Type |Description |
  858. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  859. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to get the actual height for |
  860. |__Returns__ | |int32 |Actual height of the text block or -1 on failure (Chec ltsGetLastErrorCode for more details)|
  861. ### ltsTextBlockGetTextWidthA
  862. Get the width of a text.
  863. | |Name |Type |Description |
  864. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  865. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to get the text width for |
  866. | |Text |AnsiText |Text to get the width for |
  867. |__Returns__ | |int32 |Text width or -1 on failure (Chec ltsGetLastErrorCode for more details)|
  868. ### ltsTextBlockGetTextWidthW
  869. Get the width of a text.
  870. | |Name |Type |Description |
  871. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  872. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to get the text width for |
  873. | |Text |WideText |Text to get the width for |
  874. |__Returns__ | |int32 |Text width or -1 on failure (Chec ltsGetLastErrorCode for more details)|
  875. ### ltsTextBlockTextOutA
  876. Write text to the text block. This will use the current color and the current font of the text block. A change of the color or the font will not take effect on already written text.
  877. | |Name |Type |Description |
  878. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  879. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to get the text width for |
  880. | |Text |AnsiText |Text to get the width for |
  881. |__Returns__ | |ErrorCode |Error code |
  882. ### ltsTextBlockTextOutW
  883. Write text to the text block. This will use the current color and the current font of the text block. A change of the color or the font will not take effect on already written text.
  884. | |Name |Type |Description |
  885. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  886. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to get the text width for |
  887. | |Text |WideText |Text to get the width for |
  888. |__Returns__ | |ErrorCode |Error code |
  889. ### ltsTextBlockDestroy
  890. Destroy a text block.
  891. | |Name |Type |Description |
  892. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  893. |__Parameters__|TextBlock |TextBlockHandle |Handle of text block to destroy |
  894. |__Returns__ | |ErrorCode |Error code |
  895. ## Image
  896. Image objects are used to store glyph data. You can manipulate the stored data through a post processor before the glyph is rendered.
  897. ### ltsImageCreate
  898. Create a new image object.
  899. | |Name |Type |Description |
  900. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  901. |__Parameters__|Context |ContextHandle |Handle of context to create the image for |
  902. |__Returns__ | |ImageHandle |Handle of created image or NULL on failure (Check ltsGetLastErrorCode for details)|
  903. ### ltsImageIsEmpty
  904. Check is an image is empty.
  905. | |Name |Type |Description |
  906. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  907. |__Parameters__|Image |ImageHandle |Handle of image to check |
  908. | |Value |boolean |TRUE if the image is empty, FALSE otherwise |
  909. |__Returns__ | |ErrorCode |Error code |
  910. ### ltsImageGetWidth
  911. Get the width of an image.
  912. | |Name |Type |Description |
  913. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  914. |__Parameters__|Image |ImageHandle |Handle of image to get width for |
  915. |__Returns__ | |int32 |Width of image or -1 on failure (Check ltsGetLastErrorCode for details)|
  916. ### ltsImageGetHeight
  917. Get the height of an image.
  918. | |Name |Type |Description |
  919. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  920. |__Parameters__|Image |ImageHandle |Handle of image to get height for |
  921. |__Returns__ | |int32 |Height of image or -1 on failure (Check ltsGetLastErrorCode for details)|
  922. ### ltsImageGetLineSize
  923. Get the number of bytes used in each line of an image.
  924. | |Name |Type |Description |
  925. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  926. |__Parameters__|Image |ImageHandle |Handle of image to get line size for |
  927. |__Returns__ | |int32 |Line size of image or -1 on failure (Check ltsGetLastErrorCode for details)|
  928. ### ltsImageGetDataSize
  929. Get the number of bytes used to store the images data.
  930. | |Name |Type |Description |
  931. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  932. |__Parameters__|Image |ImageHandle |Handle of image to get data size for |
  933. |__Returns__ | |int32 |Data size of image or -1 on failure (Check ltsGetLastErrorCode for details)|
  934. ### ltsImageGetFormat
  935. Get the format of an image.
  936. | |Name |Type |Description |
  937. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  938. |__Parameters__|Image |ImageHandle |Handle of image to get the format for |
  939. | |Format |Format* |Format of the image |
  940. |__Returns__ | |ErrorCode |Error code |
  941. ### ltsImageGetData
  942. Get the raw data of an image.
  943. | |Name |Type |Description |
  944. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  945. |__Parameters__|Image |ImageHandle |Handle of image to get the data for |
  946. |__Returns__ | |pointer |Pointer to image data or NULL on failure (Check ltsGetLastErrorCode for more details)|
  947. ### ltsImageGetScanline
  948. Get the raw data of a line inside of the image.
  949. | |Name |Type |Description |
  950. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  951. |__Parameters__|Image |ImageHandle |Handle of image to get the scanline for |
  952. | |Index |int32 |Index of the scanline |
  953. |__Returns__ | |pointer |Pointer to scanline data or NULL on failure (Check ltsGetLastErrorCode for more details)|
  954. ### ltsImageGetPixelAt
  955. Get the color of a pixel inside the image.
  956. | |Name |Type |Description |
  957. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  958. |__Parameters__|Image |ImageHandle |Handle of image to get pixel color for |
  959. | |X |int32 |Horizontal pixel position |
  960. | |Y |int32 |Vertical pixel position |
  961. | |Color |Color* |Pixel color |
  962. |__Returns__ | |ErrorCode |Error code |
  963. ### ltsImageAssign
  964. Copy one image to another.
  965. | |Name |Type |Description |
  966. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  967. |__Parameters__|Image |ImageHandle |Handle of image to assign Source to |
  968. | |Source |ImageHandle |Handle of image to copy to Image |
  969. | |Color |Color* |Pixel color |
  970. |__Returns__ | |ErrorCode |Error code |
  971. ### ltsImageCreateEmpty
  972. Clear image.
  973. | |Name |Type |Description |
  974. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  975. |__Parameters__|Image |ImageHandle |Handle of image to clear |
  976. | |Format |Format |Format of image data |
  977. | |Width |int32 |Width of image |
  978. | |Height |int32 |Height of image |
  979. |__Returns__ | |ErrorCode |Error code |
  980. ### ltsImageLoadFromFunc
  981. Load image data using a callback function.
  982. | |Name |Type |Description |
  983. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  984. |__Parameters__|Image |ImageHandle |Handle of image to load data for |
  985. | |Callback |ImageLoadCallback |Callback to load image data |
  986. | |UserArgs |pointer |User defined arguments the will passed to the callback |
  987. |__Returns__ | |ErrorCode |Error code |
  988. ### ltsImageResize
  989. Resize an image.
  990. | |Name |Type |Description |
  991. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  992. |__Parameters__|Image |ImageHandle |Handle of image to resize |
  993. | |Width |int32 |New width of the image |
  994. | |Height |int32 |New height of the image |
  995. | |X |int32 |Horizontal position of the old image inside the new one |
  996. | |Y |int32 |Vertical position of the old image inside the new one |
  997. |__Returns__ | |ErrorCode |Error code |
  998. ### ltsImageFillColor
  999. Fill image with given color.
  1000. | |Name |Type |Description |
  1001. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  1002. |__Parameters__|Image |ImageHandle |Handle of image to fill with color |
  1003. | |Color |Color |Color to fill image with |
  1004. | |Mask |ColorChannels |Color channels the action will take effect on |
  1005. | |Modes |ImageModes |Modes how the action will take effect on |
  1006. |__Returns__ | |ErrorCode |Error code |
  1007. ### ltsImageFillPattern
  1008. Fill image with given pattern.
  1009. | |Name |Type |Description |
  1010. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  1011. |__Parameters__|Image |ImageHandle |Handle of image to fill with pattern |
  1012. | |Pattern |ImageHandle |Handle of image to use as pattern |
  1013. | |X |int32 |Horizontal position the pattern will be placed at |
  1014. | |Y |int32 |Vertical position the pattern will be placed at |
  1015. | |Mask |ColorChannels |Color channels the action will take effect on |
  1016. | |Modes |ImageModes |Modes how the action will take effect on |
  1017. |__Returns__ | |ErrorCode |Error code |
  1018. ### ltsImageBlend
  1019. Blend an image into another image.
  1020. | |Name |Type |Description |
  1021. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  1022. |__Parameters__|Image |ImageHandle |Handle of image to blend other image in |
  1023. | |Source |ImageHandle |Handle of image to blend into Image |
  1024. | |X |int32 |Horizontal position the source image will be placed at |
  1025. | |Y |int32 |Vertical position the source image will be placed at |
  1026. | |BlendFunc |ImageBlendCallback |Callback to handle blending |
  1027. | |UserArgs |pointer |User defined argument that will be passed to callback |
  1028. |__Returns__ | |ErrorCode |Error code |
  1029. ### ltsImageBlur
  1030. Blur an image.
  1031. | |Name |Type |Description |
  1032. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  1033. |__Parameters__|Image |ImageHandle |Handle of image to blur |
  1034. | |HorzRadius |float |Horizontal blur radius |
  1035. | |HorzStrength |float |Horizontal blur strength |
  1036. | |VertRadius |float |Vertical blur radius |
  1037. | |VertStrength |float |Vertical blur strength |
  1038. | |Mask |ColorChannels |Color channels this action will take effect on |
  1039. |__Returns__ | |ErrorCode |Error code |
  1040. ### ltsImageDestroy
  1041. Destroy an image object.
  1042. | |Name |Type |Description |
  1043. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  1044. |__Parameters__|Image |ImageHandle |Handle of image to destroy |
  1045. |__Returns__ | |ErrorCode |Error code |
  1046. ## Post Processor
  1047. Post processor objects are used to manipulate glyph data before it is rendered. You are able to add shadows, borders or something like that.
  1048. ### ltsPostProcessorFillColorCreate
  1049. Create a fill color post processor
  1050. | |Name |Type |Description |
  1051. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  1052. |__Parameters__|Context |ContextHandle |Handle of context to create post processor for |
  1053. | |Color |Color |Color to use for fill |
  1054. | |Modes |ImageModes |Modes how the action will take effect on |
  1055. | |Channels |ColorChannels |Color channels the action will take effect on |
  1056. |__Returns__ | |PostProcessorHandle |Handle of created post processor or NULL on failure (Check ltsGetLastErrorCode for more detail)|
  1057. ### ltsPostProcessorFillPatternCreate
  1058. Create a fill pattern post processor
  1059. | |Name |Type |Description |
  1060. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  1061. |__Parameters__|Context |ContextHandle |Handle of context to create post processor for |
  1062. | |Pattern |ImageHandle |Handle to image to use as pattern |
  1063. | |OwnsPattern |boolean |TRUE: Pattern image will be destroyed with post processor; FALSE: Pattern image will not be destroyed|
  1064. | |Position |Position |Position the pattern will be placed |
  1065. | |Modes |ImageModes |Modes how the action will take effect on |
  1066. | |Channels |ColorChannels |Color channels the action will take effect on |
  1067. |__Returns__ | |PostProcessorHandle |Handle of created post processor or NULL on failure (Check ltsGetLastErrorCode for more detail)|
  1068. ### ltsPostProcessorBorderCreate
  1069. Create a border post processor
  1070. | |Name |Type |Description |
  1071. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  1072. |__Parameters__|Context |ContextHandle |Handle of context to create post processor for |
  1073. | |Width |float |Width of the created border |
  1074. | |Strength |float |Strength of the created border |
  1075. | |Color |Color |Color of the created border |
  1076. | |KeepSize |boolean |TRUE: do not resize the glyph image; FALSE: resize the glyph image |
  1077. |__Returns__ | |PostProcessorHandle |Handle of created post processor or NULL on failure (Check ltsGetLastErrorCode for more detail)|
  1078. ### ltsPostProcessorShadowCreate
  1079. Create a shadow post processor
  1080. | |Name |Type |Description |
  1081. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  1082. |__Parameters__|Context |ContextHandle |Handle of context to create post processor for |
  1083. | |Width |float |Width of the created shadow |
  1084. | |Strength |float |Strength of the created shadow |
  1085. | |Offset |Position |Offset of the created shadow |
  1086. | |Color |Color |Color of the created shadow |
  1087. |__Returns__ | |PostProcessorHandle |Handle of created post processor or NULL on failure (Check ltsGetLastErrorCode for more detail)|
  1088. ### ltsPostProcessorCustomCreate
  1089. Create a custom post processor
  1090. | |Name |Type |Description |
  1091. |--------------|------------------|------------------------|--------------------------------------------------------------------|
  1092. |__Parameters__|Context |ContextHandle |Handle of context to create post processor for |
  1093. | |Data |CustomPostProcessorData*|libTextSuite custom post processor interface |
  1094. |__Returns__ | |PostProcessorHandle |Handle of created post processor or NULL on failure (Check ltsGetLastErrorCode for more detail)|
  1095. ### ltsPostProcessorAddRange
  1096. Add range of characters the post processor will take effect on.
  1097. | |Name |Type |Description |
  1098. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  1099. |__Parameters__|PostProcessor |PostProcessorHandle |Handle of post processor to add char range to |
  1100. | |Usage |RangeUsage |Usage of the passed char range |
  1101. | |Start |WideChar |First char of range |
  1102. | |Stop |WideChar |Last char of range |
  1103. |__Returns__ | |ErrorCode |Error code |
  1104. ### ltsPostProcessorAddChars
  1105. Add characters the post processor will take effect on.
  1106. | |Name |Type |Description |
  1107. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  1108. |__Parameters__|PostProcessor |PostProcessorHandle |Handle of post processor to add chars to |
  1109. | |Usage |RangeUsage |Usage of the passed char range |
  1110. | |Chars |WideString |Characters to add |
  1111. |__Returns__ | |ErrorCode |Error code |
  1112. ### ltsPostProcessorClearRanges
  1113. Clear all character defines of a post processor.
  1114. | |Name |Type |Description |
  1115. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  1116. |__Parameters__|PostProcessor |PostProcessorHandle |Handle of post processor to clear |
  1117. |__Returns__ | |ErrorCode |Error code |
  1118. ### ltsPostProcessorExecute
  1119. Execute the post processor.
  1120. | |Name |Type |Description |
  1121. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  1122. |__Parameters__|PostProcessor |PostProcessorHandle |Handle of post processor to execute |
  1123. | |Char |CharHandle |Handle of char to execute the post processor on |
  1124. | |Image |ImageHandle |Handle of image to execute the post processor on |
  1125. |__Returns__ | |ErrorCode |Error code |
  1126. ### ltsPostProcessorDestroy
  1127. Destroy a post processor object.
  1128. | |Name |Type |Description |
  1129. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  1130. |__Parameters__|PostProcessor |PostProcessorHandle |Handle of post processor to destroy |
  1131. |__Returns__ | |ErrorCode |Error code |
  1132. ## Char
  1133. Char objects are used to store the size of a glyph. The data can be manipulated using a post processor.
  1134. ### ltsCharGetCharCode
  1135. Get the char code the char object is assigned to.
  1136. | |Name |Type |Description |
  1137. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  1138. |__Parameters__|Char |CharHandle |Handle to char to get char code for |
  1139. | |Value |WideChar* |Char code of the char object is assigned to |
  1140. |__Returns__ | |ErrorCode |Error code |
  1141. ### ltsCharGetGlyphMetric
  1142. Get the glyph metric of a char.
  1143. | |Name |Type |Description |
  1144. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  1145. |__Parameters__|Char |CharHandle |Handle to char to get glyph metric for |
  1146. | |Value |GlyphMetric* |Glyph metric of the char object |
  1147. |__Returns__ | |ErrorCode |Error code |
  1148. ### ltsCharSetGlyphMetric
  1149. Set the glyph metric of a char.
  1150. | |Name |Type |Description |
  1151. |--------------|------------------|--------------------|--------------------------------------------------------------------|
  1152. |__Parameters__|Char |CharHandle |Handle to char to get glyph metric for |
  1153. | |Value |GlyphMetric* |New glyph metric |
  1154. |__Returns__ | |ErrorCode |Error code |