[02 Apr 2011] Resize of Fonts

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
nexus
Posts: 150
Joined: Sun Mar 07, 2010 11:54 am

[02 Apr 2011] Resize of Fonts

Post by nexus »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 2 Apr 2011 10:53:28 +0200 (CEST)

I haven't touched hollywood for a while but now, preparing another presentation with hollywood, I get an error, i don't understand.

I'm using Hollywood 4.7 with the inbuilt font engine.

My slide shows a group of Layers with text in font Latin Modern Sans 10 Regular in size 24. Next a call to

Code: Select all

SetLayerStayle(layerID, {x=newX,y=newY,FontSize=24})
gives me the error: "Can't open Font Latin Modern Sans 10 Regular in Size 24!"

What can be the reason for that? Actually, that used to work the last time, i worked with hollywood and my persentation application.

I hope, someone can point me quickly to the solution. Thanks,

Tom
nexus
Posts: 150
Joined: Sun Mar 07, 2010 11:54 am

[02 Apr 2011] Re: Resize of Fonts

Post by nexus »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 2 Apr 2011 11:05:56 +0200 (CEST)

To be more exact about the code part, here it is:

Code: Select all

Local fsize = GetAttribute(#LAYER,layerID,#ATTRFONTSIZE)
fsize=fsize*factor ; <- factor is currently equal to 1
SetLayerStyle(layerID,{Y=newY,X=newX,FontSize=fsize}
The SetLayerStyle command causes the error.
User avatar
airsoftsoftwair
Posts: 5834
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[03 Apr 2011] Re: Resize of Fonts

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 03 Apr 2011 11:07:22 +0200
The SetLayerStyle command causes the error.
Hmm, I can't reproduce this problem. The following code works here: (MorphOS 2.7)

Code: Select all

SetFont("Computer Modern Sans", 12, {engine = #FONTENGINE_INBUILT})
EnableLayers
TextOut(0, 0, "Hello World")
WaitLeftMouse
SetLayerStyle(1, {x = 200, y = 200, fontsize = 24})
WaitLeftMouse
End 
Do you have a small code snippet that demonstrates the issue? Does it only happen with "Latin Modern Sans" or also with other fonts?
nexus
Posts: 150
Joined: Sun Mar 07, 2010 11:54 am

[08 Apr 2011] Re: Resize of Fonts

Post by nexus »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 8 Apr 2011 10:02:52 +0200 (CEST)

Thanks for the response. Unfortunately my own reply on your response was rejected because I wrote it from my work's email account.

However, my presentation is over now and went very well. I even got some inqueries what a cool presentation software i used. Someone thought indeed it's Latex's beamer package + some nasty animation tricks :-) So, at least from the presentation software everything was perfect :-)

However, most people thought I'm crazy as I told them that i programmed my own presentations application using Hollywood. They were even more puzzled after mentioning that everything runs on AmigaOS3 in an emulation environment via euae on Linux :) At least they showed some relief after telling them that everything can also be done on windows :D I think some of the people in the audience didn't even know what an Amiga is :-)

But back to the problem. The difference in my code from your code snippet below is, that i specify the path to the true/open type font explicitly:

Code: Select all

Const #DEFFONTSIZE = 24
Const #DEFFONTFAM = "sys:projects/fonts/_OpenType/cm-unicode-0.6.3a/cmunss.otf"

SetFont(#DEFFONTFAM,#DEFFONTSIZE,{Engine=#FONTENGINE_INBUILT})
SetFontStyle(#ANTIALIAS)
Afterwards, when trying to scale the font (during event handling):

Code: Select all

Local fsize=msg.userdata.layerGroup.fontsize*yfactor
;initially, yfactor is 1 and msg.userdata.layerGroup.fontsize is 24,
; so no scalling happens at all
SetLayerStyle(msg.userdata.layerGroup[i],{Y=newY,X=newX,FontSize=fsize})
then, I receive that afore mentioned error about hollywood not being able to open the font at size 24.

I'll try to construct an simple example like yours this weekend and see if the problem then arises, too. However, it's weired, because the same code worked some time ago (maybe only with Hollywood 4.5 not 4.7).

here's an example of a very early version (sorry for all the copy & paste typos in that video ;-) ):

http://www.youtube.com/watch?v=klY2VIFFCAU

It shows that font scaling works nicely.

Anyway, thanks for this really cool piece of software, Andreas :-) I really enjoy to program a presentation instead of using plain latex or even worse, powerpoint :D

At some time, i have to check Designer 3.0 (of course, i bought it already). Maybe, it can help me to reduce the cost (in time) of visualizing certain things in my presentations. I have the hope in mind, that i simply can copy the code from Designer into that part of my hwbeamer package that defines "the next slide" :)

One issue that Designer maybe cannot handle is that position and the size of objects should be relative to the window/screen resolutions? This is important for switching from lower to higher resolutions. At the moment, I can do that easily with hwbeamer :)

