Added variables to build SDL2_ttf with HarfBuzz and added functions to
the engine to support defining the text direction and script name
This commit is contained in:
1 parent
e04effec37
commit
79944cfa13
3 files changed
+37
No files matched your search
@@ -413,6 +413,32 @@ void set_font_asset_size(AssetID id, u32 size) {
|
||||
TTF_SetFontSize(font, size);
|
||||
}
|
||||
|
||||
i32 set_font_direction(AssetID id, FontDirection direction) {
|
||||
if (id < 0) {
|
||||
return -2;
|
||||
}
|
||||
|
||||
TTF_Font *font = get_font(GameEngine.asset_manager, id);
|
||||
if (!font) {
|
||||
return -2;
|
||||
}
|
||||
|
||||
return TTF_SetFontDirection(font, (TTF_Direction)direction);
|
||||
}
|
||||
|
||||
i32 set_font_script_name(AssetID id, const char *script) {
|
||||
if (id < 0) {
|
||||
return -2;
|
||||
}
|
||||
|
||||
TTF_Font *font = get_font(GameEngine.asset_manager, id);
|
||||
if (!font) {
|
||||
return -2;
|
||||
}
|
||||
|
||||
return TTF_SetFontScriptName(font, script);
|
||||
}
|
||||
|
||||
i8 play_audio_asset(AssetID id, i16 loops, bool fade_in,
|
||||
u32 fade_length_in_ms) {
|
||||
if (id < 0) {
|
||||
|
||||
Reference in new issue
Block a user