FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Printing Arabic Text
Posts: 190
Joined: Tue Mar 14, 2006 01:59 AM
Printing Arabic Text
Posted: Fri Jan 26, 2007 01: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:
#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:
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
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: Printing Arabic Text
Posted: Wed Jul 06, 2011 04: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.



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 (fw): Select all Collapse
oFnt := TFont():New( "Courier New", 0, -11,,,,, 700,,,,, 3, 2, 1, oPrn )
it must be specified as,
Code (fw): Select all Collapse
#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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Printing Arabic Text
Posted: 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
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: Printing Arabic Text
Posted: Fri Jul 08, 2011 01:19 AM

Thanks Rao.

FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 190
Joined: Tue Mar 14, 2006 01:59 AM
Re: Printing Arabic Text
Posted: 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

Continue the discussion