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.
[SOLVED] DrawablePointSize uses integer?
[SOLVED] DrawablePointSize uses integer?
Last edited by olear on 2016-01-26T04:11:26-07:00, edited 1 time in total.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: DrawablePointSize uses integer?
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.
I think better practice is to generate the text at one size, and resize that.
snibgo's IM pages: im.snibgo.com
Re: DrawablePointSize uses integer?
I know that, but this is part of an video app, and users want many things ![Wink ;)](./images/smilies/icon_wink.gif)
Currently .5 changes the text, but nothing else (.1, .2, .3, .4, .6, .7, .8, .9)
![Wink ;)](./images/smilies/icon_wink.gif)
Currently .5 changes the text, but nothing else (.1, .2, .3, .4, .6, .7, .8, .9)
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: DrawablePointSize uses integer?
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?
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.
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?
We call the 'FT_Set_Char_Size' method that uses a signed long for the size of the font.
Re: DrawablePointSize uses integer?
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.