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
More Truetype errors
Moderators: Shine, Insert_witty_name
Re: More Truetype errors
I've fixed this, will be in Lua Player 0.20 today.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)
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).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