Working with fonts

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
CaptainMaelstrom
Party member
Posts: 163
Joined: Sat Jan 05, 2013 10:38 pm

Working with fonts

Post by CaptainMaelstrom »

I'm a little confused about how to work with different fonts.

I'm writing a program which lets the user define which font they want displayed, but I foresee a problem.
When they pick their font, how will I know how to size my user interface elements?
Especially if the user picks a variable width font, I won't know how, programmatically, to determine user interface elements' (buttons and the like) width/height to prevent text from spilling out of the UI elements or being cut off by them.

Anyone have experience or suggestions for dealing with this?
User avatar
slime
Solid Snayke
Posts: 3170
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Working with fonts

Post by slime »

[wiki]Font:getWidth[/wiki]
[wiki]Font:getHeight[/wiki]
User avatar
CaptainMaelstrom
Party member
Posts: 163
Joined: Sat Jan 05, 2013 10:38 pm

Re: Working with fonts

Post by CaptainMaelstrom »

:ultrahappy:
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests