Skip to content

Commit

Permalink
Sync SDL3_ttf header -> wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
SDLWikiBot committed Jan 30, 2025
1 parent 75f29a6 commit c513cf0
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 15 deletions.
4 changes: 2 additions & 2 deletions SDL3_ttf/QuickReference.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ bool TTF_SetFontScript(TTF_Font *font, Uint32 script);
Uint32 TTF_GetFontScript(TTF_Font *font); // Get the script used for text shaping a font.
Uint32 TTF_GetGlyphScript(Uint32 ch); // Get the script used by a 32-bit codepoint.
bool TTF_FontHasGlyph(TTF_Font *font, Uint32 ch); // Check whether a glyph is provided by the font for a UNICODE codepoint.
SDL_Surface * TTF_GetGlyphImage(TTF_Font *font, Uint32 ch); // Get the pixel image for a UNICODE codepoint.
SDL_Surface * TTF_GetGlyphImageForIndex(TTF_Font *font, Uint32 glyph_index); // Get the pixel image for a character index.
SDL_Surface * TTF_GetGlyphImage(TTF_Font *font, Uint32 ch, TTF_ImageType *image_type); // Get the pixel image for a UNICODE codepoint.
SDL_Surface * TTF_GetGlyphImageForIndex(TTF_Font *font, Uint32 glyph_index, TTF_ImageType *image_type); // Get the pixel image for a character index.
bool TTF_GetGlyphMetrics(TTF_Font *font, Uint32 ch, int *minx, int *maxx, int *miny, int *maxy, int *advance); // Query the metrics (dimensions) of a font's glyph for a UNICODE codepoint.
bool TTF_GetStringSize(TTF_Font *font, const char *text, size_t length, int *w, int *h); // Calculate the dimensions of a rendered string of UTF-8 text.
bool TTF_GetStringSizeWrapped(TTF_Font *font, const char *text, size_t length, int wrap_width, int *w, int *h); // Calculate the dimensions of a rendered string of UTF-8 text.
Expand Down
4 changes: 2 additions & 2 deletions SDL3_ttf/QuickReferenceNoUnicode.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ bool TTF_SetFontScript(TTF_Font *font, Uint32 script);
Uint32 TTF_GetFontScript(TTF_Font *font); // Get the script used for text shaping a font.
Uint32 TTF_GetGlyphScript(Uint32 ch); // Get the script used by a 32-bit codepoint.
bool TTF_FontHasGlyph(TTF_Font *font, Uint32 ch); // Check whether a glyph is provided by the font for a UNICODE codepoint.
SDL_Surface * TTF_GetGlyphImage(TTF_Font *font, Uint32 ch); // Get the pixel image for a UNICODE codepoint.
SDL_Surface * TTF_GetGlyphImageForIndex(TTF_Font *font, Uint32 glyph_index); // Get the pixel image for a character index.
SDL_Surface * TTF_GetGlyphImage(TTF_Font *font, Uint32 ch, TTF_ImageType *image_type); // Get the pixel image for a UNICODE codepoint.
SDL_Surface * TTF_GetGlyphImageForIndex(TTF_Font *font, Uint32 glyph_index, TTF_ImageType *image_type); // Get the pixel image for a character index.
bool TTF_GetGlyphMetrics(TTF_Font *font, Uint32 ch, int *minx, int *maxx, int *miny, int *maxy, int *advance); // Query the metrics (dimensions) of a font's glyph for a UNICODE codepoint.
bool TTF_GetStringSize(TTF_Font *font, const char *text, size_t length, int *w, int *h); // Calculate the dimensions of a rendered string of UTF-8 text.
bool TTF_GetStringSizeWrapped(TTF_Font *font, const char *text, size_t length, int wrap_width, int *w, int *h); // Calculate the dimensions of a rendered string of UTF-8 text.
Expand Down
2 changes: 1 addition & 1 deletion SDL3_ttf/TTF_GPUAtlasDrawSequence.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ typedef struct TTF_GPUAtlasDrawSequence
int num_vertices; /**< Number of vertices */
int *indices; /**< An array of indices into the 'vertices' arrays */
int num_indices; /**< Number of indices */
Uint32 flags; /**< TTF_CopyOperationFlags */
TTF_ImageType image_type; /**< The image type of this draw sequence */

