bb.donnay-software.com

Donnay Software Web Forums
It is currently Thu May 28, 2020 11:23 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Fri May 22, 2020 9:54 pm 
Offline
User avatar

Joined: Sat Feb 04, 2012 2:23 am
Posts: 1337
Location: Russia, Southern federal district, city of Krasnodar
How do I make the system use my own font? So that the interface is displayed correctly on any computer with any version of Windows?

_________________
http://lc.kubagro.ru/
https://www.researchgate.net/profile/Eugene_Lutsenko
http://ej.kubagro.ru/
http://ej.kubagro.ru/a/viewaut.asp?id=11


Top
 Profile  
 
PostPosted: Sat May 23, 2020 12:11 pm 
Offline
User avatar

Joined: Wed Feb 24, 2010 3:44 pm
Posts: 1183
hi,

"what" you want to display "right" ... different DBF :?:

Xbase++ use OEM <-> ANSI Conversation so your App must be ANSI
OEM use Codepage but under Xbase++ you canĀ“t open OEM DBF with Codepage (like in harbour)

but ANSI is only 1/2 Way ... UNICODE is what you need.
i use ARIAL UNICODE TTF from Office for Chinese Sign.

when using UNCICODE you also need enhance Function like AT() or SUBSTR() which will not work correct. so all Window Controls and Function must be able to use UNICODE

this was the Reason why i began to write my own Controls to understand Window.

_________________
greetings by OHR
Jimmy


Top
 Profile  
 
PostPosted: Mon May 25, 2020 1:08 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 863
Location: Sijsele, Belgium
Hi,

You can load your own font at startup with this.
DllCall("GDI32.DLL", DLL_STDCALL, "AddFontResourceA", cFont )
Where cFont contains the path and name of the font.

Before closing your application, you can use this:
DllCall("GDI32.DLL", DLL_STDCALL, "RemoveFontResourceA", cFont )

_________________
Best regards,

Chris.
www.aboservice.be


Top
 Profile  
 
PostPosted: Mon May 25, 2020 11:05 am 
Offline
User avatar

Joined: Sat Feb 04, 2012 2:23 am
Posts: 1337
Location: Russia, Southern federal district, city of Krasnodar
And how do I determine the paths to the place where these fonts are located now?

Code:
DC_XbpMenuConfig( ;
  { GRA_CLR_WHITE,;        //  1 - Sub Menu Background Color
    fColor,;               //  2 - Sub Menu Vertical Bar Foreground Color
    bColor,;               //  3 - Sub Menu Vertical Bar Background Color
    GRA_CLR_BLACK,;        //  4 - Sub Menu Outline Color
    '8.MS Sans Serif Bold', ;   //  5 - Sub Menu Vertical Bar Font
    .F., ;
    '8.MS Sans Serif', ;   //  6 - Sub Menu Check Character Font
    'b', ;                 //  7 - Sub Menu Check Character
    fColor,;               //  8 - Menu Bar Foreground Color
    bColor, ;              //  9 - Menu Bar Background Color
    GRA_CLR_BLACK,;        // 10 - Sub Menu Foreground Color
    '8.MS Sans Serif' } )  // 11 - Menu Bar Font

_________________
http://lc.kubagro.ru/
https://www.researchgate.net/profile/Eugene_Lutsenko
http://ej.kubagro.ru/
http://ej.kubagro.ru/a/viewaut.asp?id=11


Top
 Profile  
 
PostPosted: Mon May 25, 2020 11:11 am 
Offline
User avatar

Joined: Sat Feb 04, 2012 2:23 am
Posts: 1337
Location: Russia, Southern federal district, city of Krasnodar
I tried it, but it didn't work out

Code:
Hi,
You can put all the needed fonts is a subfolder of your application. Then load them when you start.
Code:
************************
FUNCTION InstallFonts()             //  <<<===################################
************************
Local aList := directory(".\fonts\*.ttf")
Local i , cFont , cPath:=Disk_dir
for i := 1 to len(aList)
   cFont := cPath+'\fonts\'+aList[i][F_NAME]
   DllCall("GDI32.DLL", DLL_STDCALL, "AddFontResourceA", cFont )
next
RETURN NIL

It is also a good idea to remove them when you close your application.
Code:
************************
FUNCTION RemoveFonts()
************************
Local aList := directory(".\fonts\*.ttf")
Local i , cFont , cPath:=Disk_dir , nGo , nteller := 1
for i := 1 to len(aList)
   cFont := cPath+'\fonts\'+aList[i][F_NAME]
   nTeller := 1
   nGo := 999
   do while nGo > 0 .and. nTeller < 20   // try up to 20 times to remove is the result 'ngo' is bigger than nul.
      nGo := DllCall("GDI32.DLL", DLL_STDCALL, "RemoveFontResourceA", cFont )
      nTeller ++
   enddo
next
RETURN NIL

_________________
http://lc.kubagro.ru/
https://www.researchgate.net/profile/Eugene_Lutsenko
http://ej.kubagro.ru/
http://ej.kubagro.ru/a/viewaut.asp?id=11


Top
 Profile  
 
