Page 1 of 2
Incorrect Font Display
Posted: Fri Nov 29, 2024 8:46 am
by Surasak
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.
Re: Incorrect Font Display
Posted: Fri Nov 29, 2024 9:23 am
by nageswaragunupudi
Just now tested with this program and it is working here.
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
Please try the above program as it is and let us know.
Re: Incorrect Font Display
Posted: Fri Nov 29, 2024 9:25 am
by nageswaragunupudi
Also each Thai UTF8 character is represented by 3 bytes. Not 2 bytes
Re: Incorrect Font Display
Posted: Fri Nov 29, 2024 11:24 am
by Surasak
My program is ANSI not Unicode. but some THAI characters is display like Unicode.
Re: Incorrect Font Display
Posted: Fri Nov 29, 2024 1:29 pm
by nageswaragunupudi
Did you at all try the sample we posted?
Re: Incorrect Font Display
Posted: Fri Nov 29, 2024 3:05 pm
by dutch
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.
Surasak wrote:My program is ANSI not Unicode. but some THAI characters is display like Unicode.
Re: Incorrect Font Display
Posted: Fri Nov 29, 2024 4:48 pm
by nageswaragunupudi
Thank you my friend Mr. Dutch.
Re: Incorrect Font Display
Posted: Sat Nov 30, 2024 1:50 am
by nageswaragunupudi
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,
We have done some tests and found this problem. Is this the problem you are reporting?
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
We are looking into the issue.
What FWH version you were using before upgrade? This information helps us.
I tested with FWH1905 also but the behavior is the same.
Re: Incorrect Font Display
Posted: Sat Nov 30, 2024 3:37 am
by nageswaragunupudi
It may be problem from unicode character
Yes, you are right.
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.
Re: Incorrect Font Display
Posted: Sat Nov 30, 2024 5:42 am
by Surasak
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
Re: Incorrect Font Display
Posted: Sat Nov 30, 2024 7:31 am
by nageswaragunupudi
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:
Code: Select all | Expand
#include "fivewin.ch"
function Main()
? GetOEMCP(), GetACP(), HB_CDPSELECT()
return nil
Re: Incorrect Font Display
Posted: Sat Nov 30, 2024 7:52 am
by Surasak
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
Re: Incorrect Font Display
Posted: Sat Nov 30, 2024 1:16 pm
by Surasak
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
Re: Incorrect Font Display
Posted: Wed Dec 04, 2024 9:59 am
by Surasak
Dear nageswaragunupudi,
My ANSI Program work fine on FW17 and older, Just found this problem on FW24 with BCC7.70
In THAI character TIS-620 and Window 874 character in my sample cannot combine
Please see the picture at link below:
http://www.asic-net.com/temp/Font-1.jpg
http://www.asic-net.com/temp/Font-2.jpg
Re: Incorrect Font Display
Posted: Thu Dec 05, 2024 8:13 am
by nageswaragunupudi
Yes.
We did understand the issue soon after you posted this topic.
We also found out the source of the problem.
We are in the process of finding a solution.
Please give us a little time.