@@ -3865,8 +3865,12 @@ void TextServerAdvanced::_font_draw_glyph(const RID &p_font_rid, const RID &p_ca
38653865 }
38663866 }
38673867 bool skip_oversampling = fd->msdf || fd->fixed_size > 0 ;
3868- uint64_t oversampling_level = CLAMP (oversampling_factor, 0.1 , 100.0 ) * 64 ;
3869- oversampling_factor = double (oversampling_level) / 64.0 ;
3868+ if (skip_oversampling) {
3869+ oversampling_factor = 1.0 ;
3870+ } else {
3871+ uint64_t oversampling_level = CLAMP (oversampling_factor, 0.1 , 100.0 ) * 64 ;
3872+ oversampling_factor = double (oversampling_level) / 64.0 ;
3873+ }
38703874
38713875 Vector2i size;
38723876 if (skip_oversampling) {
@@ -3943,8 +3947,8 @@ void TextServerAdvanced::_font_draw_glyph(const RID &p_font_rid, const RID &p_ca
39433947 Size2 csize = fgl.rect .size * (double )p_size / (double )fd->msdf_source_size ;
39443948 RenderingServer::get_singleton ()->canvas_item_add_msdf_texture_rect_region (p_canvas, Rect2 (cpos, csize), texture, fgl.uv_rect , modulate, 0 , fd->msdf_range , (double )p_size / (double )fd->msdf_source_size );
39453949 } else {
3946- double scale = _font_get_scale (p_font_rid, p_size) / oversampling_factor;
39473950 Point2 cpos = p_pos;
3951+ double scale = _font_get_scale (p_font_rid, p_size) / oversampling_factor;
39483952 if ((fd->subpixel_positioning == SUBPIXEL_POSITIONING_ONE_QUARTER) || (fd->subpixel_positioning == SUBPIXEL_POSITIONING_AUTO && size.x <= SUBPIXEL_POSITIONING_ONE_QUARTER_MAX_SIZE * 64 )) {
39493953 cpos.x = cpos.x + 0.125 ;
39503954 } else if ((fd->subpixel_positioning == SUBPIXEL_POSITIONING_ONE_HALF) || (fd->subpixel_positioning == SUBPIXEL_POSITIONING_AUTO && size.x <= SUBPIXEL_POSITIONING_ONE_HALF_MAX_SIZE * 64 )) {
@@ -4005,14 +4009,18 @@ void TextServerAdvanced::_font_draw_glyph_outline(const RID &p_font_rid, const R
40054009 }
40064010 }
40074011 bool skip_oversampling = fd->msdf || fd->fixed_size > 0 ;
4008- uint64_t oversampling_level = CLAMP (oversampling_factor, 0.1 , 100.0 ) * 64 ;
4009- oversampling_factor = double (oversampling_level) / 64.0 ;
4012+ if (skip_oversampling) {
4013+ oversampling_factor = 1.0 ;
4014+ } else {
4015+ uint64_t oversampling_level = CLAMP (oversampling_factor, 0.1 , 100.0 ) * 64 ;
4016+ oversampling_factor = double (oversampling_level) / 64.0 ;
4017+ }
40104018
40114019 Vector2i size;
40124020 if (skip_oversampling) {
40134021 size = _get_size_outline (fd, Vector2i (p_size, p_outline_size));
40144022 } else {
4015- size = Vector2i (p_size * 64 * oversampling_factor, p_outline_size);
4023+ size = Vector2i (p_size * 64 * oversampling_factor, p_outline_size * oversampling_factor );
40164024 }
40174025
40184026 FontForSizeAdvanced *ffsd = nullptr ;
0 commit comments