Convert unicode text to a font

???????? ?????
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Convert unicode text to a font

Post by Neo » Sun Apr 11, 2010 3:00 am

I'm not clear at all. The problem I see is you not reading posts or you don't like to understand. Instead you try to put an impossible thing in to reality while a correct method is available. However I'll try to explain as I understand. I just can't forget you ;)
but there is a problem with ASCILL and CHAR functions
What is ASCILL? Do you mean ASCII - American Standard Code for Information Interchange ? Or something you have in J2ME? I know Java but not worked with J2ME.
I think, creating a new FONTimage for unicode charactors is easy.
This question has no meaning. You try to get my point. First thing is you didn't read my answers clearly or your didn't understand. Here I'm telling you again.

Drawing a new font is not a hard job. You will have to draw characters for the whole alphabet.
Once the characters are drawn, each is called a Glyph. A collection of glyphs can be used to create either an ASCII font or a UNICODE font.

For example, if you have drawn the glyphs for sinhala language, you can create an ASCII font. You need to consider fitting the number of glyphs you have within a total of 255 (including numbers and special symbols which must be there). This is not possible for a language like Sinhala. In good old days, we have put those glyphs in two ASCII font files. Kandy and Kandy Supplement are such two TTF files of the same font.
After the introduction of UNICODE, Sinhala was regarded as a world language and given a large range to store glyphs. Read my article on that. So if you are going to put your glyphs inside a UNICODE font, you will have to place them in the right places of the UNICODE font as specified by the UNICODE standard. You can't place them according to your wish as in ASCII where you can place anywhere you want.

For example: The Sinhala letter ? can only be placed at the location 0DC3 of a UNICODE font.

So, creating glyphs (you mentioned as font images) for either ASCII or UNICODE Font has equal effort as long as the number of glyphs you draw is the same.
but there is a problem with ASCILL and CHAR functions with Unicode charactors.
Are you talking about functions in J2ME that are used to do operation on ASCII characters?
For sure, you can't use these for UNICODE. Read my text to understand that ASCII font can't carry more than 255 glyphs where as a UNICODE font can carry 65536 glyphs. So there must be a separate set of function for UNICODE.
is there any way to get ASCILL of a unicode charactor in PHP or JAVA?
This is the question that showed me you didn't read anything of my posts.
Okay, I still like to explain you ;)
On UNICODE, Sinhala language has its reserved area from 0D80–0DFF. Each number is mapped specifically for 1 character as said before. For example UNICODE ? is 0DC3. You can''t change this.

So you understand ASCII and UNICODE are completely two different things. You can't link them to map native languages to ASCII. There is no way to map. In other words, there is no special location for letter ? in ASCII where in UNICODE it is 0DC3.

So it is not even possible to write a function for this regardless of the language.

---------------------------------------------------------

Since I know what you are going to do, I see a small picture which you can do this quite easily.
  1. Download the web page to your system (This is called scraping). Say you get FF FE C3 0D B8 0D B1 0D BD 0D BA 0D CF 0D for "Samanalaya" as in my last post.
  2. Decode the UNICODE string
    1. Remove BOM (FFFE)
    2. Then decode each pair of bytes (Ex: 0D C3, in HEX two positions represent 1-byte)
    To understand all this, you need to save a web page with Sinhala UNICODE Characters and view using a HEX editor.
  3. Map UNICODE to your PNG images
    Now what is 0DC3 - This is a number in HEX. In decimal, this is 3523.
    So whenever you get 3523 (0DC3), you point to letter ? in your PNG image and draw it.
    So what you have to make is a lookup table to map all these UNICODE numbers to your PNG image.
This is very simple to implement in any language.

First thing is to concentrate on learning the theory. Don't try to push yourself too much on doing it in your own way when the things are already invented. Otherwise what you are trying is to invent the wheel at a time the world has sent satellites to the moon ;)
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

unicode and j2me

Post by Rksk » Sun Apr 11, 2010 7:39 pm

All rigth, i'm not going to invent somthing. only i want to solve my problems.

I agree with your post and i think your suggetions can be implement.

I have one thing to remember you, i didn't draw glyphs by hand, i drew them with autoit (the code has posted under the J2ME and sinhala topic) . but it can't draw unicode charactors like ascii charactors.

Anyway pls see these unicode charactors.
ODDA, ODDC, ODDD, ODDE..
these are very hard to assemble with glyphs. I have to work hard again to use them.
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Convert unicode text to a font

Post by Neo » Sun Apr 11, 2010 9:07 pm

You are right. It will not be an easy job especially when it comes to letter combinations.

However what you are trying to do is really great. Writing your own software is always encouraged other than waiting for free money to come. I know lots of rich people around the globe and I don't know anybody who became rich with free money.

So concentrate on making your own things and earn !!! RKSK is a very good example which made me help him by going out of the way. Good luck!!!
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

Re: Convert unicode text to a font

Post by Rksk » Sun Apr 11, 2010 10:11 pm

Thankz for your words neo!

i will try to do it and reply results...
Post Reply

Return to “???????? ?????”