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 {
|
||||
|
||||
@ -344,6 +344,7 @@ class TextServerAdvanced : public TextServerExtension {
|
||||
TextServer::SubpixelPositioning subpixel_positioning = TextServer::SUBPIXEL_POSITIONING_AUTO;
|
||||
bool keep_rounding_remainders = true;
|
||||
Dictionary variation_coordinates;
|
||||
double oversampling_override = 0.0;
|
||||
double embolden = 0.0;
|
||||
Transform2D transform;
|
||||
|
||||
@ -849,6 +850,9 @@ public:
|
||||
MODBIND2(font_set_variation_coordinates, const RID &, const Dictionary &);
|
||||
MODBIND1RC(Dictionary, font_get_variation_coordinates, const RID &);
|
||||
|
||||
MODBIND2(font_set_oversampling, const RID &, double);
|
||||
MODBIND1RC(double, font_get_oversampling, const RID &);
|
||||
|
||||
MODBIND2(font_set_hinting, const RID &, TextServer::Hinting);
|
||||
MODBIND1RC(TextServer::Hinting, font_get_hinting, const RID &);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user