Oh, and I have a feature request: Please rework the drawing algorithm of cycles :) They don't always look good but seem to have gaps :)

cheers, Tom
User avatar
airsoftsoftwair
Posts: 5834
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[08 Apr 2011] Re: Resize of Fonts

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 08 Apr 2011 23:25:35 +0200
Thanks for the response. Unfortunately my own reply on your response was rejected because I wrote it from my work's email account.

However, my presentation is over now and went very well. I even got some inqueries what a cool presentation software i used. Someone thought indeed it's Latex's beamer package + some nasty animation tricks :-) So, at least from the presentation software everything was perfect :-)
Great, feel free to spread the word about Hollywood to interested colleagues/ students :)
But back to the problem. The difference in my code from your code snippet below is, that i specify the path to the true/open type font explicitly:
Hmm, I still can't reproduce it. Even if I'm specifying the path directly. So please prepare a very small example :)
here's an example of a very early version (sorry for all the copy & paste typos in that video ;-) ):

http://www.youtube.com/watch?v=klY2VIFFCAU
Looks very cool... I hope you can finish it and then don't hesitate to make some announcement on news sites like amiga-news.de or amigaworld.net to get some publicity for Hollywood :)
At some time, i have to check Designer 3.0 (of course, i bought it already). Maybe, it can help me to reduce the cost (in time) of visualizing certain things in my presentations. I have the hope in mind, that i simply can copy the code from Designer into that part of my hwbeamer package that defines "the next slide" :)
Be warned that Designer code is very spaghetti like :)
One issue that Designer maybe cannot handle is that position and the size of objects should be relative to the window/screen resolutions? This is important for switching from lower to higher resolutions. At the moment, I can do that easily with hwbeamer :)
Hmm, maybe the automatic layer scale engine could help here..
Oh, and I have a feature request: Please rework the drawing algorithm of cycles :) They don't always look good but seem to have gaps :)
Yep, this is planned.
nexus
Posts: 150
Joined: Sun Mar 07, 2010 11:54 am

[10 Apr 2011] Re: Resize of Fonts

Post by nexus »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 10 Apr 2011 13:33:10 +0200

Hi Andreas,

I just tried your little example on AOS3.x (euae) and AOS4.1 (Sam440ep):

Code: Select all

Const #DEFFONTFAM= "sys:dev/projects/hollywood/fonts/_OpenType/cm-unicode-0.6.3a/cmunss.otf"

SetFont(#DEFFONTFAM, 12, {engine = #FONTENGINE_INBUILT})
EnableLayers
TextOut(0, 0, "Hello World")
WaitLeftMouse
SetLayerStyle(1, {x = 200, y = 200, fontsize = 24})
WaitLeftMouse
End               
As you can see, I just used a constant for the font path. I attached the font to this email, so you can check yourself. I also did some checks with different OpenType and TrueType fonts -- the result is always the same: It does not work here, i always get the same kind of error:

Code: Select all

"Kann Schrift CMU Sans Serif Medium in Größe 24 nicht öffnen"
(Can't open font CMU Sans Serif Medim in Size 24)
However, I also found a solution. When replacing the following line in the example above:

Code: Select all

SetLayerStyle(1, {x = 200, y = 200, fontsize = 24})
with

Code: Select all

SetLayerStyle(1, {font=#DEFFONTFAM, x = 200, y = 200, fontsize = 24})  
then it works.

regards, Tom

----=_BOUNDARY.5a47293032d0591.01
User avatar
airsoftsoftwair
Posts: 5834
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[15 Apr 2011] Re: Re: Resize of Fonts

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 15 Apr 2011 12:51:06 +0200

Ah, ok, now I see it. This bug is long fixed since Rev reported it some months ago. But unfortunately in 4.7 it's still there :)
Locked