Please improve and increase slots from preview font pane [Solved]

Started by Mehrdad, Fri 10/03/2017 15:57:02

Previous topic - Next topic

Mehrdad

Quote from: Crimson Wizard on Wed 15/03/2017 18:06:21
Please, return it back for now.... I did not mean to force you to change it (you may have problems with that in some programs), I just needed to know what you are working with, because I wanted to make some experiments.

You mean is what is my work with ParsiNegar ? Sorry for bad English .
I used ParsiNegar for Farsi type in Photoshop , Premiere , .... And haven't any problem with it .  Only AGS have some issue with it that you know better than me.
If I don't understand your question please let me know
My official site: http://www.pershaland.com/

Crimson Wizard

Quote from: Mehrdad on Thu 16/03/2017 07:59:50
Quote from: Crimson Wizard on Wed 15/03/2017 18:06:21
Please, return it back for now.... I did not mean to force you to change it (you may have problems with that in some programs), I just needed to know what you are working with, because I wanted to make some experiments.

You mean is what is my work with ParsiNegar ? Sorry for bad English .
I used ParsiNegar for Farsi type in Photoshop , Premiere , .... And haven't any problem with it .  Only AGS have some issue with it that you know better than me.
If I don't understand your question please let me know

No, I mean  "Language for non-Unicode programs". Better return it to what you had before, because it can affect how some old programs, including AGS, work with text.


Regarding how to change the font. I would try following:

1. Create a text file (normal text file, not something like Word document).
2. Type every possible Persian letter (converted using ParsiNegar) from your font in that file to create some sort of "alphabet".
3. Save that text file in Unicode format.

What happens then, but probably I would have to do that:
4. Pick out unique symbols and sort the list by the order of letter codes.
5a. Use the standart ANSI character set (English) to know the codes of these letters in ANSI.
OR, if that won't work for some reason -
5b. Save a copy of that file, converting to ANSI format, and check the resulting codes there.
6. Write down a table of two columns:
Code of letter in UnicodeCode of letter in ANSI

Back to you:
7. Make a modification of your Persian font by moving letters to new codes.
8. Test in AGS.

Mehrdad

I don't see any different between last situation and now in  "Language for non-Unicode programs" .

