Page 1 of 1
[SOLVED] DrawablePointSize uses integer?
Posted: 2015-12-30T09:32:21-07:00
by olear
Hi,
I'm using text in animation, and have some problems...
I'm currently using DrawablePointSize(fontSize), fontSize is double, but when animating I get integer behaviour. Moving from point size 64 to 67 in 250 frames scales the font three times instead of a smooth animation.
I'm also doing the same with DrawableStrokeWidth(strokeWidth) and others, and there everything works as it should.
Re: DrawablePointSize uses integer?
Posted: 2015-12-30T11:11:24-07:00
by snibgo
Animating text is generally tricky because the same text two different font sizes will generally not be simple resizes of each other.
I think better practice is to generate the text at one size, and resize that.
Re: DrawablePointSize uses integer?
Posted: 2015-12-30T12:47:48-07:00
by olear
I know that, but this is part of an video app, and users want many things
Currently .5 changes the text, but nothing else (.1, .2, .3, .4, .6, .7, .8, .9)
Re: DrawablePointSize uses integer?
Posted: 2015-12-30T12:53:14-07:00
by fmw42
I am not an expert on font issues, but I do not think point sizes can vary in increments less than integer values. I could be wrong. 0.5 is probably being rounded to an integer.
Re: DrawablePointSize uses integer?
Posted: 2015-12-31T02:59:12-07:00
by olear
Ok, since the function accepts double I assumed it also was able to use double(?)
Would at least be nice to get a confirmation that double should work or not, and if this is a IM problem or not (if I use freetype directly will this work?).
Thanks.
Re: DrawablePointSize uses integer?
Posted: 2015-12-31T03:05:18-07:00
by dlemstra
We call the 'FT_Set_Char_Size' method that uses a signed long for the size of the font.
Re: DrawablePointSize uses integer?
Posted: 2015-12-31T06:50:41-07:00
by magick
FT_Set_Char_Size() arguments are in 26.6 fractional points. What are fractional points? Its a way of representing a non-integer number in a 32-bit word. The first 26 bits are used to represent the integer portion of the number, whereas the remaining 6 are used to represent the fractional portion.