Page 1 of 1

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

Posted: Sun Jan 17, 2010 6:00 pm
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:

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

Posted: Sun Jan 17, 2010 6:54 pm
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.