[SOLVED] DrawablePointSize uses integer?

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
olear
Posts: 58
Joined: 2015-05-24T10:56:42-07:00
Authentication code: 6789

[SOLVED] DrawablePointSize uses integer?

Post 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.
Last edited by olear on 2016-01-26T04:11:26-07:00, edited 1 time in total.

snibgo
Posts: 12899
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: DrawablePointSize uses integer?

Post 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.
snibgo's IM pages: im.snibgo.com

olear
Posts: 58
Joined: 2015-05-24T10:56:42-07:00
Authentication code: 6789

Re: DrawablePointSize uses integer?

Post 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)

User avatar
fmw42
Posts: 26262
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: DrawablePointSize uses integer?

Post 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.

olear
Posts: 58
Joined: 2015-05-24T10:56:42-07:00
Authentication code: 6789

Re: DrawablePointSize uses integer?

Post 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.

User avatar
dlemstra
Posts: 1610
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: DrawablePointSize uses integer?

Post by dlemstra »

We call the 'FT_Set_Char_Size' method that uses a signed long for the size of the font.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

User avatar
magick
Site Admin
Posts: 11216
Joined: 2003-05-31T11:32:55-07:00

Re: DrawablePointSize uses integer?

Post 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.

Post Reply