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 .
Shadow3489
Prole
Posts: 8 Joined: Mon Dec 21, 2020 5:36 am
Post
by Shadow3489 » Mon Dec 21, 2020 11:29 pm
Code: Select all
Class = require 'class'
push = require 'push'
WINDOW_WIDTH = 1280
WINDOW_HEIGHT = 720
VIRTUAL_WIDTH = 432
VIRTUAL_HEIGHT = 243
function love.load()
love.window.setTitle('Maze')
love.graphics.setDefaultFilter('nearest', 'nearest')
smallFont = love.graphics.newFont('HARRYP__.TTF', 25)
push:setupScreen(VIRTUAL_WIDTH, VIRTUAL_HEIGHT, WINDOW_WIDTH, WINDOW_HEIGHT, {
fullscreen = false,
vsync = true,
resizable = false,
})
end
function love.draw()
push:apply('start')
love.graphics.clear(30 / 255, 30 / 255, 50 / 255, 1)
love.graphics.setFont(smallFont)
love.graphics.printf('Hello, world!', 0, VIRTUAL_HEIGHT / 2 - 6, VIRTUAL_WIDTH, 'center')
push:apply('end')
end
I've tried to change the font size but it still comes out pixelated. But I've seen others use a similar code to this and their text comes out all crisp and clear.
pgimeno
Party member
Posts: 3656 Joined: Sun Oct 18, 2015 2:58 pm
Post
by pgimeno » Tue Dec 22, 2020 3:24 pm
Can you maybe post a screenshot that allows us to get an idea of what you mean?
Shadow3489
Prole
Posts: 8 Joined: Mon Dec 21, 2020 5:36 am
Post
by Shadow3489 » Wed Dec 23, 2020 12:10 am
pgimeno wrote: ↑ Tue Dec 22, 2020 3:24 pm
Can you maybe post a screenshot that allows us to get an idea of what you mean?
Sure thing.
Attachments
Screenshot 2020-12-23 101000.png (21.29 KiB) Viewed 3915 times
sphyrth
Party member
Posts: 260 Joined: Mon Jul 07, 2014 11:04 am
Contact:
Post
by sphyrth » Wed Dec 23, 2020 1:10 am
Getting your font the way you want is a different beast of a problem.
slime
Solid Snayke
Posts: 3162 Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:
Post
by slime » Wed Dec 23, 2020 1:21 am
Using mono font hinting might help:
Code: Select all
smallFont = love.graphics.newFont('HARRYP__.TTF', 25, "mono")
Shadow3489
Prole
Posts: 8 Joined: Mon Dec 21, 2020 5:36 am
Post
by Shadow3489 » Wed Dec 23, 2020 3:01 am
slime wrote: ↑ Wed Dec 23, 2020 1:21 am
Using mono font hinting might help:
Code: Select all
smallFont = love.graphics.newFont('HARRYP__.TTF', 25, "mono")
It has made the text much more clearer, but a couple of letters have joined together. I don't know if it's supposed to be like that or not.
Attachments
Screenshot 2020-12-23 130026.png (736 Bytes) Viewed 3897 times
ReFreezed
Party member
Posts: 612 Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:
Post
by ReFreezed » Wed Dec 23, 2020 3:28 pm
The font was probably not made to handle such small sizes.
Users browsing this forum: Bing [Bot] , Google [Bot] , RetroKevin , Semrush [Bot] and 4 guests