Incorrect Font Display

Incorrect Font Display

Postby Surasak » Fri Nov 29, 2024 8:46 am

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.
Surasak
 
Posts: 36
Joined: Fri Jul 20, 2007 1:30 pm

Re: Incorrect Font Display

Postby nageswaragunupudi » Fri Nov 29, 2024 9:23 am

Just now tested with this program and it is working here.
Code: Select all  Expand view  RUN
#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

Please try the above program as it is and let us know.
Regards

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

Re: Incorrect Font Display

Postby nageswaragunupudi » Fri Nov 29, 2024 9:25 am

Also each Thai UTF8 character is represented by 3 bytes. Not 2 bytes
Regards

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

Re: Incorrect Font Display

Postby Surasak » Fri Nov 29, 2024 11:24 am

My program is ANSI not Unicode. but some THAI characters is display like Unicode.
Surasak
 
Posts: 36
Joined: Fri Jul 20, 2007 1:30 pm

Re: Incorrect Font Display

Postby nageswaragunupudi » Fri Nov 29, 2024 1:29 pm

Did you at all try the sample we posted?
Regards

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

Re: Incorrect Font Display

Postby dutch » Fri Nov 29, 2024 3:05 pm

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.
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)
User avatar
dutch
 
Posts: 1554
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: Incorrect Font Display

Postby nageswaragunupudi » Fri Nov 29, 2024 4:48 pm

Thank you my friend Mr. Dutch.
Regards

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

Re: Incorrect Font Display

Postby nageswaragunupudi » Sat Nov 30, 2024 1:50 am

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?
Image

Individual characters are displayed correctly, but when concatenated we see a totally different text.

Source:
Code: Select all  Expand view  RUN
#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.
Regards

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

Re: Incorrect Font Display

Postby nageswaragunupudi » Sat Nov 30, 2024 3:37 am

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.
Regards

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

Re: Incorrect Font Display

Postby Surasak » Sat Nov 30, 2024 5:42 am

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
Surasak
 
Posts: 36
Joined: Fri Jul 20, 2007 1:30 pm

Re: Incorrect Font Display

Postby nageswaragunupudi » Sat Nov 30, 2024 7:31 am

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 view  RUN
#include "fivewin.ch"

function Main()

? GetOEMCP(), GetACP(), HB_CDPSELECT()

return nil
Regards

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

Re: Incorrect Font Display

Postby Surasak » Sat Nov 30, 2024 7:52 am

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
Surasak
 
Posts: 36
Joined: Fri Jul 20, 2007 1:30 pm

Re: Incorrect Font Display

Postby Surasak » Sat Nov 30, 2024 1:16 pm

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
Surasak
 
Posts: 36
Joined: Fri Jul 20, 2007 1:30 pm

Re: Incorrect Font Display

Postby Surasak » Sun Dec 01, 2024 2:55 am

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
Surasak
 
Posts: 36
Joined: Fri Jul 20, 2007 1:30 pm

Re: Incorrect Font Display

Postby dutch » Sun Dec 01, 2024 4:22 am

Hi Surasak สุรศักดิ์
This is sample screen that can use Thai without any problem. Welcome, If you need to contact me.
Line Id : dutchez4
Image
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)
User avatar
dutch
 
Posts: 1554
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 37 guests