Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix MC-76356 Bold unicode characters appear doubled #834

Merged
merged 1 commit into from
Jan 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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