Romhacking.net

Romhacking => ROM Hacking Discussion => Topic started by: tryphon on October 31, 2015, 09:44:51 am

Title: Tool for generating outlined bitmap fonts
Post by: tryphon on October 31, 2015, 09:44:51 am
I need to generate small (around 24 px height) outlined text, using 4 predefined shades.

How would you do that ?

I use Paint.net, which has an outline tool, not useful here (it smoothes the edges).

I coded an outliner script in Python (it dilates the bitmap) but it doesn't work well with shades, so I drawed a 48 px version, resized (bilinear) to half to have some kind of antialiasis, but it's a little blurred so I'm not satisfied.

You can see the results in the lower right menu (STATUS / ITEM / etc.)

(http://i.imgur.com/NG2vPHV.png)

Also, I don't have Photoshop.
Title: Re: Tool for generating outlined bitmap fonts
Post by: FAST6191 on October 31, 2015, 01:53:10 pm
I would probably use GIMP for this. http://www.gimp.org/ and also available on https://ninite.com/ if you want to potentially spare yourself some aggro fiddling with runtimes and whatever else.

Do whatever text you like and then right click on the layer with the text and choose alpha to selection. Then in the selection window you can either Try Gimp's outline function (might not work if you have enclosed spaces) or more likely then either the grow or the shrink selection functions and then delete/colour/whatever as appropriate.

Font in the picture is just http://font.ubuntu.com/#charset-mono-regular-italic I think. I will do a better demo if you want

http://imgur.com/8mteU4r
Title: Re: Tool for generating outlined bitmap fonts
Post by: tryphon on October 31, 2015, 08:07:23 pm
Thanks for the answer. Looks good. I'll try by myself and will tell you if help is needed :)

November 01, 2015, 03:24:39 am - (Auto Merged - Double Posts are not allowed before 7 days.)
So, not much success :

1) there's no 'alpha to selection' in my right-click menu. I use GIMP 2.8.14

2) I got a fitting selection by using 'selection / by color'

3) when growing then painting, I get a solid outline with no gradient (so no antialiasing)
Title: Re: Tool for generating outlined bitmap fonts
Post by: FAST6191 on November 01, 2015, 09:04:17 am
Sorry I meant to say in the layers tab/window.  Right click on the layer in question there
http://imgur.com/Oezz0NR
I have a slightly customised layout but it is on the same place once you get to the layers tab.

3) I do not quite follow. If you want a slight blur to the edges then you do have the option to feather selection, or you can use more traditional blurring filters if you prefer. Also anti aliasing should be an option in the text creation option in the first stage, you may have to select it (not sure what the defaults might be) though. The alpha to selection option should respect the anti aliasing, probably more than by colour.
Title: Re: Tool for generating outlined bitmap fonts
Post by: tryphon on November 01, 2015, 11:25:49 am
Yes, it was an issue with RGB selection. GIMP is a great tool, but you really have to know where everything lie :)

Finally I wrote another Python script that does what I think you described in the first post and the result seems similar to yours (with the benefit that it's immediate now).

Thanks for your help :)
Title: Re: Tool for generating outlined bitmap fonts
Post by: M-Tee on November 03, 2015, 10:13:15 am
You could use Photoshop Actions.