Cobbletext  0.2.0
Complex text layout and rendering engine
library.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "macros.h"
4 
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8 
25 
26 
36 
42 
53 
61 const char * cobbletext_get_error_message(CobbletextLibrary * library);
62 
68 
74  CobbletextLibrary * library);
75 
87  const char * path);
88 
101  CobbletextLibrary * library, const uint8_t * data, uint32_t length,
102  int32_t face_index);
103 
121  CobbletextFontID font_id, CobbletextFontID fallback_font_id);
122 
130  CobbletextLibrary * library, CobbletextFontID font_id);
131 
141  CobbletextLibrary * library, CobbletextFontID font);
142 
152  CobbletextLibrary * library, CobbletextFontID glyph);
153 
154 #ifdef __cplusplus
155 }
156 #endif
cobbletext_library_set_font_alternative
void cobbletext_library_set_font_alternative(CobbletextLibrary *library, CobbletextFontID font_id, CobbletextFontID fallback_font_id)
Sets an alternative font to be used if glyphs are not in the font.
CobbletextGlyphInfo
Glyph properties.
Definition: glyph_info.h:12
cobbletext_get_error_message
const char * cobbletext_get_error_message(CobbletextLibrary *library)
Returns a textual version of the error code.
cobbletext_library_get_fallback_font
CobbletextFontID cobbletext_library_get_fallback_font(CobbletextLibrary *library)
Returns the ID for the built-in fallback font when there is no font loaded.
cobbletext_library_delete
void cobbletext_library_delete(CobbletextLibrary *library)
Frees a library context.
macros.h
cobbletext_clear_error
void cobbletext_clear_error(CobbletextLibrary *library)
Clears any error code or error message.
CobbletextLibrary
struct CobbletextLibrary CobbletextLibrary
Opaque handle to the library's context.
Definition: library.h:24
cobbletext_library_get_font_alternative
CobbletextFontID cobbletext_library_get_font_alternative(CobbletextLibrary *library, CobbletextFontID font_id)
Returns the alternative font for the given font.
CobbletextFontID
uint32_t CobbletextFontID
Unique font face ID.
Definition: common.h:18
cobbletext_library_load_font
CobbletextFontID cobbletext_library_load_font(CobbletextLibrary *library, const char *path)
Loads a font face from a file.
cobbletext_library_get_font_info
const struct CobbletextFontInfo * cobbletext_library_get_font_info(CobbletextLibrary *library, CobbletextFontID font)
Returns information about a loaded font.
cobbletext_library_load_font_bytes
CobbletextFontID cobbletext_library_load_font_bytes(CobbletextLibrary *library, const uint8_t *data, uint32_t length, int32_t face_index)
Loads a font face from the given bytes of a font file.
COBBLETEXT_API
#define COBBLETEXT_API
Macro for Windows C symbol import and export, Emscripten attribute.
Definition: macros.h:18
cobbletext_library_new
CobbletextLibrary * cobbletext_library_new()
Returns a new library context.
CobbletextFontInfo
Font face properties.
Definition: font_info.h:12
cobbletext_get_error_code
int32_t cobbletext_get_error_code(CobbletextLibrary *library)
Returns error code.
cobbletext_library_get_glyph_info
const struct CobbletextGlyphInfo * cobbletext_library_get_glyph_info(CobbletextLibrary *library, CobbletextFontID glyph)
Returns information about a glyph from a loaded font.