Skip to content

Commit ba0c68a

Browse files
committed
Update doc-comments in SDL2_ttf unit
1 parent 06825fb commit ba0c68a

File tree

1 file changed

+42
-25
lines changed

1 file changed

+42
-25
lines changed

units/sdl2_ttf.pas

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ procedure TTF_ByteSwappedUNICODE(swapped: TSDL_bool); cdecl;
196196
* \since This function is available since SDL_ttf 2.0.12.
197197
*
198198
* \sa TTF_Quit
199+
* \sa TTF_WasInit
199200
}
200201
function TTF_Init(): cint; cdecl;
201202
external TTF_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_TTF_Init' {$ENDIF} {$ENDIF};
@@ -252,15 +253,15 @@ function TTF_OpenFontIndex(file_: PAnsiChar; ptsize: cint; index: clong): PTTF_F
252253
* size becomes the index of choosing which size. If the value is too high,
253254
* the last indexed size will be the default.
254255
*
255-
* If `freesrc` is non-zero, the RWops will be closed before returning,
256-
* whether this function succeeds or not. SDL_ttf reads everything it needs
257-
* from the RWops during this call in any case.
256+
* If `freesrc` is non-zero, the RWops will be automatically closed once the
257+
* font is closed. Otherwise you should close the RWops yourself after closing
258+
* the font.
258259
*
259260
* When done with the returned TTF_Font, use TTF_CloseFont() to dispose of it.
260261
*
261262
* \param src an SDL_RWops to provide a font file's data.
262-
* \param freesrc non-zero to close the RWops before returning, zero to leave
263-
* it open.
263+
* \param freesrc non-zero to close the RWops when the font is closed, zero to
264+
* leave it open.
264265
* \param ptsize point size to use for the newly-opened font.
265266
* \returns a valid TTF_Font, or nil on error.
266267
*
@@ -278,9 +279,9 @@ function TTF_OpenFontRW(src: PSDL_RWops; freesrc: cint; ptsize: cint): PTTF_Font
278279
* size becomes the index of choosing which size. If the value is too high,
279280
* the last indexed size will be the default.
280281
*
281-
* If `freesrc` is non-zero, the RWops will be closed before returning,
282-
* whether this function succeeds or not. SDL_ttf reads everything it needs
283-
* from the RWops during this call in any case.
282+
* If `freesrc` is non-zero, the RWops will be automatically closed once the
283+
* font is closed. Otherwise you should close the RWops yourself after closing
284+
* the font.
284285
*
285286
* Some fonts have multiple "faces" included. The index specifies which face
286287
* to use from the font file. Font files with only one face should specify
@@ -289,8 +290,8 @@ function TTF_OpenFontRW(src: PSDL_RWops; freesrc: cint; ptsize: cint): PTTF_Font
289290
* When done with the returned TTF_Font, use TTF_CloseFont() to dispose of it.
290291
*
291292
* \param src an SDL_RWops to provide a font file's data.
292-
* \param freesrc non-zero to close the RWops before returning, zero to leave
293-
* it open.
293+
* \param freesrc non-zero to close the RWops when the font is closed, zero to
294+
* leave it open.
294295
* \param ptsize point size to use for the newly-opened font.
295296
* \param index index of the face in the font file.
296297
* \returns a valid TTF_Font, or nil on error.
@@ -364,15 +365,15 @@ function TTF_OpenFontIndexDPI(file_: PAnsiChar; ptsize: cint; index: clong; hdpi
364365
* size becomes the index of choosing which size. If the value is too high,
365366
* the last indexed size will be the default.
366367
*
367-
* If `freesrc` is non-zero, the RWops will be closed before returning,
368-
* whether this function succeeds or not. SDL_ttf reads everything it needs
369-
* from the RWops during this call in any case.
368+
* If `freesrc` is non-zero, the RWops will be automatically closed once the
369+
* font is closed. Otherwise you should close the RWops yourself after closing
370+
* the font.
370371
*
371372
* When done with the returned TTF_Font, use TTF_CloseFont() to dispose of it.
372373
*
373374
* \param src an SDL_RWops to provide a font file's data.
374-
* \param freesrc non-zero to close the RWops before returning, zero to leave
375-
* it open.
375+
* \param freesrc non-zero to close the RWops when the font is closed, zero to
376+
* leave it open.
376377
* \param ptsize point size to use for the newly-opened font.
377378
* \param hdpi the target horizontal DPI.
378379
* \param vdpi the target vertical DPI.
@@ -394,9 +395,9 @@ function TTF_OpenFontDPIRW(src: PSDL_RWops; freesrc: cint; ptsize: cint; hdpi: c
394395
* size becomes the index of choosing which size. If the value is too high,
395396
* the last indexed size will be the default.
396397
*
397-
* If `freesrc` is non-zero, the RWops will be closed before returning,
398-
* whether this function succeeds or not. SDL_ttf reads everything it needs
399-
* from the RWops during this call in any case.
398+
* If `freesrc` is non-zero, the RWops will be automatically closed once the
399+
* font is closed. Otherwise you should close the RWops yourself after closing
400+
* the font.
400401
*
401402
* Some fonts have multiple "faces" included. The index specifies which face
402403
* to use from the font file. Font files with only one face should specify
@@ -405,8 +406,8 @@ function TTF_OpenFontDPIRW(src: PSDL_RWops; freesrc: cint; ptsize: cint; hdpi: c
405406
* When done with the returned TTF_Font, use TTF_CloseFont() to dispose of it.
406407
*
407408
* \param src an SDL_RWops to provide a font file's data.
408-
* \param freesrc non-zero to close the RWops before returning, zero to leave
409-
* it open.
409+
* \param freesrc non-zero to close the RWops when the font is closed, zero to
410+
* leave it open.
410411
* \param ptsize point size to use for the newly-opened font.
411412
* \param index index of the face in the font file.
412413
* \param hdpi the target horizontal DPI.
@@ -670,10 +671,10 @@ function TTF_FontDescent(font: PTTF_Font): cint; cdecl;
670671
external TTF_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_TTF_FontDescent' {$ENDIF} {$ENDIF};
671672

672673
{*
673-
* Query the recommended spacing between lines of text for a font.
674+
* Query the spacing between lines of text for a font.
674675
*
675676
* \param font the font to query.
676-
* \returns the font's recommended spacing.
677+
* \returns the font's line spacing.
677678
*
678679
* \since This function is available since SDL_ttf 2.0.12.
679680
}
@@ -956,9 +957,9 @@ function TTF_SizeUNICODE(font: PTTF_Font; text: pcuint16; w: pcint; h: pcint): c
956957
* \param font the font to query.
957958
* \param text text to calculate, in Latin1 encoding.
958959
* \param measure_width maximum width, in pixels, available for the string.
960+
* \param extent on return, filled with latest calculated width.
959961
* \param count on return, filled with number of characters that can be
960962
* rendered.
961-
* \param extent on return, filled with latest calculated width.
962963
* \returns 0 if successful, -1 on error.
963964
*
964965
* \since This function is available since SDL_ttf 2.0.18.
@@ -981,9 +982,9 @@ function TTF_MeasureText(font: PTTF_Font; text: PAnsiChar; measure_width: cint;
981982
* \param font the font to query.
982983
* \param text text to calculate, in UTF-8 encoding.
983984
* \param measure_width maximum width, in pixels, available for the string.
985+
* \param extent on return, filled with latest calculated width.
984986
* \param count on return, filled with number of characters that can be
985987
* rendered.
986-
* \param extent on return, filled with latest calculated width.
987988
* \returns 0 if successful, -1 on error.
988989
*
989990
* \since This function is available since SDL_ttf 2.0.18.
@@ -1011,9 +1012,9 @@ function TTF_MeasureUTF8(font: PTTF_Font; text: PAnsiChar; measure_width: cint;
10111012
* \param font the font to query.
10121013
* \param text text to calculate, in UCS-2 encoding.
10131014
* \param measure_width maximum width, in pixels, available for the string.
1015+
* \param extent on return, filled with latest calculated width.
10141016
* \param count on return, filled with number of characters that can be
10151017
* rendered.
1016-
* \param extent on return, filled with latest calculated width.
10171018
* \returns 0 if successful, -1 on error.
10181019
*
10191020
* \since This function is available since SDL_ttf 2.0.18.
@@ -1312,6 +1313,7 @@ function TTF_RenderGlyph32_Solid(font: PTTF_Font; ch: cuint32; fg: TSDL_Color):
13121313
* \param font the font to render with.
13131314
* \param text text to render, in Latin1 encoding.
13141315
* \param fg the foreground color for the text.
1316+
* \param bg the background color for the text.
13151317
* \returns a new 8-bit, palettized surface, or nil if there was an error.
13161318
*
13171319
* \since This function is available since SDL_ttf 2.0.12.
@@ -1343,6 +1345,7 @@ function TTF_RenderText_Shaded(font: PTTF_Font; text: PAnsiChar; fg: TSDL_Color;
13431345
* \param font the font to render with.
13441346
* \param text text to render, in UTF-8 encoding.
13451347
* \param fg the foreground color for the text.
1348+
* \param bg the background color for the text.
13461349
* \returns a new 8-bit, palettized surface, or nil if there was an error.
13471350
*
13481351
* \since This function is available since SDL_ttf 2.0.12.
@@ -1378,6 +1381,7 @@ function TTF_RenderUTF8_Shaded(font: PTTF_Font; text: PAnsiChar; fg: TSDL_Color;
13781381
* \param font the font to render with.
13791382
* \param text text to render, in UCS-2 encoding.
13801383
* \param fg the foreground color for the text.
1384+
* \param bg the background color for the text.
13811385
* \returns a new 8-bit, palettized surface, or nil if there was an error.
13821386
*
13831387
* \since This function is available since SDL_ttf 2.0.12.
@@ -1411,6 +1415,7 @@ function TTF_RenderUNICODE_Shaded(font: PTTF_Font; text: pcuint16; fg: TSDL_Colo
14111415
* \param font the font to render with.
14121416
* \param text text to render, in Latin1 encoding.
14131417
* \param fg the foreground color for the text.
1418+
* \param bg the background color for the text.
14141419
* \returns a new 8-bit, palettized surface, or nil if there was an error.
14151420
*
14161421
* \since This function is available since SDL_ttf 2.0.18.
@@ -1440,6 +1445,7 @@ function TTF_RenderText_Shaded_Wrapped(font: PTTF_Font; text: PAnsiChar; fg: TSD
14401445
* \param font the font to render with.
14411446
* \param text text to render, in UTF-8 encoding.
14421447
* \param fg the foreground color for the text.
1448+
* \param bg the background color for the text.
14431449
* \returns a new 8-bit, palettized surface, or nil if there was an error.
14441450
*
14451451
* \since This function is available since SDL_ttf 2.0.18.
@@ -1476,6 +1482,7 @@ function TTF_RenderUTF8_Shaded_Wrapped(font: PTTF_Font; text: PAnsiChar; fg: TSD
14761482
* \param font the font to render with.
14771483
* \param text text to render, in UCS-2 encoding.
14781484
* \param fg the foreground color for the text.
1485+
* \param bg the background color for the text.
14791486
* \returns a new 8-bit, palettized surface, or nil if there was an error.
14801487
*
14811488
* \since This function is available since SDL_ttf 2.0.18.
@@ -1674,6 +1681,9 @@ function TTF_RenderUNICODE_Blended(font: PTTF_Font; text: pcuint16; fg: TSDL_Col
16741681
* \param font the font to render with.
16751682
* \param text text to render, in Latin1 encoding.
16761683
* \param fg the foreground color for the text.
1684+
* \param wrapLength the text is wrapped to multiple lines on line endings and
1685+
* on word boundaries if it extends beyond this value in
1686+
* pixels.
16771687
* \returns a new 32-bit, ARGB surface, or nil if there was an error.
16781688
*
16791689
* \since This function is available since SDL_ttf 2.0.18.
@@ -1702,6 +1712,9 @@ function TTF_RenderText_Blended_Wrapped(font: PTTF_Font; text: PAnsiChar; fg: TS
17021712
* \param font the font to render with.
17031713
* \param text text to render, in UTF-8 encoding.
17041714
* \param fg the foreground color for the text.
1715+
* \param wrapLength the text is wrapped to multiple lines on line endings and
1716+
* on word boundaries if it extends beyond this value in
1717+
* pixels.
17051718
* \returns a new 32-bit, ARGB surface, or nil if there was an error.
17061719
*
17071720
* \since This function is available since SDL_ttf 2.0.18.
@@ -1737,6 +1750,9 @@ function TTF_RenderUTF8_Blended_Wrapped(font: PTTF_Font; text: PAnsiChar; fg: TS
17371750
* \param font the font to render with.
17381751
* \param text text to render, in UCS-2 encoding.
17391752
* \param fg the foreground color for the text.
1753+
* \param wrapLength the text is wrapped to multiple lines on line endings and
1754+
* on word boundaries if it extends beyond this value in
1755+
* pixels.
17401756
* \returns a new 32-bit, ARGB surface, or nil if there was an error.
17411757
*
17421758
* \since This function is available since SDL_ttf 2.0.18.
@@ -2108,6 +2124,7 @@ function TTF_RenderUNICODE(font: PTTF_Font; text: pcuint16; fg, bg: TSDL_Color):
21082124
*
21092125
* \since This function is available since SDL_ttf 2.0.12.
21102126
*
2127+
* \sa TTF_OpenFont
21112128
* \sa TTF_OpenFontIndexDPIRW
21122129
* \sa TTF_OpenFontRW
21132130
* \sa TTF_OpenFontDPI

0 commit comments

Comments
 (0)