How do I change fonts?

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
dragonspiral11
Prole
Posts: 1
Joined: Sat Oct 12, 2013 1:23 pm

How do I change fonts?

Post by dragonspiral11 »

I wish to use different fonts in a program that I'm making. I use Old London for certain phrases and then switch back to Arial. I also want to use a Barcode font. Can I do that?
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: How do I change fonts?

Post by davisdude »

I would recommend taking a look at Robin's richtext. Other than that, I'm not sure what you mean by "Barcode font"...
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: How do I change fonts?

Post by micha »

First, load a font:

Code: Select all

font = love.graphics.newFont( filename, size )
and then switch to it with

Code: Select all

love.graphics.setFont(font);
Everything you write after this command uses this font.

If you want to use different fonts at the same time, then load all of them (using multiple variable, e.g. fontArial, fontBarcode...) and switch between them.
Post Reply

Who is online

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