 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
xperiments
Joined: 10 Jan 2006 Posts: 3
|
Posted: Wed Jan 11, 2006 6:57 pm Post subject: More Truetype errors |
|
|
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 |
|
 |
Shine
Joined: 03 Dec 2004 Posts: 728 Location: Germany
|
Posted: Sun Jun 04, 2006 12:12 am Post subject: Re: More Truetype errors |
|
|
| 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 |
|
 |
romero126
Joined: 24 Dec 2005 Posts: 200
|
Posted: Sun Jun 04, 2006 12:17 pm Post subject: |
|
|
| I love you shine! Marry me! |
|
| Back to top |
|
 |
|
|
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
|