Page 1 of 1

Printing Arabic Text

Posted: Fri Jan 26, 2007 1:41 am
by Davide
Hello all,

I have a text file containing some Arabic strings in Ansi format (saved with Notepad)

When "Regional And Language Options (RLO)" are set for english, I see them as, for example:

Code: Select all

#define TXT_LANG     "ÚÑÈí"
but when RLO are set for Arabic I see the right glyps in Notepad.
So far, so good.

My problem is that when RLO=Arabic I can correctly put and see that text in Messageboxes, Windows, menus etc., BUT in print jobs:

Code: Select all

oPrn:Say(row,col,TXT_LANG)
It seems that the text in oPrn:say() does not follow the RLO rules (I always see it as in English: "ÚÑÈí")

Should I manually apply some kind of conversion ?
(The source file is already Ansi, but I've tried all the combinations I know: OEMtoAnsi() - AnsiToWide() and viceversa)

Thanks
Davide
FWH27 - xH 0.99.60 - Bcc

Re: Printing Arabic Text

Posted: Wed Jul 06, 2011 4:28 am
by hua
Sorry for this necro post, but I'd like to share and record the knowledge of what have I found out while researching this issue just recently.

1. Most MS-Windows nowadays can be enabled to write Arabic characters. You could follow the instructions here or just simply google it.

In XP, this means playing around with Regional and Languages settings.

Image

2. For printing, define a font that supports the arabic character set. Specifying the character set wanted is a must. e.g. instead of just

Code: Select all

oFnt := TFont():New( "Courier New", 0, -11,,,,, 700,,,,, 3, 2, 1, oPrn )
it must be specified as,

Code: Select all

#define ARABIC_CHARSET 178

oFnt := TFont():New( "Courier New", 0, -11,,,,, 700,,,, ARABIC_CHARSET, 3, 2, 1, oPrn )

Detailed description on CreateFont() can be found at MSDN.

p.s. Antonio, would it be possible for DEFINE FONT to be enhanced so we could pass the character set too? TIA

Re: Printing Arabic Text

Posted: Fri Jul 08, 2011 12:56 am
by nageswaragunupudi
p.s. Antonio, would it be possible for DEFINE FONT to be enhanced so we could pass the character set too? TIA
Will be available from 11.07

Re: Printing Arabic Text

Posted: Fri Jul 08, 2011 1:19 am
by hua
Thanks Rao.

Re: Printing Arabic Text

Posted: Fri Jul 08, 2011 11:54 pm
by Davide
Dear Rao,
hua wrote:#define ARABIC_CHARSET 178

oFnt := TFont():New( "Courier New", 0, -11,,,,, 700,,,, ARABIC_CHARSET, 3, 2, 1, oPrn )
thank you. Would this work even for 2-bytes languages, such as chinese for example ?

Tnx,
Davide