diff options
Diffstat (limited to 'modules/text_server_adv/text_server_adv.cpp')
| -rw-r--r-- | modules/text_server_adv/text_server_adv.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp index 09a037fd28..361d88af90 100644 --- a/modules/text_server_adv/text_server_adv.cpp +++ b/modules/text_server_adv/text_server_adv.cpp @@ -851,7 +851,7 @@ _FORCE_INLINE_ TextServerAdvanced::FontTexturePosition TextServerAdvanced::find_ { // Zero texture. uint8_t *w = tex.image->ptrw(); - ERR_FAIL_COND_V(texsize * texsize * p_color_size > tex.image->data_size(), ret); + ERR_FAIL_COND_V(texsize * texsize * p_color_size > tex.image->get_data_size(), ret); // Initialize the texture to all-white pixels to prevent artifacts when the // font is displayed at a non-default scale with filtering enabled. if (p_color_size == 2) { @@ -1040,7 +1040,7 @@ _FORCE_INLINE_ TextServerAdvanced::FontGlyph TextServerAdvanced::rasterize_msdf( for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { int ofs = ((i + tex_pos.y + p_rect_margin * 2) * tex.texture_w + j + tex_pos.x + p_rect_margin * 2) * 4; - ERR_FAIL_COND_V(ofs >= tex.image->data_size(), FontGlyph()); + ERR_FAIL_COND_V(ofs >= tex.image->get_data_size(), FontGlyph()); wr[ofs + 0] = (uint8_t)(CLAMP(image(j, i)[0] * 256.f, 0.f, 255.f)); wr[ofs + 1] = (uint8_t)(CLAMP(image(j, i)[1] * 256.f, 0.f, 255.f)); wr[ofs + 2] = (uint8_t)(CLAMP(image(j, i)[2] * 256.f, 0.f, 255.f)); @@ -1118,7 +1118,7 @@ _FORCE_INLINE_ TextServerAdvanced::FontGlyph TextServerAdvanced::rasterize_bitma for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { int ofs = ((i + tex_pos.y + p_rect_margin * 2) * tex.texture_w + j + tex_pos.x + p_rect_margin * 2) * color_size; - ERR_FAIL_COND_V(ofs >= tex.image->data_size(), FontGlyph()); + ERR_FAIL_COND_V(ofs >= tex.image->get_data_size(), FontGlyph()); switch (p_bitmap.pixel_mode) { case FT_PIXEL_MODE_MONO: { int byte = i * p_bitmap.pitch + (j >> 3); @@ -2468,7 +2468,7 @@ int64_t TextServerAdvanced::_font_get_spacing(const RID &p_font_rid, SpacingType } } -void TextServerAdvanced::_font_set_baseline_offset(const RID &p_font_rid, float p_baseline_offset) { +void TextServerAdvanced::_font_set_baseline_offset(const RID &p_font_rid, double p_baseline_offset) { FontAdvancedLinkedVariation *fdv = font_var_owner.get_or_null(p_font_rid); if (fdv) { if (fdv->baseline_offset != p_baseline_offset) { @@ -2486,7 +2486,7 @@ void TextServerAdvanced::_font_set_baseline_offset(const RID &p_font_rid, float } } -float TextServerAdvanced::_font_get_baseline_offset(const RID &p_font_rid) const { +double TextServerAdvanced::_font_get_baseline_offset(const RID &p_font_rid) const { FontAdvancedLinkedVariation *fdv = font_var_owner.get_or_null(p_font_rid); if (fdv) { return fdv->baseline_offset; @@ -7142,9 +7142,7 @@ PackedInt32Array TextServerAdvanced::_string_get_character_breaks(const String & } ubrk_close(bi); } else { - for (int i = 0; i <= p_string.size(); i++) { - ret.push_back(i); - } + return TextServer::string_get_character_breaks(p_string, p_language); } return ret; @@ -7342,7 +7340,7 @@ bool TextServerAdvanced::_is_valid_identifier(const String &p_string) const { return true; } -bool TextServerAdvanced::_is_valid_letter(char32_t p_unicode) const { +bool TextServerAdvanced::_is_valid_letter(uint64_t p_unicode) const { #ifndef ICU_STATIC_DATA if (!icu_data_loaded) { return TextServer::is_valid_letter(p_unicode); |
