Page 1 of 1

CodePage in DCSAY or DCGET

Posted: Sun May 16, 2021 4:45 am
by messaoudlazhar
When writing to the screen using the DCSAY ... GET or DCGET commands,
you cannot use CodePage as DCPRINT FONT CODEPAGE, especially since Windows 7 has been using scalable fonts.
The New scalables fonts versions make it easier to write in multiple languages from most fonts in use.
In the printing it is OK we can use them without difficulty, it suffices to specify CodePage.
Is there a possibility to do the same for the screen.
Note: If we use oFont instead of cFont to specify CodePage an error occurs (xBase 1.90.355)

Re: CodePage in DCSAY or DCGET

Posted: Mon May 17, 2021 8:09 pm
by rdonnay
Send me a sample program so I can see the error.

Re: CodePage in DCSAY or DCGET

Posted: Wed May 19, 2021 12:54 pm
by messaoudlazhar
Thanks Roger,
I solved the error.

i modified the following line in _dcgetbx.prg

Code: Select all

  IF !Empty(aOptions[cGETOPT_FONT])
    ::drawingArea:setFontCompoundName(aOptions[cGETOPT_FONT])
  ELSE
//    ::drawingArea:setFontCompoundName( Dc_BaseFont(7) )
    ::drawingArea:setFontCompoundName( Dc_BaseFont() )  // Jack Duijf 17-07-2014
  ENDIF
To

Code: Select all

  IF !Empty(aOptions[cGETOPT_FONT]) .And. ValType(aOptions[cGETOPT_FONT])="C"
    ::drawingArea:setFontCompoundName(aOptions[cGETOPT_FONT])
  ELSEIF !Empty(aOptions[cGETOPT_FONT]) .And. ValType(aOptions[cGETOPT_FONT])="O"
    ::drawingArea:setFont(aOptions[cGETOPT_FONT])       // Messaoud Mohamed Lazhar 19/05/2021
  ELSE
//    ::drawingArea:setFontCompoundName( Dc_BaseFont(7) )
    ::drawingArea:setFontCompoundName( Dc_BaseFont() )  // Jack Duijf 17-07-2014
  ENDIF

Re: CodePage in DCSAY or DCGET

Posted: Wed May 19, 2021 1:11 pm
by messaoudlazhar
But to display with the DCSAY ... GET command by Object Fonts (oFont),
the SAY part does not work. on the other hand it works with GET.

Code: Select all

FontSayAr:=SelectFontAppl("Times New Roman",14,8,178)

@  2,2 DCSAY "المالك........... :" GET nompra GETSIZE 50 SAYFONT FontSayAr
@  3,2 DCSAY "الصفة............ :" GET nomraisa GETSIZE 50 SAYFONT FontSayAr
@  4,2 DCSAY "النشاط........... :" get activpra1 GETSIZE 50 SAYFONT FontSayAr
@  5,32 DCget activpra2 GETSIZE 50

DCREAD GUI MODAL FIT ADDBUTTONS SETAPPWINDOW  OPTIONS MyGetOptions(200) TITLE "TEST" ENTEREXIT
RETURN
**** 
********---------------
Function SelectFontAppl
   Local oApplFont
Parameters cNFont,nFSize,nFWidth,nCodePage
cCompoundName := StrTran(Ntrim(nFSize,3)+ '.' + cNFont,"..",".")
oApplFont:=XBPFont():New()
oApplFont:FamilyName:=cNFont
oApplFont:Height:=nFSize
oApplFont:Width:=nFWidth
oApplFont:vector := .T.
oApplFont:Create(cCompoundName)
oApplFont:CodePage:=nCodePage
oApplFont:configure(cCompoundName)
Return oApplFont
********---------------
Function MyGetOptions
    Local GetOptions, cSayFontTmp
Parameters MaLargSay
DCGETOPTIONS FONT SelectFontAppl("Times New Roman",14,8,178);  // 178 : Arabic
         GETFONT SelectFontAppl("Times New Roman Bold",13,8,178);
		 ROWSPACE 25 SAYHEIGHT 25 GETHEIGHT 25 ROWPIXELS 25 TABSTOP
If ValType(MaLargSay)="N"
   GetOptions[6]:=MaLargSay
Endif
DC_GetOptDefault( GetOptions )
Return GetOptions

Re: CodePage in DCSAY or DCGET

Posted: Wed May 19, 2021 1:24 pm
by messaoudlazhar
I solved the problem with copying a font from windows XP "Simplified Arabic"
and renamed it to "MML Simplified Arabic" to be able to use it for Windows 7 and Windows 10.
But if I can use the same font for SAY and GET is better

Code: Select all

FontSayAr:=SelectFontAppl("MML Simplified Arabic",14,8,178)
*FontSayAr:=SelectFontAppl("Times New Roman",14,8,178)

@  2,2 DCSAY "المالك........... :" GET nompra GETSIZE 50 SAYFONT FontSayAr
@  3,2 DCSAY "الصفة............ :" GET nomraisa GETSIZE 50 SAYFONT FontSayAr
@  4,2 DCSAY "النشاط........... :" get activpra1 GETSIZE 50 SAYFONT FontSayAr
@  5,32 DCget activpra2 GETSIZE 50 GETFONT FontSayAr

DCREAD GUI MODAL FIT ADDBUTTONS SETAPPWINDOW;
   OPTIONS MyGetOptions(200) TITLE "MISE A JOUR PARAMETRES PROPRIETAIRE"+siinst ENTEREXIT
RETURN

Re: CodePage in DCSAY or DCGET

Posted: Wed May 19, 2021 7:19 pm
by Auge_Ohr
hi
messaoudlazhar wrote: Wed May 19, 2021 1:24 pm I solved the problem with copying a font from windows XP "Simplified Arabic"
xBase was create as 7 Bit where you have Sign up to CHR(128)
when Dbase III appear they use 8 Bit and ANSI where Sign > CHR(128) are different

using Cl*pper and NTX most DBF are OEM so Alaska use "automatic conversation" for DBF : OEM <-> ANSI
so for international Apps it is recommend to use "-ga" for "ANSI Apps"

---

i use Chinese Sign with DBCS and ARIAL UNICODE Font (from M$ Office).
his Way i can "show" Chinese Sign on German OS ... but i need Chinese OS to "enter" Chinese Sign

while Xbase++ does not full support UNICODE i have change App Compiler / LIBs
now i have re-wrote Apps with harbour where i can use Codepage with DBF und use UTF-8.

Re: CodePage in DCSAY or DCGET

Posted: Thu May 20, 2021 7:49 am
by rdonnay
But if I can use the same font for SAY and GET is better
The GET system requires a fixed font whereas your font looks like a proportional font.

Do you have a version of the font that is non-proportional?

Re: CodePage in DCSAY or DCGET

Posted: Thu May 20, 2021 12:54 pm
by messaoudlazhar
hi Roger,
You will find attached 2 fonts of 2 different versions that you can compare
ArabicXP : Version 1.01
NewArabic : Version 6.98 (Multiples Codepage)