Skip to content

Commit

Permalink
fix MC-76356 Bold unicode characters appear doubled (#834)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulzzh authored Jan 5, 2025
1 parent d450461 commit 5db1edb
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,6 @@ public float drawString(final float anchorX, final float anchorY, final int colo
chr = MCFONT_CHARS.charAt(lutIndex);
}

final float shadowOffset = unicodeFlag ? 0.5F : 1.0F;

// Check ASCII space, NBSP, NNBSP
if (chr == ' ' || chr == '\u00A0' || chr == '\u202F') {
curX += 4;
Expand All @@ -452,13 +450,15 @@ public float drawString(final float anchorX, final float anchorY, final int colo
final float uSz;
final float vSz;
final float itOff = curItalic ? 1.0F : 0.0F; // italic offset
final float shadowOffset;
final ResourceLocation texture;

if (lutIndex == -1 || unicodeFlag) {
if (glyphWidth[chr] == 0) {
continue;
}
// Draw unicode char
shadowOffset = 0.5F;
final int uniPage = chr / 256;
texture = getUnicodePageLocation(uniPage);
final int startColumn = this.glyphWidth[chr] >>> 4;
Expand All @@ -475,6 +475,7 @@ public float drawString(final float anchorX, final float anchorY, final int colo

} else {
// Draw "ASCII" char
shadowOffset = 1.0F;
uStart = ((lutIndex % 16) * 8) / 128.0F;
vStart = (float) ((lutIndex / 16) * 8) / 128.0F;
xAdvance = this.charWidth[lutIndex];
Expand Down

0 comments on commit 5db1edb

Please sign in to comment.