Automatic font splitter

Post your Construct-made creations!

Post » Thu Dec 31, 2009 5:33 pm

Edit: updated! Now exports alpha properly(didn't realize it didn't before)!

New version:
viewtopic.php?f=8&t=6162

Old version:
http://www.amirai.net/misc/fontsplitter.zip

Here it is, the automatic font splitter. Just put the image of your font in the same directory as the .exe/.cap, and run. The image needs to be a .png named font.png with a transparent background, as it uses alpha for collision checking. It checks for letters top down column by column, so make sure you put a space between each letter or if they're too close together it might not be able to tell. Also be sure to put all of the letters horizontally.

This sucker is open-source freeware, so distribute/use it however you like. I don't recommend modifying it much though - there were a lot of bugs to get past to get it to work.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Thu Dec 31, 2009 6:44 pm

Excellent! this will take a LOT of work out of using custom fonts

resulting font has a big blank frame around it, any chance to shrink that down?
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Dec 31, 2009 7:01 pm

[quote="Madster":da7nk0g3]Excellent! this will take a LOT of work out of using custom fonts

resulting font has a big blank frame around it, any chance to shrink that down?[/quote:da7nk0g3]

Perhaps you could use "update collision mask", but you would have to not use "grab layout" on canvas.
We need auto-crop on image manipulator......
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Thu Dec 31, 2009 7:11 pm

I actually tried both resizing the canvas and using the image manipulator's crop feature, and neither worked. Resizing the canvas, it ignored its new size and continued acting as if it was its original size. I tried making a bunch of instances of the canvas then picking the one that was the right size, and all the images came out blank. I tried making lots of different canvases then using a family, and it wouldn't work at all.

This was the best i could get it to work - and since with construct you can press alt-crop in the image editor to crop all the frames in an animation, does it really matter?

Edit: Since I couldn't control the size of the canvas, I thought it best to leave it that size in case someone wanted to make a large font.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Thu Dec 31, 2009 7:16 pm

It would be better for anyone who wants to load the images during runtime.
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Thu Dec 31, 2009 7:19 pm

Hmm... a good point, but without being able to resize the canvas to contain how much is pasted to it or crop via the image manipulator, I don't know how to get it to do that.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Thu Dec 31, 2009 8:00 pm

wow
that's awesome
and that was fast
thank you, arima

if you're comfortable with making this a community project
let's see if we can use this as groundwork
and figure out the cropping thing
along with the other features that were in the other post.

this is good stuff though
didn't expect it to be this far along so quicklike
Spriter Dev
B
88
S
21
G
12
Posts: 3,240
Reputation: 16,486

Post » Thu Dec 31, 2009 8:43 pm

[quote="Arima":3dmujuig]since with construct you can press alt-crop in the image editor to crop all the frames in an animation[/quote:3dmujuig]

O_O holy crap
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Dec 31, 2009 11:22 pm

lol - yeah, that needs to be advertised more as a feature. :)

As a font splitter, I don't mind making it a community project, but I don't think it really needs to be - if the cropping feature in the image manipulator gets fixed, cropping's a cinch. All I need to do is run a loop through the image to check for the letter same way I'm checking via collisions (except checking each pixel for alpha) then crop.

As for the other features, essentially making it a general-purpose sprite sheet splitter if I understand what you're aiming for, I'm afraid I really am too busy to put that much work into it. This was meant to be a font splitter, not a sprite sheet splitter. I made this one because the design is simple and based off of things I'd done in the past, so I was confident I could whip it up quickly. If I could think of some quick way to do it, I would consider it, but I can't atm. If anyone else wants to make a sprite sheet splitter out of this though, they can. It's not like I'm patenting the technique. :)
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Fri Jan 01, 2010 1:18 am

actually arima
I didn't catch what you had said about the cropping shortcut
so that pretty much covers what we need
does it do fonts on a grid with x and y or just in a line?
Spriter Dev
B
88
S
21
G
12
Posts: 3,240
Reputation: 16,486

Next

Return to Your Creations

Who is online

Users browsing this forum: No registered users and 0 guests