Page 1 of 2

National characters on display

PostPosted: Fri Dec 14, 2007 3:57 pm
by Grzegorz
How to force Windows CE on Psion to display polish national characters?

function Main()

local oWnd, oFont

Request Hb_Lang_PLWIN
Request Hb_CodePage_PLWIN

Hb_LangSelect ('PLWIN')
Hb_SetCodePage ('PLWIN')

DEFINE FONT oFont NAME "times" SIZE 10, 18

DEFINE WINDOW oWnd TITLE "Tutor05"

@ 1, 2 SAY cmonth( date() ) FONT oFont

return

The names of month are on polish language but specific polish characters are replaced with Western language characters.

PostPosted: Fri Dec 14, 2007 4:05 pm
by Antonio Linares
Grzegorz,

> specific polish characters are replaced with Western language characters

Do those polish characters look fine in Pocket Word using the same font ?

PostPosted: Mon Dec 17, 2007 9:25 am
by Grzegorz
Antonio Linares wrote:Grzegorz,

> specific polish characters are replaced with Western language characters

Do those polish characters look fine in Pocket Word using the same font ?


No, this characters are the same like in FiveWin, Alt + 241 = ñ, instead of ń. Polish characters are displey only in names if months in system calendar.

PostPosted: Mon Dec 17, 2007 10:06 am
by Antonio Linares
Have you properly configured your Pocket PC in Settings-System-Regional Settings-Region ?

PostPosted: Mon Dec 17, 2007 10:37 am
by Grzegorz
Antonio Linares wrote:Have you properly configured your Pocket PC in Settings-System-Regional Settings-Region ?


In Regional Settings Properties J have Polish in Your Locale but User Interface Language is not available ( is English ).

PostPosted: Mon Dec 17, 2007 11:09 am
by Antonio Linares
If Polish is not supported by Windows Mobile (it seems quite strange), then you may need to build your own function to properly translate your chars into the right ones:

TextToPolish( <cText> ) --> <cPolishText>

