forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

More Truetype errors

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
xperiments



Joined: 10 Jan 2006
Posts: 3

PostPosted: Wed Jan 11, 2006 6:57 pm    Post subject: More Truetype errors Reply with quote

Hi, I have this problems:

1 - if I create an new image, and whant to put some text in it as:

_font = Font.load('somefont.ttf')
_font:setPixelSizes(0,30)

fileImage = Image.createEmpty(480,272)
fileImage:fontPrint(_font , 0, 0, 'Hello', Color.new(0,0,2555))

the text not render, it seems to need a:

fileImage:clear(Color.new(0,0,0))

then I can get working, but it is not posible to assing a transparent color like Color.new(0,0,0,0)

2- In the previus working case, the position of the Text is not correct, because it seems that the 0,0 point is outside the area,

Else if I set x=0 and y = 100 it renders but not exactli at 0,100 it its rendered at
x=0
y= 100-TextHeight


Thanks
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Sun Jun 04, 2006 12:12 am    Post subject: Re: More Truetype errors Reply with quote

xperiments wrote:
Hi, I have this problems:

1 - if I create an new image, and whant to put some text in it as:

_font = Font.load('somefont.ttf')
_font:setPixelSizes(0,30)

fileImage = Image.createEmpty(480,272)
fileImage:fontPrint(_font , 0, 0, 'Hello', Color.new(0,0,2555))

the text not render, it seems to need a:

fileImage:clear(Color.new(0,0,0))

then I can get working, but it is not posible to assing a transparent color like Color.new(0,0,0,0)


I've fixed this, will be in Lua Player 0.20 today.

xperiments wrote:

2- In the previus working case, the position of the Text is not correct, because it seems that the 0,0 point is outside the area,

Else if I set x=0 and y = 100 it renders but not exactli at 0,100 it its rendered at
x=0
y= 100-TextHeight


This is by design. The reason is, that with true type fonts you don't know the exact height of each character, so you specify the base line, the same like when you write some text on a paper with lines. This is the usual concept for true type font drawing in other systems, too (e.g. Java).
Back to top
View user's profile Send private message
romero126



Joined: 24 Dec 2005
Posts: 200

PostPosted: Sun Jun 04, 2006 12:17 pm    Post subject: Reply with quote

I love you shine! Marry me!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group