gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Graphics > About enlargement of text when using mode 4 display mode

#16472 - pinkywu - Tue Feb 17, 2004 5:21 pm

I use the following bitmap function to convert texts into bitmap during display:
http://ihome.ust.hk/~ee_wckac/zxfont.c
When using mode 3 display, everything is fine. However, the font size is enlarged when mode 4 is used. Why? Is there any method to solve this problem?
Also, is there any software to convert font to bitmap(8-bit)?

#16480 - Miked0801 - Tue Feb 17, 2004 7:18 pm

My guess is that the renderer isn't taking into accout that mode4 writes out 2 pixels at a time and thus is double widthing the font. Just a guess.

#16482 - Cyberman - Tue Feb 17, 2004 8:06 pm

pinkywu wrote:
I use the following bitmap function to convert texts into bitmap during display:
http://ihome.ust.hk/~ee_wckac/zxfont.c
When using mode 3 display, everything is fine. However, the font size is enlarged when mode 4 is used. Why? Is there any method to solve this problem?
Also, is there any software to convert font to bitmap(8-bit)?


You cannot write to Video memory in terms of a byte, you can only use Word sized writes (see what the prior person said). So however you are putting the data to the display it is not likely working with this in mind.

You can make your own software to make fonts, as well. Use the GDI to estimate the width of the character preset your spacing. Write the text to a drawing surface then scan the drawing surface and convert the pixels to whatever way you wish them packed. It is advisable however to consider antialiasing the fonts, or they might look a bit rough around the edges.

It's easier to do in Borland C++ Builder (RAD tools) but it's still quite doable in VC++.

Have fun!

Cyb
_________________
If at first you don't succeed parachuting is NOT for you.