Incorrect Font Display
Incorrect Font Display
I just update my program to FW24.09 (BCC7.70) , I found the Font display incorrect when I enter some of 2 THAI character font for example chr(202)+chr(161) , chr(203)+chr(162) , chr(202)+chr(164) etc. , It may be problem from unicode character, I try to use command FW_SetUnicode( .F. ) but nothing change. How can I solve this problem.
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: Incorrect Font Display
Just now tested with this program and it is working here.
![Image](https://imagizer.imageshack.com/v2/xq70/922/PdWkjp.png)
Please try the above program as it is and let us know.
Code: Select all | Expand
#include "fivewin.ch"
function Main()
local oWnd, oGet, cText := space(20 )
FW_SetUnicode( .T. )
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-25
DEFINE WINDOW oWnd
oWnd:SetFont( oFont )
@ 40,20 GET oGet VAR cText SIZE 300,40 PIXEL OF oWnd
@ 90,20 BUTTON "ฤฆต" SIZE 150,50 PIXEL OF oWnd ;
ACTION MsgInfo( cText )
ACTIVATE WINDOW oWnd CENTERED
return nil
![Image](https://imagizer.imageshack.com/v2/xq70/922/PdWkjp.png)
Please try the above program as it is and let us know.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: Incorrect Font Display
Also each Thai UTF8 character is represented by 3 bytes. Not 2 bytes
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Incorrect Font Display
My program is ANSI not Unicode. but some THAI characters is display like Unicode.
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: Incorrect Font Display
Did you at all try the sample we posted?
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Incorrect Font Display
Dear K.Surasak,
Please let me see your sample code. I'm Thai. If you use Fw_setunicode(.T.), you must save your prg file as Encoding : UTF-8.
If you ANSI, don't use FW_SetUnicode(.F.) function.
Please let me see your sample code. I'm Thai. If you use Fw_setunicode(.T.), you must save your prg file as Encoding : UTF-8.
If you ANSI, don't use FW_SetUnicode(.F.) function.
Surasak wrote:My program is ANSI not Unicode. but some THAI characters is display like Unicode.
Regards,
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: Incorrect Font Display
We have done some tests and found this problem. Is this the problem you are reporting?I found the Font display incorrect when I enter some of 2 THAI character font for example chr(202)+chr(161) , chr(203)+chr(162) , chr(202)+chr(164) etc. , It may be problem from unicode character,
![Image](https://imagizer.imageshack.com/v2/xq70/924/qK48q5.png)
Individual characters are displayed correctly, but when concatenated we see a totally different text.
Source:
Code: Select all | Expand
#include "fivewin.ch"
// Thai ANSI chars
function Main()
local oFont, oThai
local aChar := { ;
{ 202, 161, nil, nil, nil, nil }, ;
{ 202, 161, nil, nil, nil, nil }, ;
{ 202, 161, nil, nil, nil, nil } }
AEval( aChar, < |a,i|
a[ 3 ] := Chr( a[ 1 ] )
a[ 4 ] := Chr( a[ 2 ] )
a[ 5 ] := a[ 3 ] + "+" + a[ 4 ] + '='
a[ 6 ] := a[ 3 ] + a[ 4 ]
return nil
> )
DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-32
DEFINE FONT oThai NAME "Segoe UI" SIZE 0,-64 CHARSET 0xDE
XBROWSER aChar TITLE FWVERSION SETUP ( ;
oBrw:oDataFonts := { oFont, oFont, oThai, oThai, oThai, oThai }, ;
oBrw:cHeaders := { "ASC1","ASC2","CHR1","CHR2","CHR1+CHR2=","RESULT" }, ;
oBrw:nDataStrAligns := AL_CENTER, ;
oBrw:nHeadStAlighns := AL_CENTER );
AUTOFIT
RELEASE FONT oFont, oThai
return nil
What FWH version you were using before upgrade? This information helps us.
I tested with FWH1905 also but the behavior is the same.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: Incorrect Font Display
Yes, you are right.It may be problem from unicode character
These combinations are being treated as 2-byte utf8 characters.
We are looking into how to resolve the issue for you.
Please give us a little time.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Incorrect Font Display
Thank You So Much nageswaragunupudi,
Yes, That is my problem, It happen when enter 2 of character ascII higher than 127, But If enter 1 or more than 2 character it will not happen.
My last version is FW17 (My Program work fine with this version and older version) , I have to use QRCODE function which FW17 not support,
I also found other some problem with FW24,
for example :
- at the first time when run the program it take 5 to10 seconds before program start
- When I try to use unicode by function FW_SetUnicode( .T. ) + HB_SETCODEPAGE( "UTF8" ) and change my code to UTF8,
I found class MENU display incorrect , I test by use function GetSysFont(), It work with function msginfo() but class MENU still display wrong font
- Function msginfo() the button is not center
I do not know How to post the picture on this forums, Please told me how can I post the picture to show my problem
Thank you every one for suppoting
Yes, That is my problem, It happen when enter 2 of character ascII higher than 127, But If enter 1 or more than 2 character it will not happen.
My last version is FW17 (My Program work fine with this version and older version) , I have to use QRCODE function which FW17 not support,
I also found other some problem with FW24,
for example :
- at the first time when run the program it take 5 to10 seconds before program start
- When I try to use unicode by function FW_SetUnicode( .T. ) + HB_SETCODEPAGE( "UTF8" ) and change my code to UTF8,
I found class MENU display incorrect , I test by use function GetSysFont(), It work with function msginfo() but class MENU still display wrong font
- Function msginfo() the button is not center
I do not know How to post the picture on this forums, Please told me how can I post the picture to show my problem
Thank you every one for suppoting
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: Incorrect Font Display
No problem
We will resolve all your issues one by one and provide you with a revised library soon.
Please just be patient for a few days.
Meanwhile please execute this program and let me know the results:
We will resolve all your issues one by one and provide you with a revised library soon.
Please just be patient for a few days.
Meanwhile please execute this program and let me know the results:
Code: Select all | Expand
#include "fivewin.ch"
function Main()
? GetOEMCP(), GetACP(), HB_CDPSELECT()
return nil
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Incorrect Font Display
Dear nageswaragunupudi,
for my regular ANSI Program
? GetOEMCP(), GetACP(), HB_CDPSELECT() = 874,874,EN
for my Unicode Program
? GetOEMCP(), GetACP(), HB_CDPSELECT() = 874,874,UTF8
Thank you very much for your support
in case you want to contract direst, my e-mail is surasak@asic-net.com
for my regular ANSI Program
? GetOEMCP(), GetACP(), HB_CDPSELECT() = 874,874,EN
for my Unicode Program
? GetOEMCP(), GetACP(), HB_CDPSELECT() = 874,874,UTF8
Thank you very much for your support
in case you want to contract direst, my e-mail is surasak@asic-net.com
Re: Incorrect Font Display
Dear nageswaragunupudi,
Sorry for my fault, In case Unicode class MENU display incorrect , I found that I can assign FONT to this class to correct the font
I found some part of my Unicode program have to store space() to variable before take the value from database to variable ,
If not, GET command will cannot enter the THAI character
Sorry for my fault, In case Unicode class MENU display incorrect , I found that I can assign FONT to this class to correct the font
I found some part of my Unicode program have to store space() to variable before take the value from database to variable ,
If not, GET command will cannot enter the THAI character
Re: Incorrect Font Display
Dear nageswaragunupudi,
As below is the sample of my Unicode Program with GET cannot enter THAI character if variable = nil at first
#include "FiveWin.ch"
function Main
local oWnd
public cFont0,oFont0,cName,oName
FW_SetUnicode( .T. )
HB_SETCODEPAGE( "UTF8" )
cFont0="Tahoma"
*cName = space(40) // FW24 Version If Without This Line, Variable cName with = nil
// I will cannot Enter THAI character
// But in FW17 Version Have no this problem
DEFINE FONT oFont0 NAME cFont0 SIZE 0,24
DEFINE WINDOW oWnd FROM 0,0 TO 12,34 TITLE "Test Program"
@ 20, 20 SAY "ENTER" OF oWnd PIXEL
@ 60, 20 GET oName VAR cName OF oWnd PIXEL SIZE 200,30
@ 100, 80 BUTTON "EXIT" OF oWnd PIXEL SIZE 70,30 ACTION oWnd:End()
SET FONT OF oWnd TO oFont0
ACTIVATE WINDOW oWnd ON INIT VarSet()
CLOSE ALL
CLEAR ALL
QUIT
return nil
Function VarSet
cName = "ทดสอบ "
oName:Refresh()
return nil
As below is the sample of my Unicode Program with GET cannot enter THAI character if variable = nil at first
#include "FiveWin.ch"
function Main
local oWnd
public cFont0,oFont0,cName,oName
FW_SetUnicode( .T. )
HB_SETCODEPAGE( "UTF8" )
cFont0="Tahoma"
*cName = space(40) // FW24 Version If Without This Line, Variable cName with = nil
// I will cannot Enter THAI character
// But in FW17 Version Have no this problem
DEFINE FONT oFont0 NAME cFont0 SIZE 0,24
DEFINE WINDOW oWnd FROM 0,0 TO 12,34 TITLE "Test Program"
@ 20, 20 SAY "ENTER" OF oWnd PIXEL
@ 60, 20 GET oName VAR cName OF oWnd PIXEL SIZE 200,30
@ 100, 80 BUTTON "EXIT" OF oWnd PIXEL SIZE 70,30 ACTION oWnd:End()
SET FONT OF oWnd TO oFont0
ACTIVATE WINDOW oWnd ON INIT VarSet()
CLOSE ALL
CLEAR ALL
QUIT
return nil
Function VarSet
cName = "ทดสอบ "
oName:Refresh()
return nil
Re: Incorrect Font Display
Hi Surasak สุรศักดิ์
This is sample screen that can use Thai without any problem. Welcome, If you need to contact me.
Line Id : dutchez4
![Image](https://i.postimg.cc/Ss11hwJZ/thaimenu.png)
This is sample screen that can use Thai without any problem. Welcome, If you need to contact me.
Line Id : dutchez4
![Image](https://i.postimg.cc/Ss11hwJZ/thaimenu.png)
Last edited by dutch on Sun Dec 01, 2024 4:33 am, edited 1 time in total.
Regards,
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)