Inbuilt fontengine problem with certain ttf files

Report any Hollywood bugs here

Inbuilt fontengine problem with certain ttf files

Postby lazi » Sat Jun 03, 2017 2:36 pm

It seems to me that certain TTF fonts are not compatible with the inbuilt font engine.

Here is an example:
https://drive.google.com/file/d/0ByABbA ... p=drivesdk

When I want to open it like this:

openfont(1,"ram:symbpron.ttf",12,{Engine=#fontengine_inbuilt})

it fails to open a file: symbpron.ttf.font

Here is an excerpt from a snoopy log:

00255 : hollywood : FAIL = GetVar("codeset_default",0x6134A2C8,256,0x00000100) [248uS]
00256 : hollywood : FAIL = Open("ram:symbpron.ttf.font",OLD) = [0x00000000] [37uS]
00257 : hollywood : FAIL = GetVar("codeset_default",0x6134A2C8,256,0x00000100) [95uS]
00258 : hollywood : FAIL = Open("Fonts/ram:symbpron.ttf.font",OLD) = [0x00000000] [2155269uS]
00259 : hollywood : FAIL = GetVar("codeset_default",0x6134A2C8,256,0x00000100) [623uS]
00260 : hollywood : FAIL = Open("FONTS:ram:symbpron.ttf.font",OLD) = [0x00000000] [118uS]

According the OS4 TypeManager this font has a Windows Symbol encoding instead of Windows Unicode which other fonts has. Whatever that means...

I need to traverse all fonts from a selected drawer, so I should use this way to open fonts.
User avatar
lazi
 
Posts: 268
Joined: Fri Feb 25, 2011 12:08 am

Re: Inbuilt fontengine problem with certain ttf files

Postby lazi » Sat Jun 03, 2017 4:17 pm

The main problem is that I can't make any workaround because this:

00258 : hollywood : FAIL = Open("Fonts/ram:symbpron.ttf.font",OLD) = [0x00000000] [2155269uS]

The system asks for the Fonts/ram: assign which is hardly can be set.
User avatar
lazi
 
Posts: 268
Joined: Fri Feb 25, 2011 12:08 am

Re: Inbuilt fontengine problem with certain ttf files

Postby lazi » Sat Jun 03, 2017 4:34 pm

Let me tell you that Hollywood is an amazingly flexible beast.

The above problem can be workaround like this:

Code: Select all
SetFont ( DefineVirtualFileFromString(FileToString(file$) ,FilePart(file$)) , 36, {Engine = #FONTENGINE_INBUILT})


Anyway a fix may be needed for that "Fonts/ram:symbpron.ttf.font"
User avatar
lazi
 
Posts: 268
Joined: Fri Feb 25, 2011 12:08 am

Re: Inbuilt fontengine problem with certain ttf files

Postby airsoftsoftwair » Sat Jun 10, 2017 11:17 am

Yes, this is clearly a bug. I'll fix it. Thanks for reporting and your creative workaround :)
User avatar
airsoftsoftwair
 
Posts: 2233
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany

Re: Inbuilt fontengine problem with certain ttf files

Postby lazi » Tue Jul 18, 2017 11:55 pm

Another problem is that if you want to open a corrupt font or not a ttf file with that method, it will not throw any error message while the SetFont ( file$, 36, {Engine = #FONTENGINE_INBUILT}) will fail if the font file is not correct.

Code: Select all
SetFont (DefineVirtualFileFromString ( "a" , "a"), 24 ,{Engine = #FONTENGINE_INBUILT})
Print("Hello")
WaitLeftMouse       

No error.

Code: Select all
SetFont (DefineVirtualFileFromString ( "a" , "a"), 24 ,{Engine = #FONTENGINE_INBUILT})
SetFontStyle(#ANTIALIAS)
Print("Hello")
WaitLeftMouse 

Error: test.hws:3: This font type does not support anti-aliased output!
User avatar
lazi
 
Posts: 268
Joined: Fri Feb 25, 2011 12:08 am

Re: Inbuilt fontengine problem with certain ttf files

Postby airsoftsoftwair » Sat Jul 22, 2017 2:32 pm

Hmm, yes, looks suspicious as well.
User avatar
airsoftsoftwair
 
Posts: 2233
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany

Re: Inbuilt fontengine problem with certain ttf files

Postby airsoftsoftwair » Sat Aug 12, 2017 7:12 pm

Code: Select all
- Fix: Passing a *.ttf file using an absolute path to OpenFont() or SetFont() will no longer
  result in Hollywood trying to access invalid paths in case OpenFont() or SetFont() can't
  handle the file
- Fix: Loading very old *.ttf files which didn't contain a native Unicode cmap wasn't possible
User avatar
airsoftsoftwair
 
Posts: 2233
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany


Return to Hollywood bugs

Who is online

Users browsing this forum: No registered users and 2 guests