How to create custom font with zero pixels of vertical gap between lines?

I want to create a custom font where each character is exactly 6 pixels wide, 6 pixels tall, with zero pixels of gap between adjacent characters, both horizontally and vertically.

I have successfully accomplished most of this.  The characters are the correct size, with zero horizontal gap between them.  However, when I draw a string with a newline, there are 3 blank rows of pixels between the two lines of text.

How can I modify the font to eliminate this three pixel gap?

Here is my code with the font I'm using: garmin-sandbox/GfxPerfSandbox/resources/fonts/gfx_font.fnt at main · cspotcode/garmin-sandbox (github.com)

The broader context: I want to cover the screen in a grid of tiles using a single draw call.  The tiles are described by a ByteArray which I convert to a string, then draw the string.  The ByteArray contains newline characters (number 10) between rows of tiles.

If I can eliminate this 3 pixel gap, then I can cover the screen in tiles.

Related to Techniques for faster pixel-level drawing? - Discussion - Connect IQ - Garmin Forums

  • I decompiled the monkeyc compiler's font code, and I don't see where this "3" value is being put into the font at all.  So I'm worried it's hard-coded into the implementation of drawText, not into the font.

  • You have a unique use case.  the "\n" is handled by drawText() and the character for that in your font isn't used.

    Consider the string "hello\nworld" drawn with any font, custom or native.  In general, would you want the lines butted together?  No, you want a space, and from what I see, that space is based on the font height.  If you want to control the space, you need to do a line at a time and change "y" to be the space you want