Unfortunately we don't know Polish so we can't help you there :-(
but its not a difficult function to build

PostPosted: Mon Dec 17, 2007 1:58 pm
by Grzegorz
Antonio Linares wrote:If Polish is not supported by Windows Mobile (it seems quite strange), then you may need to build your own function to properly translate your chars into the right ones:

TextToPolish( <cText> ) --> <cPolishText>

Unfortunately we don't know Polish so we can't help you there :-(
but its not a difficult function to build


Problem isn't in translate characters to Polish but with display characters on screen.
I test font.prg ( from FWPPC\Source\Classes ) and it seems I can't change fonts. I change font in DEFAULT statment cFaceName.
TWindow() : New()
oF := TWindow() : GetFont()
oF:cFaceName always is MS San Serif

PostPosted: Mon Dec 17, 2007 2:58 pm
by Antonio Linares
Please check in Pocket Word what fonts are availables

PostPosted: Mon Dec 17, 2007 3:34 pm
by Grzegorz
Antonio Linares wrote:Please check in Pocket Word what fonts are availables

I have only WordPad. There are Times New Roman, Courier New, Symbol, Tahoma, Wingdings.

PostPosted: Tue Dec 18, 2007 12:28 am
by Antonio Linares
Then you can only use those fonts unless you install more fonts on it.

Please review samples\Test2.prg to see how to manage fonts

PostPosted: Tue Dec 18, 2007 8:59 am
by Grzegorz
Antonio Linares wrote:Then you can only use those fonts unless you install more fonts on it.

Please review samples\Test2.prg to see how to manage fonts


I test this sample:

function Main()

local oWnd, oFont, cChar, oFont1, oFont2, oFont3, oFont4

Request Hb_Lang_PLWIN
Request Hb_CodePage_PLWIN

Hb_LangSelect ('PLWIN')
Hb_SetCodePage ('PLWIN')

DEFINE FONT oFont NAME "Verdana" SIZE 8, -12
DEFINE FONT oFont1 NAME "Courier New" SIZE 8, -12
DEFINE FONT oFont2 NAME "times" SIZE 8, -12
DEFINE FONT oFont3 NAME "Times New Roman" SIZE 8, -12
DEFINE FONT oFont4 NAME "Tahoma" SIZE 8, -12

oFont:nCharSet := 238 // change to East Europe char set
oFont1:nCharSet := 238 // seems to do nothing
oFont2:nCharSet := 238
oFont3:nCharSet := 238
oFont4:nCharSet := 238

DEFINE WINDOW oWnd
cChar := cmonth( date() )

@ 1, 1 SAY cCHar SIZE 234, 17 FONT oFont
@ 2, 1 say "ąćęłńóśżź " FONT oFont
@ 3, 1 say str( len ( oFont:cFaceName ) )+' ' +oFont:cFaceName


@ 4, 1 SAY cCHar SIZE 234, 17 FONT oFont1
@ 5, 1 say "ąćęłńóśżź " FONT oFont1
@ 6, 1 say str( len ( oFont1:cFaceName ) )+' ' +oFont1:cFaceName


@ 7, 1 SAY cCHar SIZE 234, 17 FONT oFont2
@ 8, 1 say "ąćęłńóśżź " FONT oFont2
@ 9, 1 say str( len ( oFont2:cFaceName ) )+' ' +oFont2:cFaceName


@ 10, 1 SAY cCHar SIZE 234, 17 FONT oFont3
@ 11, 1 say "ąćęłńóśżź " FONT oFont3
@ 12, 1 say str( len ( oFont3:cFaceName ) )+' ' +oFont3:cFaceName

@ 13, 1 SAY cCHar SIZE 234, 17 FONT oFont4
@ 14, 1 say "ąćęłńóśżź " FONT oFont4
@ 15, 1 say str( len ( oFont4:cFaceName ) )+' ' +oFont4:cFaceName

ACTIVATE WINDOW oWnd

oFont:End()

return nil
Instead of Grudzień
ąćęłńóśżź
Courier New
I have Grudzieñ
¹æê³ñ󜿟

PostPosted: Tue Dec 18, 2007 9:24 am
by Antonio Linares
You can not do it this way:
Code: Select all  Expand view
DEFINE FONT oFont NAME "Verdana" SIZE 8, -12
oFont:nCharSet := 238 // change to East Europe char set

instead, do it this way:
Code: Select all  Expand view
oFont = TFont():New( "Verdana", -12, 8,,,,,,,, 238 )

PostPosted: Tue Dec 18, 2007 9:47 am
by Grzegorz
Antonio Linares wrote:You can not do it this way:
Code: Select all  Expand view
DEFINE FONT oFont NAME "Verdana" SIZE 8, -12
oFont:nCharSet := 238 // change to East Europe char set

instead, do it this way:
Code: Select all  Expand view
oFont = TFont():New( "Verdana", -12, 8,,,,,,,, 238 )


I changed nHeight with nWidth ( 8 and -12 ) and tested it and no change in program behaviour.

function Main()

local oWnd, oFont, cChar, oFont1, oFont2, oFont3, oFont4

Request Hb_Lang_PLWIN
Request Hb_CodePage_PLWIN

Hb_LangSelect ('PLWIN')
Hb_SetCodePage ('PLWIN')

oFont = TFont():New( "Verdana", 8, -12, .f., , , , , , , ,238 )
oFont1 = TFont():New( "Courier New", 8, -12, .f., , , , , , , ,238 )
oFont2 = TFont():New( "times", 8, -12, .f., , , , , , , ,238 )
oFont3 = TFont():New( "Times New Roman", 8, -12, .f., , , , , , , ,238 )
oFont4 = TFont():New( "Tahoma", 8, -12, .f., , , , , , , ,238 )


DEFINE WINDOW oWnd
cChar := cmonth( date() )

@ 1, 1 SAY cCHar SIZE 234, 17 FONT oFont
@ 2, 1 say "ąćęłńóśżź " FONT oFont
@ 3, 1 say str( len ( oFont:cFaceName ) )+' ' +oFont:cFaceName


@ 4, 1 SAY cCHar SIZE 234, 17 FONT oFont1
@ 5, 1 say "ąćęłńóśżź " FONT oFont1
@ 6, 1 say str( len ( oFont1:cFaceName ) )+' ' +oFont1:cFaceName


@ 7, 1 SAY cCHar SIZE 234, 17 FONT oFont2
@ 8, 1 say "ąćęłńóśżź " FONT oFont2
@ 9, 1 say str( len ( oFont2:cFaceName ) )+' ' +oFont2:cFaceName


@ 10, 1 SAY cCHar SIZE 234, 17 FONT oFont3
@ 11, 1 say "ąćęłńóśżź " FONT oFont3
@ 12, 1 say str( len ( oFont3:cFaceName ) )+' ' +oFont3:cFaceName

@ 13, 1 SAY cCHar SIZE 234, 17 FONT oFont4
@ 14, 1 say "ąćęłńóśżź " FONT oFont4
@ 15, 1 say str( len ( oFont4:cFaceName ) )+' ' +oFont4:cFaceName

ACTIVATE WINDOW oWnd

oFont:End()

return nil

PostPosted: Tue Dec 18, 2007 10:01 am
by Antonio Linares
Please try this:

oFont = TFont():New( "Verdana", 8, -12, .f., , , , , , , ,238 )
MsgInfo( oFont:nCharSet )

and check if it shows 238, thanks

PostPosted: Tue Dec 18, 2007 11:00 am
by Grzegorz
Antonio Linares wrote:Please try this:

oFont = TFont():New( "Verdana", 8, -12, .f., , , , , , , ,238 )
MsgInfo( oFont:nCharSet )

and check if it shows 238, thanks


For all five fonts it return 238 but on display is the same.