Font rendering

Note that this thread is probably interesting for devs only, but it’s sometimes hard to catch them in the irc-channel so I post it here g.

In rev695 I tried to add color blending that follows the RPG2k-way (currently hardcoded to the first color but it’s a start ;)).

From left to right: Rpg2k, EasyRpg with non-free pixelfont, EasyRpg with the default font.

As you can see, thx to the font smoothing, the default EasyRpg font DejaVuSans looks very strange. Imo because the font sizes are very small (we have a 320x240 resolution) I see no reason to font smooth at all.
I tried to disable it by changing TTF_RenderUTF8_Blended to TTF_RenderUTF8_Solid in bitmap.cpp:373 but then I get a corrupted output (with my blender even a crash). Does another dev, best would be the one who wrote the TextDraw-Function, has any idea why this happens? (and best would be a solution ;))

Hey Ghabry!

Great piece of code! I think rpg2k has fixed placeholders for every character (6x12 used often for latin glyphs and 12x12 used often for japanese glyphs and EXFONT bitmaps). Concerning blending, consider render without blending if the font is bitmap and with blending if the font is truetype format. You can find somewhat free .fon in old player folder (RM2000.fon and RMG2000.fon).

Skip blending with solid masking when using truetype font, try only with bitmap fonts, maybe the bug is there.

Btw you need to blend a shadow mask before in x+1 y+1 relative, to make the drop shadow effect. The color is fixed, rpg2k uses only one pixel to paint it, simply get the palette value of the first System pixel available at top left. Rpg2k ignores the other pixels, it’s not like the 20 “gradient” colors (see below).

If you want a hacked RPG_RT.exe (2000 or 2003) with a solid 12x12 EXFONT glyph to make experiments, o a hacked RM2000.fon with solid 6x12 glyph to do solid and position tests just say it.

Now, the system tech template:

Black zone is never used. Green zone can be transparent if first palette color is used. Red zone is never transparent, even if first palette color is used. Yellow zone works semi transparent and combined for sprite shadow with a very strange algorythm (will be explained later).

“BCKGRND” and “SHADOW” shows only one real pixel is used. Background pixel is for title menu without title file defined in database (it can be possible if the user deletes RPG_RT.ldb and creates new database from scratch). Background pixel is used for general background menu scene color (there are a small zone bottom left not covered with rectangle windows and maybe in other places, like enter hero name scene). Shadow pixel is used for text drop shadow only. Remember this pixel is “red” marked, so if first palette color is selected (default is orange), rpg2k will show that orange.

Research made by Cetros a few weeks ago (missing documentation on wiki yet).

More feedback:
log.txt for unix reports FaceSet/chara2 is missing from svn (closes after trying “new game”).
player2 crashes anyways when pressing X key on map to access menu (player2 dumps backtrace, so gdb could help).