Win a copy of Head First Go this week in the Go forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

how can I make arabic letters/characters Connected  RSS feed

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I open a new game but I got a problem. when I write in the Arabic Characters/Letters in Arabic Language, it doesn't show me Connected words. I then edited something because it was inverse, first time it was and the words are not Connected
م ك ي ل ع م ا ل س ل ا

but it must be
السلام عليكم

my code



if you want other code i have
and if you want more info i have too
 
Marshal
Posts: 24199
54
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi hassan, welcome to the Ranch!

You ask a very good question. Unfortunately we can't tell from your post where you are trying to write that text. Is it being displayed in a browser, or at a command line, or in a Swing or JavaFX text component? It's normally the job of the text component or browser or whatever to lay out the Arabic text with the appropriate ligatures to connect the letters together.
 
Paul Clapham
Marshal
Posts: 24199
54
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And by the way, I believe that after you execute lines 52 to 63, the String referred to by the message variable will be exactly the same as it was before those lines. So they could be removed without affecting anything.
 
hassan ibrahem
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:Hi hassan, welcome to the Ranch!

You ask a very good question. Unfortunately we can't tell from your post where you are trying to write that text. Is it being displayed in a browser, or at a command line, or in a Swing or JavaFX text component? It's normally the job of the text component or browser or whatever to lay out the Arabic text with the appropriate ligatures to connect the letters together.



hi any thank you ^_^

i try write it in chat game like this


if you need more info i will send ^_^ thank again
 
Paul Clapham
Marshal
Posts: 24199
54
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I'm completely unfamiliar with that product. But from the picture you posted it looks like Arabic script can be made to work in it.

