[07 Jul 2008] Problem with Fonts

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
User avatar
Allanon
Posts: 742
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

[07 Jul 2008] Problem with Fonts

Post by Allanon »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 07 Jul 2008 20:50:27 -0000

Hello Andreas, I haven't OS4 so I can test personally, but a kind person that has tried my Calc has reported the following message:

OS4 version doesn't work with your Fonts directory: Hollywood player

Code: Select all

Cannot open font Helvetica.font with size 11 !
File: ScuiLib.hws (current line: 2676 - In function: SetFont)
But it works if I remove the Fonts directory from Calc_OS4PPC dir.

In the same folder where the compiled Hollywood program is, there is the Font folder too with the sub folder Helvetica and the file helvetica.font, and inside this one there are the folders for each size (9, 11, 13, 15, and so on). Maybe I'm missing something? Or maybe the fonts I've included in the package are not compatible with OS4?

Can you implement a way to check fonts before trying to open it? Maybe the SetFont function could return a result if the font can't be opened? This could give the ability to handle these kind of errors and select a fallback font.

Regards, Fabio
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | All my links
User avatar
airsoftsoftwair
Posts: 5833
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[08 Jul 2008] Re: Problem with Fonts

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 8 Jul 2008 19:14:30 +0200
Hello Andreas, I haven't OS4 so I can test personally, but a kind person that has tried my Calc has reported the following message:

OS4 version doesn't work with your Fonts directory: Hollywood player

Cannot open font Helvetica.font with size 11 ! File: ScuiLib.hws (current line: 2676 - In function: SetFont)

But it works if I remove the Fonts directory from Calc_OS4PPC dir.

In the same folder where the compiled Hollywood program is, there is the Font folder too with the sub folder Helvetica and the file helvetica.font, and inside this one there are the folders for each size (9, 11, 13, 15, and so on). Maybe I'm missing something? Or maybe the fonts I've included in the package are not compatible with OS4?
Hmm, weird. I do not have access to an OS4 machine right now so I can't test it. What I could imagine is that the user has a different version of helvetica.font in FONTS: and it is already in memory. Hollywood then tries to open PROGDIR:Fonts/helvetica.font and this conflicts with the helvetica.font already in memory. But this is only a surmise. I need to check this for myself to see what's going on.
Can you implement a way to check fonts before trying to open it? Maybe the SetFont function could return a result if the font can't be opened? This could give the ability to handle these kind of errors and select a fallback font.
This is already possible. Just embrace the call to SetFont() with ExitOnError() calls, e.g.

Code: Select all

ExitOnError(FALSE)
SetFont("blabla.font", 12)
If GetLastError() <> 0 Then DebugPrint("Error loading font")
ExitOnError(TRUE)
User avatar
Allanon
Posts: 742
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

[08 Jul 2008] Re: Problem with Fonts

Post by Allanon »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 08 Jul 2008 18:26:15 -0000
Hmm, weird. I do not have access to an OS4 machine right now so I can't test it. What I could imagine is that the user has a different version of helvetica.font in FONTS: and it is already in memory. Hollywood then tries to open PROGDIR:Fonts/helvetica.font and this conflicts with the helvetica.font already in memory. But this is only a surmise. I need to check this for myself to see what's going on.
Do you know if exists a way to check if a font is already loaded in memory? Maybe I can ask to make a check before opening the program...
This is already possible. Just embrace the call to SetFont() with ExitOnError() calls, e.g.

Code: Select all

ExitOnError(FALSE)
SetFont("blabla.font", 12)
If GetLastError() <> 0 Then DebugPrint("Error loading font")
ExitOnError(TRUE)
Good! Thank you :)
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | All my links
User avatar
airsoftsoftwair
Posts: 5833
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[09 Jul 2008] Re: Re: Problem with Fonts

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 9 Jul 2008 09:05:17 +0200
Do you know if exists a way to check if a font is already loaded in memory? Maybe I can ask to make a check before opening the program...
No, I doubt that this is possible because it probably varies between the different diskfont.library implementations. I'm not even sure if diskfont under OS4 caches bitmap fonts at all... under OS3 this is done to speed up font loading but under OS4 I wouldn't say that caching bitmap fonts is necessary because they can be loaded really fast.
User avatar
Allanon
Posts: 742
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

[12 Jul 2008] Re: Problem with Fonts

Post by Allanon »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 12 Jul 2008 20:58:11 -0000

Hello Andreas, just to let you know that another user has tested the same program (OS4 version) without any issue...

regards, Fabio
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | All my links
Locked