Where to write Russian fonts?

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Where to write Russian fonts?

#1 Post by Eugene Lutsenko »

Where to write Russian fonts, so that everything is correctly written under a foreign Windows?

Where to write Russian fonts, so that everything is correctly written under a foreign Windows? On a computer with Windows multi-language all is written normally, and on foreign gibberish

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Where to write Russian fonts?

#2 Post by Eugene Lutsenko »

Is it possible to hard-code used fonts into an exe module or something like that. For example, in the library

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

Re: Where to write Russian fonts?

#3 Post by rdonnay »

Yes. There are software programs that let you create your own .FNT files with custom fonts.

Bobby Drakos uses custom fonts in his application.
The eXpress train is coming - and it has more cars.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Where to write Russian fonts?

#4 Post by Eugene Lutsenko »

Hi, Roger. Always a pleasure to chat with you!
I need to use standard fonts, but in a way that doesn't depend on the ones installed in Windows

skiman
Posts: 1183
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Where to write Russian fonts?

#5 Post by skiman »

Hi,

You can put all the needed fonts is a subfolder of your application. Then load them when you start.

Code: Select all

function installfonts()
*************************
Local aList := directory(".\fonts\*.ttf")
Local i , cFont , cPath:="path of your application" 
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: Select all

function removefonts()
***********************
Local aList := directory(".\fonts\*.ttf")
Local i , cFont , cPath:=amain(5,2) , 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
The nGo and Counter system is because you can't remove if the font is still in use. For example, if you application was started twice, and you want to close one session. With the counter (nTeller) it is tried up to 20 times.
Best regards,

Chris.
www.aboservice.be

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Where to write Russian fonts?

#6 Post by Eugene Lutsenko »

Hi, Chris! At the beginning of my program, I started the function of loading my own fonts. After the end of the program, I turned off my own fonts, as you advised. However, unfortunately, the program works exactly as before. That is, it displays all text elements of the interface and output forms with the wrong additional page. Maybe Windows itself can not display the Russian font?

skiman
Posts: 1183
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Where to write Russian fonts?

#7 Post by skiman »

Hi,

I have no experience with Russian fonts. I expected that only someone with a 'Russian' Windows would also like to use Russian fonts?

If you double click on a font, it is opened with the sample so you can install it. If it is not well displayed in that screen, it won't be correctly displayed in your software.
Best regards,

Chris.
www.aboservice.be

Post Reply