Libellés

blog (2) cycling (1) demoscene (1) made (1) news (9) skins (1) tips (2) video (1)

mercredi 20 avril 2011

Spacing trick

Here's a trick I found recently:
There I am converting one of the old fonts by Made to the Grafx2 format. But there's a problem: The fonts' glyphs are neatly arranged 16px wide, and our format requires to arrange them in 17 pixel columns (15px character, 1px explicit space, 1px marker). Cutting and pasting with brush tool would do the trick, but it requires very precise positioning both in cut and paste. Instead we'll use a trick with the smooth tool. What?!

Look at this matrix with only zeroes and a single one: It means that each modified pixel will get the color... of the pixel to its left. With these settings and SMOOTH MODE:ON, I'm going to draw large filled rectangles over the blocks that I want to shift right, one column at a time.






While dragging rectangle:


After release (spacing between N and O has increased from 1 to 2 pixels)

 There, font is now neatly aligned on 17px grid:

 Note: This smooth trick converts color indexes to RGB then to color indexes again. If there are duplicates in the palette, you don't have guarantee that the color indexes are preserved. In my case, I had to merge the blacks into a single color again. (Palette screen : Reduce to: unique)

Aucun commentaire:

Enregistrer un commentaire