I'm currently trying to make a bitmap font for PySDL2 and am having an issue with the spacing between characters. The API requires a surface, universal character-glyph width & height, and character mapping. The font is created by reading a glyph from the bitmap of the specified width & height by correlating it to the mapping that is inputted.
bmpfont = sdl2.ext.BitmapFont(font_surface, (64, 64), mapping)
I know a lot of game development frameworks utilize a similar pattern but allow for an XML list to account for the different sized characters (e.g., a 'w' is short & fat, where a '|' is tall & thin) by providing specific glyph width, heights, and offsets inside the bitmap. The PySDL2 BitmapFont documentation shows an offset dictionary, but to my knowledge (through several iterations of attempts) that's not able to be manipulated to accomplish a similar goal.
As you can see in my example below with '|'s and 'j's, the spacing looks silly because every single character is read as 64x64 pixels, and because of the aforementioned, I'm not able to control that spacing.
Due to the project requirements that this is meant to be integrated into, it must be a bitmap font and I can't leverage something like the TTF library for PySDL2. Any help is much appreciated.

I don't think this is possible using
py-sdl2'sext.fontlibrary, but generally the way to do this manually is to find the glyph, find its edges, and copy each one based on its individual bounding box. There's a guide here that describes this process in full using C++ and SDL2: https://lazyfoo.net/tutorials/SDL/41_bitmap_fonts/index.php.