Printing Arabic Text

Printing Arabic Text

Postby Davide » Fri Jan 26, 2007 1:41 am

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  Expand view
#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  Expand view
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
Davide
 
Posts: 190
Joined: Tue Mar 14, 2006 1:59 am
Location: Italy

Re: Printing Arabic Text

Postby hua » Wed Jul 06, 2011 4:28 am

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  Expand view
oFnt := TFont():New( "Courier New", 0, -11,,,,, 700,,,,, 3, 2, 1, oPrn )
it must be specified as,
Code: Select all  Expand view

#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
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: Printing Arabic Text

Postby nageswaragunupudi » Fri Jul 08, 2011 12:56 am

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
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Printing Arabic Text

Postby hua » Fri Jul 08, 2011 1:19 am

Thanks Rao.
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: Printing Arabic Text

Postby Davide » Fri Jul 08, 2011 11:54 pm

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
Davide
 
Posts: 190
Joined: Tue Mar 14, 2006 1:59 am
Location: Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 74 guests