Issues with ImageFonts (filter,offset,bleed,etc.)

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
ecliptic
Prole
Posts: 10
Joined: Wed Jul 01, 2009 12:34 pm

Issues with ImageFonts (filter,offset,bleed,etc.)

Post by ecliptic »

Greetings,

In my work on a project, I can't seem to get image fonts to work correctly. Already checked out the samples on the wiki. I have attached an example.

Problems / questions:
--------------------------
1) They seem to be mirrored and inverted by default as compared to the source image (obviously not a big deal, just odd).
2) It looks like it's cutting off pixels before the separator color and it's appearing a bit offset.
3) When I scale the font and print something, color bleeds slightly into the letters from the separator line.
4) Is there any way to change the filter used to scale fonts? I need them to look chunky when I scale them up to keep with my aesthetic, not smoothed.

Image
fontIssue.love
(2.04 KiB) Downloaded 143 times
Thanks for the help. :monocle:
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: Issues with ImageFonts (filter,offset,bleed,etc.)

Post by TechnoCat »

Well, I solved most of the mystery.

Code: Select all

function love.load()
	image = love.graphics.newImage("lofi_smallfont.png") --Create an Image object
	image:setFilter(1,0) --Set the filter on the Image to nearest neighbor
	font = love.graphics.newImageFont(image,
		" 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()-=+[]{}:;'`<>,.?/\\"); --Create an ImageFont object
	love.graphics.setFont(font); --Set the Font
end
This however doesn't fix the left-side truncation and bottom repeat (they appear to be quads with incorrect x's and y's set). This could be caused by possibly incorrectly formatting the image. And i fixed the flip by saving it as a png in photoshop. Not sure if that is a LOVE error reading tif files or the tif had exif data to flip it.
Attachments
testbed.love
(2.15 KiB) Downloaded 150 times
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 46 guests