Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
8
Erster Beitrag:
vor 3 Jahren
Letzter Beitrag:
vor 3 Jahren
Beteiligte Autoren:
Paul Turner, GuenterP, Alexandre Leclerc

Fonts not appearing on other PCs

Startbeitrag von Paul Turner am 06.02.2015 08:19

Hi

A strange problem has started with a piece of software I'm developing. It uses standard Windows fonts, which show on the development PC, but for some reason on any other PC the fonts are not shown correctly (For example Old English Script just shows as standard characters). This even applies to static text controls which are given a different font. However this all used to work fine. I obviously changed something inadvertently, but have no idea what.

Anyone have any ideas?

To follow-up I created a new project with 1 single window, which has a single static control in Vivaldi font. On other PCs that static appears in Arial or something similar. I'm stumped!

Rgds
Paul

Antworten:

Ok now I'm really confused. I installed Windev on another PC, and made a single window project where the window had a static control in Vivaldi font. The corresponding EXE running on another PC has the static appearing in standard characters (arial or something similar).

Anyone have any ideas - please!!

Rgds
Paul

von Paul Turner - am 06.02.2015 09:54
Turns out the fonts were somehow removed.

Should have checked first - oh well it is friday!!

von Paul Turner - am 06.02.2015 11:02
Hi Paul,

if your application uses special fonts which are not installed as a standard by Windows (Arial, Times, Consolas etc) then you have to supply these fonts in the install package and install these fonts during the install process of the application. I'm using Innosetup for making the installation package, it has a command to install font/s too. We still miss a custom font installation from the WinDev installer. Quite some time ago, I spent some hours to get a font install from the WinDev installer, no joy. It is possible to copy the fonts into the Windows\fonts directory, but the fonts will work after the first restart of the computer only. There are API-calls for font installation too, but as I remember, I had difficulties to get over the rights-issue with them.

von GuenterP - am 06.02.2015 12:07
Thanks for the tip Guenter. I'll check it out.

Rgds
Paul

von Paul Turner - am 06.02.2015 12:57
Hi Guenter,

We use another very simple approach to this problem. We simply package the required fonts in a /Fonts subfolder in our application installation directory. (i.e. the Fonts folder is relative to the EXE location as ./Fonts).

Then we call Windows API at program start to temporarily declare the fonts to the OS by using AddFontResourceA and call RemoveFontResourceA when we close the application. What is nice is that it works in all cases with no administrative accounts required. Also, the fonts can be updated anytime or changed.

API("Gdi32.dll","AddFontResourceA or RemoveFontResourceA","Full path to the font file.")

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 09.02.2015 17:01
Hi Alexandre, thank you!

von GuenterP - am 09.02.2015 18:13
Thanks Alexandre, great tip!

von Paul Turner - am 09.02.2015 23:54
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.