Page 1 of 1

Where to write Russian fonts?

Posted: Wed Oct 30, 2019 3:47 am
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

Re: Where to write Russian fonts?

Posted: Thu Oct 31, 2019 12:50 am
by Eugene Lutsenko
Is it possible to hard-code used fonts into an exe module or something like that. For example, in the library

Re: Where to write Russian fonts?

Posted: Thu Oct 31, 2019 6:07 am
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.

Re: Where to write Russian fonts?

Posted: Thu Oct 31, 2019 6:11 am
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

Re: Where to write Russian fonts?

Posted: Mon Nov 04, 2019 9:44 am
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.

Re: Where to write Russian fonts?

Posted: Wed Nov 06, 2019 10:21 am
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?

Re: Where to write Russian fonts?

Posted: Thu Nov 07, 2019 6:27 am
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.