PostPosted: Mon May 25, 2020 12:28 pm 
Offline

Joined: Mon Dec 23, 2013 2:10 pm
Posts: 29
It doesn't work for vector fonts (versions 5 and later) which are based on Unicode.
You need another solution.
Micosoft applications such as Office, Microsoft 365, Sql Server etc. use the Unicode fonts.
But several software and development tools do not always allow these options, especially since these tools are mainly intended for countries that use the Latin characters.
For the countries of Asia and the Middle East, developers always find it difficult to adopt their applications to support the necessary fonts (Xbase ++ as an example).
:think: :think:


Top
 Profile  
 
PostPosted: Mon May 25, 2020 1:29 pm 
Offline
User avatar

Joined: Wed Feb 24, 2010 3:44 pm
Posts: 1183
hi,
Eugene Lutsenko wrote:
I tried it, but it didn't work out
you have to send
Code:
   SendMessage(HWND_BROADCAST,WM_FONTCHANGE,0,0)
after AddFontResourceA() to "inform" OS about new Font

---

IMHO you are on wrong Way ...

it is not a Problem of Font when Sign are display/print wrong, it is the Codepage of OEM DBF
if you open OEM DBF with right Codepage than it will display/print with almost every installed System Font.

Information about Codepage you will find in DBF Header at Byte 29 (or 30)
Code:
   cTest := SUBSTR( cTxt, 30, 1 )                                     // 0-29 / 1-30
   // look for Codepage
   DO CASE
      CASE cTest = CHR( 0x01 )
         _CodePage := "DOS 437"
      CASE cTest = CHR( 0x02 )
         _CodePage := "DOS 850"
      CASE cTest = CHR( 0x03 )
         _CodePage := "WIN 1251"
      CASE cTest = CHR( 0xC8 )
         _CodePage := "WIN 1250"
      CASE cTest = CHR( 0x64 )
         _CodePage := "DOS 852"
      CASE cTest = CHR( 0x65 )
         _CodePage := "DOS 865"
      CASE cTest = CHR( 0x66 )
         _CodePage := "DOS 866"
      OTHERWISE
         _CodePage := STR( ASC( cTest ) )
         // ??? mehr
   ENDCASE
so the Question is how to open DBF under Xbase++ with Codepage :?:

_________________
greetings by OHR
Jimmy


Top
 Profile  
 
PostPosted: Mon May 25, 2020 9:11 pm 
Offline
User avatar

Joined: Sat Feb 04, 2012 2:23 am
Posts: 1337
Location: Russia, Southern federal district, city of Krasnodar
I am more concerned about the correct display of the interface language on computers with fonts without Cyrillic

_________________
http://lc.kubagro.ru/
https://www.researchgate.net/profile/Eugene_Lutsenko
http://ej.kubagro.ru/
http://ej.kubagro.ru/a/viewaut.asp?id=11


Top
 Profile  
 
PostPosted: Mon May 25, 2020 11:49 pm 
Offline
User avatar

Joined: Wed Feb 24, 2010 3:44 pm
Posts: 1183
hi,
Eugene Lutsenko wrote:
I am more concerned about the correct display of the interface language on computers with fonts without Cyrillic
i guess i can, under Windows 10, when using Codepage "Russian WINDOWS-1" and "RUWIN" as Nation-Language

these Setting are which my latest Release can use
http://www.hmgforum.com/viewtopic.php?f=5&t=6285&start=56
Code:
STATIC FUNCTION WinCodePage()

LOCAL cRet      := ""
LOCAL aLangName := { "Basque", ;
                        "Czech 852", ;
                        "Czech ISO-8859-2", ;
                        "Czech KAM", ;
                        "Catalan", ;
                        "English", ;
                        "French", ;
                        "Galician", ;
                        "German Ansi", ;
                        "German OEM", ;
                        "Hebrew 862", ;
                        "Hebrew 1255", ;
                        "Hungarian 852", ;
                        "Hungarian CWI-2", ;
                        "Hungarian WINDOWS-1", ;
                        "Italian", ;
                        "Polish 852", ;
                        "Polish ISO-8859-1", ;
                        "Polish Mozowia", ;
                        "Portuguese", ;
                        "Romanian", ;
                        "Russian WINDOWS-1", ;
                        "Serbian ISO-8859-2", ;
                        "Serbian 852", ;
                        "Spanish" }

LOCAL aLangID := { "EU", ;
                      "CS852", ;
                      "CSISO", ;
                      "CSKAM", ;
                      "CA", ;
                      "EN", ;
                      "FR", ;
                      "GL", ;
                      "DEWIN", ;
                      "DE850", ;
                      "HE862", ;
                      "HEWIN", ;
                      "HU852", ;
                      "HUCWI", ;
                      "HUWIN", ;
                      "IT", ;
                      "PL852", ;
                      "PLISO", ;
                      "PLMAZ", ;
                      "PT", ;
                      "RO", ;
                      "RUWIN", ;
                      "SRISO", ;
                      "SR852", ;
                      "ES" }

next Release will have Export to XLSx (without Excel, 3-PP LIB or DLL)

_________________
greetings by OHR
Jimmy


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: PedroAlex and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group