The bug
Hi, Persian is a RTL language and its character should connect to each other in some situations but some character behave bad in game.
Persian character is similar to Arabic character. we had some bugs in previous versions that Arabic character not connected together MC-181108
it is fixed and thank you but some problems still remain in Persian character.
the buggy characters are ی،گ،ک،پ،چ
the Unicode for Arabic ي is different from Unicode of Persian ی.
for example words in the file with name example.png (in attachment) should shown as (respectively) :
چتر
یار
پوزخند
گاو
کاه
this picture is with default game font. for better demonstration I add custom font to game in file "With Font.png" (in attachment). This problem is NOT limited in chat and appear in game menu, item names and etc.
Linked issues
is duplicated by
relates to
Attachments
Comments


Can this still be reproduced in 20w30a or later?

@miwob
Hi, Yes it is still like before
I will attach a screenshot.
Can confirm in 20w51a.

Still affects all versions up to 1.17

This bug seems to be the same as the bug with the Jawi letters (MC-226357)

Code analysis (23w18a)
Yarn names are used here: 23w18a+build.1
for 23w18a. The decompiled code shown below has been generated using Fabric’s fork of CFR.
Minecraft’s text rendering is basic and fails to handle complex scripts properly. In TextRenderer
(with constants manually unfolded):
public String mirror(String text) {
try {
Bidi bidi = new Bidi(new ArabicShaping(ArabicShaping.LETTERS_SHAPE).shape(text), Bidi.DIRECTION_DEFAULT_RIGHT_TO_LEFT);
bidi.setReorderingMode(Bidi.REORDER_DEFAULT);
return bidi.writeReordered(Bidi.DO_MIRRORING);
} catch (ArabicShapingException arabicShapingException) {
return text;
}
}
// ...
private int drawInternal(String text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumers, TextLayerType layerType, int backgroundColor, int light, boolean mirror) {
if (mirror) {
text = this.mirror(text);
}
color = TextRenderer.tweakTransparency(color);
Matrix4f matrix4f = new Matrix4f(matrix);
if (shadow) {
this.drawLayer(text, x, y, color, true, matrix, vertexConsumers, layerType, backgroundColor, light);
matrix4f.translate(FORWARD_SHIFT);
}
x = this.drawLayer(text, x, y, color, false, matrix4f, vertexConsumers, layerType, backgroundColor, light);
return (int)x + (shadow ? 1 : 0);
}
TextRenderer#mirror
uses ICU4J’s ArabicShaping
to replace Arabic-script codepoints with their equivalent presentation forms. It then reorders the characters in the string to visual order. The resulting string is displayed from left to right, rendering each character individually.
Unfortunately, ArabicShaping
does not reshape letters specific to languages other than Arabic, and there are many other scripts that cannot be shaped in this manner. Properly fixing this issue would require using a full-featured text shaping library and using a font format that supports shaping features.

In reply of @+merlan #flirora
"...The resulting string is displayed from left to right, rendering each character individually."
This is what to be expected in programs that do not have any support for Arabic characters. But actually the letters aren't shown individually, and the game shows the letter order and their renders correctly (except some which we'll discuss later). The only applied part could be if the sentences are mixed with English or other LtR languages, which is something totally else that is not our subject of this bug. In that case, it makes the split parts of the sentence backwards. As of now, the overall Arabic letters are still readable and is in the correct form.
Minecraft versions before 1.15 were fine. This bug has affected every single version of Minecraft after one of the snapshots. It was fixed for common Arabic letters but hasn't been fixed for some other letters (the exceptions I mentioned earlier) of languages that use the same Arabic letter writing. For this instance, Malay language is also affected as far as I'm aware.

> Minecraft versions before 1.15 were fine.
That’s not true – I’ve attached a screenshot from 1.10.2 that also shows this issue.
⚠️ Please do not mark Unreleased Versions as affected. You don't have access to them yet.
We have removed it and added the latest released version
Please edit the Affects Version/s field and select the specific Released Version you were using when you encountered the reported issue.
If you can't find it in the list, please make sure that:
You are in the correct project on the bug tracker.
You were playing the latest release version or the latest development version of the game.
This issue has been temporarily closed as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automagically! Please report any issues in Discord or Reddit