CodePage in DCSAY or DCGET

This forum is for eXpress++ general support.
Post Reply
Message
Author
messaoudlazhar
Posts: 42
Joined: Mon Dec 23, 2013 2:10 pm
Contact:

CodePage in DCSAY or DCGET

#1 Post 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)

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: CodePage in DCSAY or DCGET

#2 Post by rdonnay »

Send me a sample program so I can see the error.
The eXpress train is coming - and it has more cars.

messaoudlazhar
Posts: 42
Joined: Mon Dec 23, 2013 2:10 pm
Contact:

Re: CodePage in DCSAY or DCGET

#3 Post 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
Last edited by messaoudlazhar on Wed May 19, 2021 1:29 pm, edited 2 times in total.

messaoudlazhar
Posts: 42
Joined: Mon Dec 23, 2013 2:10 pm
Contact:

Re: CodePage in DCSAY or DCGET

#4 Post 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
Attachments
test.jpg
test.jpg (17.79 KiB) Viewed 6338 times
Last edited by messaoudlazhar on Wed May 19, 2021 1:25 pm, edited 1 time in total.

messaoudlazhar
Posts: 42
Joined: Mon Dec 23, 2013 2:10 pm
Contact:

Re: CodePage in DCSAY or DCGET

#5 Post 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
Attachments
test2.jpg
test2.jpg (14.99 KiB) Viewed 6336 times

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: CodePage in DCSAY or DCGET

#6 Post 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.
greetings by OHR
Jimmy

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: CodePage in DCSAY or DCGET

#7 Post 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?
The eXpress train is coming - and it has more cars.

messaoudlazhar
Posts: 42
Joined: Mon Dec 23, 2013 2:10 pm
Contact:

Re: CodePage in DCSAY or DCGET

#8 Post 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)
Attachments
NewArabic.rar
(238.48 KiB) Downloaded 316 times
ArabicXP.rar
(83.06 KiB) Downloaded 338 times

Post Reply