Page 3 of 3

[19 May 2010] Re: Re: Hollywood 4.7 now available!

Posted: Sat Jun 13, 2020 5:32 pm
by airsoftsoftwair
Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 19 May 2010 15:07:08 +0200
Sorry, It took a while until i found the time to more deeply investigate the Problem and now, I found out why .otf AND .ttf Fonts do not always work with the inbuilt engine in Hollywood.

Attached is a test scripts. In "settings.hws", there are four lines for "Const #DEFFONTFAM=.." with different examples when the font works and when not. Please *move* (not copy) the included font to the appropriate location!

It seems the problem is related to the subdir location of fonts. If the font is located in "project-Dir/fonts/somefont.ttf", everything works fine. If the font is located in "project-Dir/fonts/subdir/somefont.ttf",it does not work anymore! Weird! Even more weird, the following command still works:

"SetFont("fonts/subdir/somefont.ttf",24,{Engine=#FONTENGINE_INBUILT})"

But the script fails then at that command:

"SetLayerStyle("\\title",{FontSize=1.5*24})"

with the error message: "Can't open somefont in size 36"
Confirmed, this is a bug and it only occurs when using the inbuilt font engine AND specifying a direct path to a font. As a workaround, simply specify the font path again with each call to SetLayerStyle(), e.g.

Code: Select all

SetLayerStyle("\\title",{Font="fonts/subdir/somefont.ttf", FontSize=1.5*24})
This will work.
Moreover, a pitfall is here (and made finding this problem pretty difficult), if you ever have installed "somefont.ttf" in AOS4 in "Fonts:". Then AOS4 has the following files installed:

Fonts:somefont.font, Fonts:somefont.otag Fonts:_TrueType/somefont.ttf

And the Problem does not arise even if you delete Fonts:somefont.font and Fonts:somefont.otag (also not with a cold reboot)! The problem only appears, if you also delete Fonts:_TrueType/somefont.ttf (or if you never have installed "somefont.ttf" in AOS4!)

Thats the most weird thing because it's a complete different path than specified in the script!
It's normal behaviour because the inbuilt font engine also scans the FONTS:_TrueType directory. So you can delete the *.font and *.otag files, but the inbuilt engine will still find the font because it only searches for the *.ttf/*.otf file. The *.font/*.otag are only required for the native engine.