You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Restore per font oversampling override.
This commit is contained in:
@@ -2718,6 +2718,25 @@ void TextServerAdvanced::_font_set_variation_coordinates(const RID &p_font_rid,
|
||||
}
|
||||
}
|
||||
|
||||
double TextServerAdvanced::_font_get_oversampling(const RID &p_font_rid) const {
|
||||
FontAdvanced *fd = _get_font_data(p_font_rid);
|
||||
ERR_FAIL_NULL_V(fd, -1.0);
|
||||
|
||||
MutexLock lock(fd->mutex);
|
||||
return fd->oversampling_override;
|
||||
}
|
||||
|
||||
void TextServerAdvanced::_font_set_oversampling(const RID &p_font_rid, double p_oversampling) {
|
||||
FontAdvanced *fd = _get_font_data(p_font_rid);
|
||||
ERR_FAIL_NULL(fd);
|
||||
|
||||
MutexLock lock(fd->mutex);
|
||||
if (fd->oversampling_override != p_oversampling) {
|
||||
_font_clear_cache(fd);
|
||||
fd->oversampling_override = p_oversampling;
|
||||
}
|
||||
}
|
||||
|
||||
Dictionary TextServerAdvanced::_font_get_variation_coordinates(const RID &p_font_rid) const {
|
||||
FontAdvanced *fd = _get_font_data(p_font_rid);
|
||||
ERR_FAIL_NULL_V(fd, Dictionary());
|
||||
@@ -3902,7 +3921,9 @@ void TextServerAdvanced::_font_draw_glyph(const RID &p_font_rid, const RID &p_ca
|
||||
bool viewport_oversampling = false;
|
||||
float oversampling_factor = p_oversampling;
|
||||
if (p_oversampling <= 0.0) {
|
||||
if (vp_oversampling > 0.0) {
|
||||
if (fd->oversampling_override > 0.0) {
|
||||
oversampling_factor = fd->oversampling_override;
|
||||
} else if (vp_oversampling > 0.0) {
|
||||
oversampling_factor = vp_oversampling;
|
||||
viewport_oversampling = true;
|
||||
} else {
|
||||
@@ -4046,7 +4067,9 @@ void TextServerAdvanced::_font_draw_glyph_outline(const RID &p_font_rid, const R
|
||||
bool viewport_oversampling = false;
|
||||
float oversampling_factor = p_oversampling;
|
||||
if (p_oversampling <= 0.0) {
|
||||
if (vp_oversampling > 0.0) {
|
||||
if (fd->oversampling_override > 0.0) {
|
||||
oversampling_factor = fd->oversampling_override;
|
||||
} else if (vp_oversampling > 0.0) {
|
||||
oversampling_factor = vp_oversampling;
|
||||
viewport_oversampling = true;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user