Grafx2 bitmap fonts
Printed From: Pixel Joint
Category: The Lounge
Forum Name: Resources and Support
Forum Discription: Help your fellow pixel artists out with links to good tutorials, other forums, software, fonts, etc. Bugs and support issues should go here as well.
URL: https://pixeljoint.com/forum/forum_posts.asp?TID=20672
Printed Date: 14 September 2025 at 1:47am
Topic: Grafx2 bitmap fonts
Posted By: yrizoud
Subject: Grafx2 bitmap fonts
Date Posted: 06 January 2015 at 4:31pm
I just created a Lua script for Grafx2 to help convert (import) bitmap fonts, and wanted to share. http://pastebin.com/AVfjYLvg - http://pastebin.com/AVfjYLvg Example : Here's (part of) an image before conversion, with random space on every side and arbitrary space in-between. (Made with Times New Roman and a bit of pixel effects)
 Here's after running the script :
 The top lines are what Grafx2 uses to determine the width of each character, and the image is clipped to the smallest useful rectangle. After saving the resulting file in Grafx2's font directory, restarting and using the Text tool :

|
Replies:
Posted By: DawnBringer
Date Posted: 08 January 2015 at 12:27pm
Nice. I assume all chars must be placed on one row?
Btw. How do you get that line break instruction in the text-window?
|
Posted By: yrizoud
Date Posted: 08 January 2015 at 3:56pm
Yes, single row. I know it can get annoying with large fonts, most tools of grafx2 get limited by the viewport size. You enter line breaks with ctrl-enter.
|
Posted By: neota
Date Posted: 10 January 2015 at 5:36pm
Whenever I see multicolored fonts,I think about the problem of palettes; I basically don't want to use mcol fonts without the ability to recolor them (due to visibility issues etc). Is there any plan to eventually support multiple palettes per font (eg. by using GIF with frame-local palettes?) in GrafX2?.
If I understand your script correctly, it doesn't care whether the font is mono or multicolored, right? I'll try that out..
------------- absolutely.
|
Posted By: DawnBringer
Date Posted: 10 January 2015 at 5:57pm
The fonts, when used, become brushes that are remapped...and if you change the palette you can remap again, like any brush.
The fonts are normal images, you can make a new font by just changing the palette and saving under a new name. However I think a restart may be required for the program to find a new font.
|
Posted By: yrizoud
Date Posted: 10 January 2015 at 6:25pm
Yes, Grafx2 is already designed to mix pieces of images that have different palettes. When
you render text, the resulting brush is remapped to your current
image's palette. If you want to use the font to its fullest, you can hit
F11 ("get brush colors") to add the brush's original colors into your
image, in unused slots of the palette - and without creating duplicates.
The brush is then immediately recolored to this better palette.
The brush doesn't remap automatically when you change palette or switch between Main and Spare page. When you want, you can hit F12 to remap brush, it will find the most suitable colors in the current image's palette, and recolor the brush accordingly.
|
Posted By: neota
Date Posted: 10 January 2015 at 6:56pm
^ I think there has been a miscommunication. I'm aware of that functionality, but it doesn't relate to modifying the base colors that the font is rendered with; For example, rendering your example font with brown at the bottom and a red->yellow gradient rather than a brownish->pale green-blueish gradient. Or very dark blue at the bottom, with sky blue -> white gradient at the top. As far as I know GrafX2 does not support directly swapping the font palette, only the functions you described (copying a single fixed palette into the current image palette, or adapting the fixed font palette to the current image palette)
Dawnbringer, what you said addresses the issue.. although, it's still not very practical unless I misunderstand: I would need to generate the brush, switch to spare page, 'brush to image', modify the palette, 'image to brush', switch back to main page, to achieve the recolor, yes?
On another topic, can anyone see the error in this bitmap font I just made?

The problem appears to be around this area:

Since grafx2 displays all characters up to and including < correctly, but every following character is offset by one (eg. > becomes ?, ? becomes @, @ becomes A, A becomes B..). This would suggest that there is a problem with the > character, but I just don't see any difference between the way it's laid out and the way the other characters are laid out. Maybe it's the < character that's actually causing the problem, but I haven't noticed anything weird about that either.
EDIT: Never mind, was missing the = character.
------------- absolutely.
|
Posted By: yrizoud
Date Posted: 11 January 2015 at 9:19am
If you have a fixed amount of text to set, the simplest is to render the string "as is", paste it in the empty Spare page, and edit all you need there. When it looks good, grab it and bring it back to the Main page. Using Remap if the palettes are different, and "Add brush colors" if the host image really doesn't have suitable colors.
If you're going to use several strings, you don't want to repeat these changes every time, so instead you can edit the font file directly from within Grafx2. Each time you save the file, it's taken into account for the Text tool, so you can preview the result in the target image.
|
Posted By: neota
Date Posted: 11 January 2015 at 5:26pm
Ah thank you, that's good news about any edits saved taking effect immediately; So what Dawnbringer said about a restart being necessary is not true. That makes it much more practical :)
------------- absolutely.
|
Posted By: yrizoud
Date Posted: 11 January 2015 at 5:35pm
If you create a font you'll need to restart once, because the list of fonts is only created on startup.
|
|