FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for CA-Clipper To Antonio, How to DEFINE FONT with Script Thai?
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
To Antonio, How to DEFINE FONT with Script Thai?
Posted: Fri Jun 22, 2007 03:26 PM
Dear Antonio,

I've got the problem with some Thai Font. I can use "Ms Sans Serif" in Thai within my program. But there are some Thai Font is not support as follow sample:
- Tahoma
- Arial
In MS Office both Font can type and display in Thai.

If I use following command and select Script with Thai, it work fine.
DEFINE FONT 'Tahoma' SIZE 0, -12 FROM USER

How I can DEFINE FONT with Script Thai as following



Best regards,
Dutch
Regards,

Dutch



FWH 2304 / 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)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
To Antonio, How to DEFINE FONT with Script Thai?
Posted: Sun Jun 24, 2007 06:50 PM

Dutch,

I really don't know it. You should google for some info about it.

Maybe CreateFont() supports a parameter for "scripts"

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
To Antonio, How to DEFINE FONT with Script Thai?
Posted: Mon Jun 25, 2007 03:50 AM

Dear Antonio,

I use CreateFont() and it works perfectly now.

Regards,
Dutch

Regards,

Dutch



FWH 2304 / 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)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
To Antonio, How to DEFINE FONT with Script Thai?
Posted: Mon Jun 25, 2007 09:49 AM

Very good :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 190
Joined: Tue Mar 14, 2006 01:59 AM
To Antonio, How to DEFINE FONT with Script Thai?
Posted: Mon Jun 25, 2007 11:34 PM
Dear Dutch,
dutch wrote:I use CreateFont() and it works perfectly now.

I'm interested on this topic for other nonlatin languages, like Arabic which has the additional problem that mixes left-to-right with right-to-left text in a single row.
Could you please show me a small sample about how you solved your Thai problem with CreateFont() ?
Thanks,
Davide.
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
To Antonio, How to DEFINE FONT with Script Thai?
Posted: Wed Jun 27, 2007 03:38 AM
Dear Davide,

This sample will be some useful, I hope.
Dutch

// More fonts samples

#include "FiveWin.ch"

static oWnd, aFonts

function Main()

local oBtn, oFont, oTxtFile, nLines, cLines, n, cFont, nSize

cFont := 'Courier'
nSize := -10
aFonts := {}

if file('FONT.INI')
   oTxtFile := TTxtFile():New('FONT.INI')
   nLines   := oTxtFile:RecCount()

	for n := 1 to nlines
	 cLines := oTxtFile:ReadLine()
	 if n = 6 .or. n = 7 .or. n = 8
		 aadd( aFonts , if(cLines='.T.',.T.,.F.) )
	 elseif n = 14
		 aadd( aFonts , cLines )
	 else
		 aadd( aFonts , val(cLines) )
	 end
	    oTxtFile:Skip()
	next
	oTxtFile:Close()

end

  // This is default for no Font.ini file
DEFINE FONT oFont NAME cFont SIZE 0,nSize

if !empty( aFonts )
  oFont:hFont := CreateFont( aFonts )
end

   DEFINE WINDOW oWnd TITLE "Testing ChooseFont"

	oWnd:SetFont( oFont )

   @ 2, 2 BUTTON oBtn PROMPT "&Choose" OF oWnd ;
		      ACTION (ChooseSysFont(@aFonts)) ;
		SIZE 80, 25

   ACTIVATE WINDOW oWnd

return nil

*--------------------*
Function uTrim( uVar )
local cVar
if valtype( uVar ) = 'N'
	cVar := ltrim(str(uVar))
elseif valtype( uVar ) = 'L'
	cVar := if(uVar,'.T.','.F.')
else
	cVar := alltrim(uVar)
end
return cVar

*-------------------------------*
Function ChooseSysFont( aFonts )
local hText, n
aFonts := ChooseFont()
if !empty(aFonts[14])
      hText := Fcreate('FONT.INI')
      for n := 1 to len(aFonts)
	 Fwrite(hText,utrim(aFonts[n])+CRLF)
      next
      Fclose(hText)
end
return nil
Regards,

Dutch



FWH 2304 / 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)
Posts: 190
Joined: Tue Mar 14, 2006 01:59 AM
To Antonio, How to DEFINE FONT with Script Thai?
Posted: Wed Jun 27, 2007 11:34 AM
dutch wrote:This sample will be some useful, I hope.

Thank you Dutch, I'll study it.
Hi,
Davide

Continue the discussion