struct TTF_GPUAtlasDrawSequence *next; /**< The next sequence (will be NULL in case of the last sequence) */
} TTF_GPUAtlasDrawSequence;
Expand Down
11 changes: 6 additions & 5 deletions SDL3_ttf/TTF_GetGlyphImage.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ Defined in [<SDL3_ttf/SDL_ttf.h>](https://github.com/libsdl-org/SDL_ttf/blob/mai
## Syntax

```c
SDL_Surface * TTF_GetGlyphImage(TTF_Font *font, Uint32 ch);
SDL_Surface * TTF_GetGlyphImage(TTF_Font *font, Uint32 ch, TTF_ImageType *image_type);
```
## Function Parameters
| | | |
| ---------------------- | -------- | ----------------------- |
| [TTF_Font](TTF_Font) * | **font** | the font to query. |
| Uint32 | **ch** | the codepoint to check. |
| | | |
| -------------------------------- | -------------- | ----------------------------------------------------------- |
| [TTF_Font](TTF_Font) * | **font** | the font to query. |
| Uint32 | **ch** | the codepoint to check. |
| [TTF_ImageType](TTF_ImageType) * | **image_type** | a pointer filled in with the glyph image type, may be NULL. |
## Return Value
Expand Down
11 changes: 6 additions & 5 deletions SDL3_ttf/TTF_GetGlyphImageForIndex.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ Defined in [<SDL3_ttf/SDL_ttf.h>](https://github.com/libsdl-org/SDL_ttf/blob/mai
## Syntax

```c
SDL_Surface * TTF_GetGlyphImageForIndex(TTF_Font *font, Uint32 glyph_index);
SDL_Surface * TTF_GetGlyphImageForIndex(TTF_Font *font, Uint32 glyph_index, TTF_ImageType *image_type);
```
## Function Parameters
| | | |
| ---------------------- | --------------- | --------------------------------- |
| [TTF_Font](TTF_Font) * | **font** | the font to query. |
| Uint32 | **glyph_index** | the index of the glyph to return. |
| | | |
| -------------------------------- | --------------- | ----------------------------------------------------------- |
| [TTF_Font](TTF_Font) * | **font** | the font to query. |
| Uint32 | **glyph_index** | the index of the glyph to return. |
| [TTF_ImageType](TTF_ImageType) * | **image_type** | a pointer filled in with the glyph image type, may be NULL. |
## Return Value
Expand Down
8 changes: 8 additions & 0 deletions SDL3_ttf/TTF_IMAGE_ALPHA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
###### (This function is part of SDL_ttf, a separate library from SDL.)
# TTF_IMAGE_ALPHA

Please refer to [TTF_ImageType](TTF_ImageType) for details.

----
[CategoryAPI](CategoryAPI), [CategoryAPIEnumerators](CategoryAPIEnumerators)

8 changes: 8 additions & 0 deletions SDL3_ttf/TTF_IMAGE_COLOR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
###### (This function is part of SDL_ttf, a separate library from SDL.)
# TTF_IMAGE_COLOR

Please refer to [TTF_ImageType](TTF_ImageType) for details.

----
[CategoryAPI](CategoryAPI), [CategoryAPIEnumerators](CategoryAPIEnumerators)

8 changes: 8 additions & 0 deletions SDL3_ttf/TTF_IMAGE_INVALID.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
###### (This function is part of SDL_ttf, a separate library from SDL.)
# TTF_IMAGE_INVALID

Please refer to [TTF_ImageType](TTF_ImageType) for details.

----
[CategoryAPI](CategoryAPI), [CategoryAPIEnumerators](CategoryAPIEnumerators)

8 changes: 8 additions & 0 deletions SDL3_ttf/TTF_IMAGE_SDF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
###### (This function is part of SDL_ttf, a separate library from SDL.)
# TTF_IMAGE_SDF

Please refer to [TTF_ImageType](TTF_ImageType) for details.

----
[CategoryAPI](CategoryAPI), [CategoryAPIEnumerators](CategoryAPIEnumerators)

28 changes: 28 additions & 0 deletions SDL3_ttf/TTF_ImageType.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
###### (This function is part of SDL_ttf, a separate library from SDL.)
# TTF_ImageType

The type of data in a glyph image

## Header File

Defined in [<SDL3_ttf/SDL_ttf.h>](https://github.com/libsdl-org/SDL_ttf/blob/main/include/SDL3_ttf/SDL_ttf.h)

## Syntax

```c
typedef enum TTF_ImageType
{
TTF_IMAGE_INVALID,
TTF_IMAGE_ALPHA, /**< The color channels are white */
TTF_IMAGE_COLOR, /**< The color channels have image data */
TTF_IMAGE_SDF, /**< The alpha channel has signed distance field information */
} TTF_ImageType;
```

## Version

This enum is available since SDL_ttf 3.0.0.

----
[CategoryAPI](CategoryAPI), [CategoryAPIEnum](CategoryAPIEnum), [CategorySDLTTF](CategorySDLTTF)

0 comments on commit c513cf0

Please sign in to comment.