Page 1 of 1

Preloading fonts and cross platform compatibility

Posted: Wed Feb 12, 2020 10:07 pm
by amyren
Many of my programs compiled for 68k runs quite well on AmigaOS4 and MorphOS. And MorphOS usually runs warpOS compiled programs as well.

But if I add a preloaded font to the Hollywood program, the 68k / WarpOS version will fail on MorphOS, complaining about the missing font.

The solution is of course to compile a separate binary for each system.
But it still makes me worder what is different in the way these systems handles fonts, and how Hollywood handles the linked/preloaded font?

Re: Preloading fonts and cross platform compatibility

Posted: Wed Feb 12, 2020 10:21 pm
by Juan Carlos
You don't forget that version uses its own plugins, you can't use the Amiga68k under MorphOS with the plugins of this system installed, 68k doesn't work. Every executable with the plugins of its system.

Re: Preloading fonts and cross platform compatibility

Posted: Thu Feb 13, 2020 11:18 pm
by amyren
No plugins is used, only the use of font was changed.

Re: Preloading fonts and cross platform compatibility

Posted: Sun Feb 16, 2020 12:01 am
by airsoftsoftwair
What kind of font do you preload? Amiga bitmap font or TrueType font? Can you post the preprocessor line used for preloading?

Re: Preloading fonts and cross platform compatibility

Posted: Tue Feb 18, 2020 9:08 am
by amyren
airsoftsoftwair wrote: Sun Feb 16, 2020 12:01 am What kind of font do you preload? Amiga bitmap font or TrueType font? Can you post the preprocessor line used for preloading?
It is a TrueType font, and I use this line to preload the font

Code: Select all

@FONT 1, "DS-DIGITAL BOLD ITALIC", 32

Re: Preloading fonts and cross platform compatibility

Posted: Fri Feb 21, 2020 12:12 am
by amyren
I ran into the same problem running OS 3.14 under WinUAE. Then I found the cause of the problem with some help from SnoopDos. It is looking for freetype2.library and then it fails. After getting the library from aminet it did work.

MorphOS does have truetype support, but when running the 68k version it will expect freetype2.library to be present. So after putting the lib to sys:libs Morhpos will run the OS3 version. The WarpOS version still complains that it cant open that font.

If possible, I would prefer the error message for OS3 to tell that it failed to load freetype2.library. That would make it easier to figure out what is missing.

Re: Preloading fonts and cross platform compatibility

Posted: Fri Feb 21, 2020 12:45 pm
by amyren
Just realized that using the inbuilt fontengine will make the freetype2.library not needed

Code: Select all

@FONT 1, "DS-DIGITAL BOLD ITALIC", 32, {Engine = #FONTENGINE_INBUILT}
Now it worked on OS3.14 without the library. I will create a WarpOS version as well to test later on MorphOS just to make sure.

It turns out, reading the manual sometimes pay off :)

Re: Preloading fonts and cross platform compatibility

Posted: Fri Feb 21, 2020 6:42 pm
by airsoftsoftwair
amyren wrote: Fri Feb 21, 2020 12:45 pm It turns out, reading the manual sometimes pay off :)
Sure, that's why the 1000+ pages are there.

Using the inbuilt font engine is recommended anyway because only by using the inbuilt font engine are you guaranteed to get the same look on every system.