Resizing fonts

BlitzMax Forums/BlitzMax Programming/Resizing fonts

peltazoid(Posted 2007) [#1]
From looking at the source and the docs, It looks like there is no way of resizing a font on the fly, without using loadimagefont again (unless I have missed something)

Would this be possible to add this functionality at somepoint?

At present I'm working round this by loading all my fonts (including resizes into an array of TImageFonts.)

Thanks.


JazzieB(Posted 2007) [#2]
You can use SetScale and apply that to any font loaded when you come to draw it.

Of course, it will only be scaling the images held in the font and not recalculating to a new point size. Could always load the font as the largest point size required and down-size as required. Depending on final results, you may decided to load two or three base fonts and resize the one that gives the best results at the size you need at the time.

Hope that made sense!


ImaginaryHuman(Posted 2007) [#3]
Ideally you'd load the font as a vector object and draw it as a polygon, but max doesn't currently support that. In FreeType version 2 I think they're building in the ability to transfer a polygon definition of the font rather than a bitmap, which would be a nice upgrade for blitzmax.


peltazoid(Posted 2007) [#4]
@JazzieB
I'll give that a few tests I think, see what the outcome is, if not i'll use just load every size of font I need.

@AngelDaniel
That would be a good upgrade for max, make fonts look smoother at any point size. you listening markie or skid :D


Who was John Galt?(Posted 2007) [#5]
@Daniel - you'll still encounter scaling issues. i.e: How many points do you have in your vector object? Depends on how big you're going to scale it.


ImaginaryHuman(Posted 2007) [#6]
That's true, at some size you'll see artefacts, but it's a lot less than with a bitmap and so long as the spline rendering has a high degree of accuracy it should look pretty smooth.

You really would need a system that loads the scalable font and converts it to splines so that you then render the splines in realtime, rather than a pre-polygonized polygon model.


Who was John Galt?(Posted 2007) [#7]
As you say, I'm sure there is some advantage, even with a pre-polygonized <look that one up in the dictionary!? :) > font.