I see the aiononline.com site (that's what you are using, right?) has forums and support. Perhaps you should ask over there? At least there might be more people familiar with the product.
 
hassan ibrahem
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:Sorry, I'm completely unfamiliar with that product. But from the picture you posted it looks like Arabic script can be made to work in it.

I see the aiononline.com site (that's what you are using, right?) has forums and support. Perhaps you should ask over there? At least there might be more people familiar with the product.



thank you for your replay
yes its aion
but code for server file :( so its manger of writing in game
if i make it true and support arabic will fix problem
 
Saloon Keeper
Posts: 20514
115
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are really 2 factors here. Kerning is the term that refers to adjusting the spacing between letters to make them look better as a unit. Ligatures are where two or more letters are typeset as though they were a single letter. Common ligatures for English typesetters include "ff" and "fi". Probably the most common ligature for Arabic is "la".

And then there's letter rendering. In Arabic, you don't just have the options of kerning and ligatures. An Arabic letter can be written in up to 4 different ways, depending on whether it is stand-alone, connected on the right, connected on the left, or both.

There's 3 main ways of addressing this. The easy way is to always use the disconnected form. As you have noted, this lacks beauty, but it's the simplest way of rendering, especially if you are in an environment that doesn't support variable-width character cells (glyphs). The second way is related. Find a font which doesn't look too ugly when you jam stand-alone characters next to each other and crunch them all together.

The third way is more challenging. Preferably you're keeping your actual text in Unicode, so you cannot simply indicate which of the 4 possible glyphs to render at any given point. Fortunately, the rules are quite simple, so it only takes a small amount of extra intelligence for a text-rendering graphics system to select the proper glyph for a letter, given its context. Technically, that means that you could have a fourth way - where your original source text indicates the glyphs to be used directly, but that's not something you'd want to do for any serious text-processing, since it complicates collating and probably even dictionary comparisons.


Given all that, what it means in practical terms are two main things: 1) do you have a font that supports the glyphs for all the possible character mutations? 2) do you have a rendering engine that can exploit those mutations?

If not, you're going to have to settle for whatever you can get.
 
Sheriff
Posts: 5750
149
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's what the letters in the first post look like in my browser:
UnconnectedLetters.png
[Thumbnail for UnconnectedLetters.png]
 
Tim Holloway
Saloon Keeper
Posts: 20514
115
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Knute Snortum wrote:Here's what the letters in the first post look like in my browser:



Not sure how that applies here, though, since it's not definite that the offending app is even running in a web browser environment.

I can see the "pretty" typesetting in Firefox, but again, depending on the fonts available, intelligence of the rendering engine and environmental settings (code page, etc.) Your Mileage May Vary.
 
hassan ibrahem
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank
but there are 2 file
1- for server
2- client
so i need edit from server and make it know i write with arabic language
this file for chat server
here

and this also here
 
hassan ibrahem
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:

Knute Snortum wrote:Here's what the letters in the first post look like in my browser:



Not sure how that applies here, though, since it's not definite that the offending app is even running in a web browser environment.

I can see the "pretty" typesetting in Firefox, but again, depending on the fonts available, intelligence of the rendering engine and environmental settings (code page, etc.) Your Mileage May Vary.



already used all font what i have but its from server sending
when server send it to client its send it like eng not Arabic because not know it
 
Saloon Keeper
Posts: 9869
199
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reversing Arabic characters is a mistake. You MUST put the characters in the same order that you read them, so to get the string that you want, the first character must be م, the second character must be ك, the third character must be ي, etcetera.

These character have an intrinsic reading direction of right to left. That means that even though the the rightmost character appears at index 0 in the string, a text renderer will still display it further to the right than the character at index 1. If the text renderer of the game does not do this, then reversing the characters will not help you and it will even make the situation worse because now the string represents a text that doesn't even make sense in Arabic.

Even IF the goal is to reverse the string, doing it character by character is a big mistake. For Arabic it doesn't really matter that much, because the Arabic characters can all be represented by a single UTF-16 code unit, but for languages that require more than one code unit to represent a character, you will completely corrupt the text.

To debug the program, add the following statement after you filter the message:

This should print "[06, 27, 06, 44, 06, 33, 06, 44, 06, 27, 06, 45, 00, 20, 06, 39, 06, 44, 06, 4a, 06, 43, 06, 45]" if your message is indeed السلام عليكم .
 
Tim Holloway
Saloon Keeper
Posts: 20514
115
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Huh. I was so obsessed with the spacing that I didn't even realize that the character order was wrong.

Yeah, I think that for that particular font, the glyph widths are negative numbers.
 
hassan ibrahem
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Reversing Arabic characters is a mistake. You MUST put the characters in the same order that you read them, so to get the string that you want, the first character must be م, the second character must be ك, the third character must be ي, etcetera.

These character have an intrinsic reading direction of right to left. That means that even though the the rightmost character appears at index 0 in the string, a text renderer will still display it further to the right than the character at index 1. If the text renderer of the game does not do this, then reversing the characters will not help you and it will even make the situation worse because now the string represents a text that doesn't even make sense in Arabic.

Even IF the goal is to reverse the string, doing it character by character is a big mistake. For Arabic it doesn't really matter that much, because the Arabic characters can all be represented by a single UTF-16 code unit, but for languages that require more than one code unit to represent a character, you will completely corrupt the text.

To debug the program, add the following statement after you filter the message:

This should print "[06, 27, 06, 44, 06, 33, 06, 44, 06, 27, 06, 45, 00, 20, 06, 39, 06, 44, 06, 4a, 06, 43, 06, 45]" if your message is indeed السلام عليكم .





The subject is a bit complicated
When the message is sent inside the game, it is sent as English characters and it will be separate
This is because the game files do not support the Arabic language so it will not perform any installation and conversion
So the idea here is to make server files do the installation and conversion if we made
Installation and conversion Before receiving the information will be correct
Because they are inverted, ready and correct when viewed in the chat box
 
Stephan van Hulst
Saloon Keeper
Posts: 9869
199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to explain this in more detail.

What do you mean by: "it is sent as English characters"? What characters? Do you have an example?

What installation and conversion does the game need to do? Why don't the files support Arabic? Do you mean that the encoding of the files is in ASCII?

Even if Arabic characters aren't supported, and you have to hack around this, why are the characters inverted at all? Why don't they appear in the String in reading order?
 
hassan ibrahem
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:You need to explain this in more detail.

What do you mean by: "it is sent as English characters"? What characters? Do you have an example?

What installation and conversion does the game need to do? Why don't the files support Arabic? Do you mean that the encoding of the files is in ASCII?

Even if Arabic characters aren't supported, and you have to hack around this, why are the characters inverted at all? Why don't they appear in the String in reading order?



hi im sorry because im to late

look first we have 2 file
file server (emulator) who make game run online
and file game (client)
chat game its on server file and its not support arabic because its not make for it
arabic language have different encoding so we need add that code
to make it support arabic
someone tell me we need (arabic shape) but idk how make this
 
Paul Clapham
Marshal
Posts: 24199
54
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

hassan ibrahem wrote:chat game its on server file and its not support arabic because its not make for it



As I said earlier, it's not the responsibility of the server to join up the Arabic characters and choose the correct shapes. It's the responsibility of the client to receive Unicode representations of Arabic characters and display them appropriately.
 
hassan ibrahem
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:

hassan ibrahem wrote:chat game its on server file and its not support arabic because its not make for it



As I said earlier, it's not the responsibility of the server to join up the Arabic characters and choose the correct shapes. It's the responsibility of the client to receive Unicode representations of Arabic characters and display them appropriately.



ah i know client nott support arabic so we need make server support arabic and make shape
and someone did it befor but we dont know how
 
hassan ibrahem
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:

hassan ibrahem wrote:chat game its on server file and its not support arabic because its not make for it



As I said earlier, it's not the responsibility of the server to join up the Arabic characters and choose the correct shapes. It's the responsibility of the client to receive Unicode representations of Arabic characters and display them appropriately.



what we trying do ?
we trying make the word true and shaped when it send to client and the client not need do anything just show it
 
Paul Clapham
Marshal
Posts: 24199
54
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

hassan ibrahem wrote:what we trying do ?
we trying make the word true and shaped when it send to client and the client not need do anything just show it



Good luck with that, then. Hopefully the client has some documentation about how you should be doing it.
 
Stephan van Hulst
Saloon Keeper
Posts: 9869
199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're giving us way too little info.

Anyway, this is not really a Java issue but a issue of the software you're using. I can only suggest you look at the makers of the game for support.
 
hassan ibrahem
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:You're giving us way too little info.

Anyway, this is not really a Java issue but a issue of the software you're using. I can only suggest you look at the makers of the game for support.




its java because all chat cod and file in java language
tell me what you need  info and i will send to you

this maybe will help
chat server in game
 
Stephan van Hulst
Saloon Keeper
Posts: 9869
199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you reversing the message? Don't reverse the message! Arabic is NOT reversed. Arabic just reads right to left.

Do you have a way to debug the server? Can you print something to the standard output and then read it? Can you log to a file and then access the file? If so, then log the return value of the following statement, right before the if-statement containing handleChatCommand(), right after the if-statement, and right after the filterMessage() call. Then enter a chat message in Arabic, and tell us what those three debug statements log.

Anyway, you can fiddle at the server-side all you want, but if the client can only interpret ASCII, or doesn't have BiDi support, or doesn't have a proper font for Arabic characters, then there's nothing you can do. The only thing you can do is make sure that the string that the server returns contains the proper characters in the proper read order (without ineffective tricks like revering the string). If the client can't handle that, then you need to take it up with the game makers, because it's NOT a Java issue.
 
hassan ibrahem
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank all

now i fixed it ^_^
and its write true now
 
Knute Snortum
Sheriff
Posts: 5750
149
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's great!  Care to share what you did?
 
hassan ibrahem
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Knute Snortum wrote:That's great!  Care to share what you did?


sure just wait i asked my friend how because he did it
and i will share it
 
I will open the floodgates of his own worst nightmare! All in a tiny ad:
Become a Java guru with IntelliJ IDEA
https://www.jetbrains.com/idea/
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!