mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
Add String::remove_char(s) methods for performance and convenience
This commit is contained in:
@@ -341,7 +341,7 @@ class TextServerFallback : public TextServerExtension {
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ int _font_get_weight_by_name(const String &p_sty_name) const {
|
||||
String sty_name = p_sty_name.replace(" ", "").replace("-", "");
|
||||
String sty_name = p_sty_name.remove_chars(" -");
|
||||
if (sty_name.contains("thin") || sty_name.contains("hairline")) {
|
||||
return 100;
|
||||
} else if (sty_name.contains("extralight") || sty_name.contains("ultralight")) {
|
||||
@@ -368,7 +368,7 @@ class TextServerFallback : public TextServerExtension {
|
||||
return 400;
|
||||
}
|
||||
_FORCE_INLINE_ int _font_get_stretch_by_name(const String &p_sty_name) const {
|
||||
String sty_name = p_sty_name.replace(" ", "").replace("-", "");
|
||||
String sty_name = p_sty_name.remove_chars(" -");
|
||||
if (sty_name.contains("ultracondensed")) {
|
||||
return 50;
|
||||
} else if (sty_name.contains("extracondensed")) {
|
||||
|
||||
Reference in New Issue
Block a user