v2.0.0: slightly reduced spacing for text blocks not separated by spaces

This commit is contained in:
Evan Debenham
2023-03-06 15:21:38 -05:00
parent 1adf202a04
commit 5509b63835

View File

@@ -215,7 +215,7 @@ public class RenderedTextBlock extends Component {
for (int i = 0; i < words.size(); i++){
RenderedText word = words.get(i);
if (word == SPACE){
x += 1.5f;
x += 1.667f;
} else if (word == NEWLINE) {
//newline
y += height+2f;
@@ -233,7 +233,7 @@ public class RenderedTextBlock extends Component {
//Chinese/Japanese always render every character separately without spaces however
while (Messages.lang() != Languages.CHINESE && Messages.lang() != Languages.JAPANESE
&& j < words.size() && words.get(j) != SPACE && words.get(j) != NEWLINE){
fullWidth += words.get(j).width() - 0.5f;
fullWidth += words.get(j).width() - 0.667f;
j++;
}
@@ -255,7 +255,7 @@ public class RenderedTextBlock extends Component {
//Note that spacing currently doesn't factor in halfwidth and fullwidth characters
//(e.g. Ideographic full stop)
x -= 0.5f;
x -= 0.667f;
}
}