Page 1 of 1
[07 Jul 2008] Problem with Fonts
Posted: Sat Jun 13, 2020 5:31 pm
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
[08 Jul 2008] Re: Problem with Fonts
Posted: Sat Jun 13, 2020 5:31 pm
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)
[08 Jul 2008] Re: Problem with Fonts
Posted: Sat Jun 13, 2020 5:31 pm
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
[09 Jul 2008] Re: Re: Problem with Fonts
Posted: Sat Jun 13, 2020 5:31 pm
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.
[12 Jul 2008] Re: Problem with Fonts
Posted: Sat Jun 13, 2020 5:31 pm
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