There is great way .  Thanks a lot  . If you want any help for Persian language please let me know . ( It's similar to Arabic font but with a few more letters)

p.s : I get first post from Amin ( ParsiNegar author ) . That he said what is your font . I replied and ask Is it possible convert to ANSI or other trick in your program . I'm waiting to answer.
My official site: http://www.pershaland.com/

Snarky

Man, CW, you're going far above and beyond here!

One thing that puzzles me a little: even if Mehrdad moves the character glyphs to other slots in the font, won't the font coding that combines different glyphs to make up a full character still refer to the old slots, so that as soon as you get into compound characters or ligatures, the whole thing will break?

Crimson Wizard

#44
Quote from: Snarky on Thu 16/03/2017 09:14:36
One thing that puzzles me a little: even if Mehrdad moves the character glyphs to other slots in the font, won't the font coding that combines different glyphs to make up a full character still refer to the old slots, so that as soon as you get into compound characters or ligatures, the whole thing will break?

That is a good question. I am not a big expert in TTFs, although I probably learnt a little more while researching this issue.

How these special Persian fonts work: they require you to type 2 characters for 1 letter, first character corresponding to "modification" symbol, and second character corresponding to "base" symbol.
(That special typing program converts some Persian letters to combinations of 2 characters)
"Modification" symbols in font are given offset properties, that actually make them overlap following character. They do not have exact reference to what chars they need to overlap, I guess that could be anything (even incorrect combinations).
Hope my explanation makes sense; I am not really aware of proper terminology for all this.

Crimson Wizard

Just to make a little update, I decided to write a tiny utility program which will create a table of conversion between unicode font codes and ansi font codes. Because making such table by hand would be a chore.

My idea is to make a program that will analyze Unicode text, and converted ANSI text, and then write a table of correspondence between letter codes. This table is then used to modify letter codes in the font.

I guess this won't take long, but I need to find some free time.

Mehrdad

Great news CW . Thanks a lot for this plan . I'm waiting for your good news  ;-D
My official site: http://www.pershaland.com/

Snarky

So many hoops to jump through just because AGS doesn't support Unicode... :~(

Crimson Wizard

Alright, here is the program.
https://www.dropbox.com/s/ua0jdrd9xlgshcl/TextConvMapMaker_Build.zip?dl=0

I do not think I will be able to do much more to it.

Instructions:
1. Type all the Persian letters (whole alphabet) in the ParsiNegar, and convert text to use for you font, as usual.
2. Copy resulting text into my program, in the big field.
3. Click "Create map". You will see the table of letter codes, first column is letter (in your case that would be "pseudo-letter" from ParsiNegar), second - original Unicode codepoint, third - codepoint in the ANSI encoding of your system.
4. For convenience you may click "Save table" - that will print this table into simple text file.

5. Use this table to modify Persian font in your favorite TTF editor. What you need to do is to change each letter's code, according to this table. For example, if table sais like:
some letter123445
Then you need to find a letter with code 1234, and change that code to 45 (or make a copy of letter and paste it into slot 45).

Mehrdad

AWESOME !!!! . It seems works perfect . I replaced some letters in correct slots and now I have right words without any problem  ;-D
I only must improve all slots for start Farsi typing as 2th language after English in my game.

Many thanks, in advance, for your help and your great program

Mehrdad
My official site: http://www.pershaland.com/

Mehrdad

A little problem . I have equal number for different original codepoints . Where is my wrong ?

I think problem is choose Arabian unicode .  I can't see Persian unicode in list .

My official site: http://www.pershaland.com/

Crimson Wizard

Quote from: Mehrdad on Sat 18/03/2017 07:37:27
A little problem . I have equal number for different original codepoints . Where is my wrong ?
Not every Unicode letter can be converted to unique letters in ANSI automatically. If you have such letters, you would need to deal with them specially.

Quote from: Mehrdad on Sat 18/03/2017 07:37:27
I think problem is choose Arabian unicode .  I can't see Persian unicode in list .
As I was saying earlier, there is no ANSI codeset for Persian language in Windows.

That was the reason why I suggested to return your "Language for non-Unicode applications" to what you had before (English?). This setting is also used when you build your game in AGS.
Of course if you do that now, some codes may change and you need to edit font again.

Mehrdad

Quote from: Crimson Wizard on Sat 18/03/2017 13:14:42
Not every Unicode letter can be converted to unique letters in ANSI automatically. If you have such letters, you would need to deal with them specially.
But it's will be so hard by typing .Please see it :
   Ã Æ'   195    63
   Ã Å'   204    63
   Âº   186    63
   Ã¶   246    63
Quote
As I was saying earlier, there is no ANSI codeset for Persian language in Windows.

That was the reason why I suggested to return your "Language for non-Unicode applications" to what you had before (English?). This setting is also used when you build your game in AGS.
Of course if you do that now, some codes may change and you need to edit font again.

English is one of language my game and it's OK . Second is Persian . Sorry I don't understand . Did you mean I ignore it ? Or made a custom alphabet keyboard for Farsi ?
My official site: http://www.pershaland.com/

Crimson Wizard


Quote from: Mehrdad on Sat 18/03/2017 13:38:33
But it's will be so hard by typing .
Yes, it will be difficult. That is a problem with putting Unicode text into non-Unicode program, such as AGS.

The only thing I can suggest here is to first deal with simple letters, and then see how many free slots are there remaining in the font. If you still have free slots, you may use them for missing letters.
But if you do that, you will also have to change these letters in Parsi-Negar's texts.


Quote from: Mehrdad on Sat 18/03/2017 13:38:33
Quote from: Crimson Wizard on Sat 18/03/2017 13:14:42
As I was saying earlier, there is no ANSI codeset for Persian language in Windows.

That was the reason why I suggested to return your "Language for non-Unicode applications" to what you had before (English?). This setting is also used when you build your game in AGS.
Of course if you do that now, some codes may change and you need to edit font again.

English is one of language my game and it's OK . Second is Persian . Sorry I don't understand . Did you mean I ignore it ? Or made a custom alphabet keyboard for Farsi ?

No, that's not what I mean.
This setting "language for non-Unicode programs" is used when Unicode text is converted to non-Unicode. This is what AGS does, for example, when you put ParsiNegar's text in there, and then compile the game.
What I mean, is that different options may produce different results. I am suggesting to try changing it back to English and see if that reduces the number of letters that have same code.
I do not know if it will, but I think it's worth trying.

Mehrdad

OK . Finally done.

Your right CW . I back to English , Arabic ,.... and English was best result for "language for non-Unicode programs" option  . I improved all slots but 3 letters was complete missed without any rectangle slot even. So replaced to another slots that I don't need to them .

It seems works perfect now and ready to typing.

Thanks a lot for great advises.
My official site: http://www.pershaland.com/

Mehrdad

I have an issue with line break Farsi fonts for long words .Please see this example :
player.Say("!kLvaà‚¶ Iµ{ ¾M Iàâ,¬Â·A à‚ThL{¼i , kàÆ'¹¨à‚¶ à‚ºI¶jI{ pHoMH o«Ã,,j o#º ¦Ã,, à‚ThL{¼i pH à‚T¤» .ànA");

After run game it show :  o«Ã,,j o#º ¦Ã,, à‚ThL{¼i pH à‚T¤» .ànA    under    ¾M Iàâ,¬Â·A à‚ThL{¼i , kàÆ'¹¨à‚¶ à‚ºI¶jI{ pHoMH

I changed place two words and result was worse .

How AGS do it ? Is it any way for manually set break long words ?
My official site: http://www.pershaland.com/

Crimson Wizard

Quote from: Mehrdad on Thu 23/03/2017 07:51:46
How AGS do it ? Is it any way for manually set break long words ?

This is a common issue with autobreak, AFAIK AGS is breaking at nearest space character. But you can use '[' character to set line break.

Mehrdad

Quote from: Crimson Wizard on Thu 23/03/2017 08:04:57
This is a common issue with autobreak, AFAIK AGS is breaking at nearest space character. But you can use '[' character to set line break.

OK. Thanks. It's seems good when player stand on middle screen but in edges I have a messy words  :(   
My official site: http://www.pershaland.com/

SMF spam blocked by CleanTalk