A suggestion to improve font workflow
A suggestion to improve font workflow
I would really appreciate a font:setSize() to prevent redundancy. If there's already a way to set size without big hassle, excuse my invalid complaint.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: A suggestion to improve font workflow
Hi, I don't understand how that would prevent redundancy. Could you give a more complete example of what you mean?Mystical wrote:I would really appreciate a font:setSize() to prevent redundancy. If there's already a way to set size without big hassle, excuse my invalid complaint.
When I write def I mean function.
Re: A suggestion to improve font workflow
Instead of creating multiple instances ofHi, I don't understand how that would prevent redundancy. Could you give a more complete example of what you mean?
Code: Select all
font = love.graphics.newFont("font.ttf", 12)
you could just use font:setSize(12) to handle size shifting whenever the HUD or Menus require it.
- zorg
- Party member
- Posts: 3470
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: A suggestion to improve font workflow
Basically, you need to create one font object per font size.
As an alternate route, you can always use love.graphics.scale(wantedsize/fontsize,wantedsize/fontsize) to scale the text you write out with print or printf.
As an alternate route, you can always use love.graphics.scale(wantedsize/fontsize,wantedsize/fontsize) to scale the text you write out with print or printf.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: A suggestion to improve font workflow
Love's scaling only scales the rasterized text, not the original vectors. And I really don't want to clutter my code with tons of font objects.
Re: A suggestion to improve font workflow
If I had to guess, I'd say Love's current API reflects the fact that a new texture atlas would need to be created if some attibute of the font were changed, and an API like the one proposed here would lead people to believe that creating texture atlases left and right was somehow cheap, and lead them to do really inefficient things.
Just a guess, though.
Just a guess, though.
Re: A suggestion to improve font workflow
This will involve the whole new subsystem creation to do scaling of font outlines. And effect that you want is IMHO too rare to be integrated into framework.
As I mentioned here viewtopic.php?f=4&t=79923&p=182325&hili ... pe#p182325 you can draw all needed letters in Inkscape or other vector editor, save vector info, then build meshes according to this info (beziers, polygon smoothing algorithms etc.) to draw text scaled to any size without losing quality.
EDIT: Even better IMHO: use Blender (or other 3d modeling package of your choice) to create triangulated versions of letters' outlines, save info to some text file then use this.
As I mentioned here viewtopic.php?f=4&t=79923&p=182325&hili ... pe#p182325 you can draw all needed letters in Inkscape or other vector editor, save vector info, then build meshes according to this info (beziers, polygon smoothing algorithms etc.) to draw text scaled to any size without losing quality.
EDIT: Even better IMHO: use Blender (or other 3d modeling package of your choice) to create triangulated versions of letters' outlines, save info to some text file then use this.
Re: A suggestion to improve font workflow
Thanks man, that's useful. Kinda sucks about the subsystem thing, but having pure vector data for the font might allow me to do some 3D transformation with it.arampl wrote:This will involve the whole new subsystem creation to do scaling of font outlines. And effect that you want is IMHO too rare to be integrated into framework.
As I mentioned here viewtopic.php?f=4&t=79923&p=182325&hili ... pe#p182325 you can draw all needed letters in Inkscape or other vector editor, save vector info, then build meshes according to this info (beziers, polygon smoothing algorithms etc.) to draw text scaled to any size without losing quality.
EDIT: Even better IMHO: use Blender (or other 3d modeling package of your choice) to create triangulated versions of letters' outlines, save info to some text file then use this.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 4 guests