Change default font?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
hasen
Party member
Posts: 157
Joined: Sat Jan 20, 2018 2:01 pm

Change default font?

Post by hasen »

How can I change the default font? I'm not talking about using a custom font but rather selecting from the fonts available on the device ie iOS, desktop etc.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Change default font?

Post by raidho36 »

I think I pondered with the same question and the general answer is "bring your own fonts".
User avatar
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

Re: Change default font?

Post by tentus »

The cross-section of universally available fonts is laughable, so you're best off distributing your fonts with your project. For some code examples to get you going, probably start here:
https://love2d.org/wiki/love.graphics.newFont
Kurosuke needs beta testers
hasen
Party member
Posts: 157
Joined: Sat Jan 20, 2018 2:01 pm

Re: Change default font?

Post by hasen »

tentus wrote: Sun Mar 11, 2018 7:32 pm The cross-section of universally available fonts is laughable, so you're best off distributing your fonts with your project. For some code examples to get you going, probably start here:
https://love2d.org/wiki/love.graphics.newFont
Yes I know about the custom fonts, I was just thinking there must be a way to change fonts built in. Even serif to sans serif can make a big difference. The standard fonts available on mac and ios devices is actually quite a lot. http://iosfonts.com/ They both even include fonts for languages like Japanese and Chinese. Chinese fonts can tend to be pretty huge since there is no alphabet so including a font could add some weight to the game that would otherwise not be needed.

Is there no way to select a font using the functions for custom fonts? Even selecting a font by name that is already in the system? Seems weird not to have it. If you can't choose then what in fact is the font normally used by default?
User avatar
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

Re: Change default font?

Post by tentus »

hasen wrote: Mon Mar 12, 2018 3:52 am Is there no way to select a font using the functions for custom fonts? Even selecting a font by name that is already in the system? Seems weird not to have it. If you can't choose then what in fact is the font normally used by default?
As far as I can see it's Vera:
https://bitbucket.org/rude/love/src/6ff ... ew-default

So, to expand a bit: love is cross-platform, so you can't base the list of available fonts on just mac. You have to look at Windows XP+, Ubuntu, Android, etc etc etc. It'd be nice to be able to select a font by name from the OS, but if you can't count on it being present then you'd have to provide it yourself, at which point there stops being so much point to having the feature. Don't get me wrong, it'd be cool to have a css-like graceful fallback system, but games tend to be a bit more sensitive with fonts than webpages are.
Kurosuke needs beta testers
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Change default font?

Post by raidho36 »

Having no font fallback system means that the game won't be supporting any and all characters not included in the font you bundled with the game. Absolute majority of fonts don't cover even a sliver of Unicode, and you cannot hope to create a font that covers it to 100%.

Which is probably fine if your game has no multiplayer support and you don't intend on supporting translations such as Japanese, Russian, Polish or even German. If that's not the case, then you're in trouble.
hasen
Party member
Posts: 157
Joined: Sat Jan 20, 2018 2:01 pm

Re: Change default font?

Post by hasen »

tentus wrote: Wed Mar 14, 2018 9:37 pm So, to expand a bit: love is cross-platform, so you can't base the list of available fonts on just mac. You have to look at Windows XP+, Ubuntu, Android, etc etc etc.
No you don't 'have to' at all. It's perfectly fine to develop just for iOS or just for Android or whatever you want. So you can look up whatever fonts are available on the system and use which ones you want to. Just in the same way as you can't expect to cater for every device and every OS version etc. Most new iOS apps for example don't support OS 7 or below. You can't make things perfect that run on everything and all the same.

The whole point of cross platform is that you can target all or any systems, not that you have to target all of them.
raidho36 wrote: Thu Mar 15, 2018 3:55 am Which is probably fine if your game has no multiplayer support and you don't intend on supporting translations such as Japanese, Russian, Polish or even German. If that's not the case, then you're in trouble.
Yes exactly. With just question marks displaying for Japanese it's not really working as it is.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 59 guests