mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
Merge commit godotengine/godot@88b9932ce1
This commit is contained in:
@@ -1695,6 +1695,25 @@ void TextServerFallback::_font_set_variation_coordinates(const RID &p_font_rid,
|
||||
}
|
||||
}
|
||||
|
||||
double TextServerFallback::_font_get_oversampling(const RID &p_font_rid) const {
|
||||
FontFallback *fd = _get_font_data(p_font_rid);
|
||||
ERR_FAIL_NULL_V(fd, -1.0);
|
||||
|
||||
MutexLock lock(fd->mutex);
|
||||
return fd->oversampling_override;
|
||||
}
|
||||
|
||||
void TextServerFallback::_font_set_oversampling(const RID &p_font_rid, double p_oversampling) {
|
||||
FontFallback *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 TextServerFallback::_font_get_variation_coordinates(const RID &p_font_rid) const {
|
||||
FontFallback *fd = _get_font_data(p_font_rid);
|
||||
ERR_FAIL_NULL_V(fd, Dictionary());
|
||||
@@ -2817,7 +2836,9 @@ void TextServerFallback::_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 {
|
||||
@@ -2961,7 +2982,9 @@ void TextServerFallback::_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 {
|
||||
|
||||
@@ -285,6 +285,7 @@ class TextServerFallback : 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;
|
||||
|
||||
@@ -706,6 +707,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