Jump to content

TTF Fonts support - is Santa already here?


alx3apps

Recommended Posts

It is hard to overestimate ability to customize GemRB fonts on mobile devices.

Today I read this: "custom TTF fonts support" (http://gemrb.git.sou...9de9c034a2feae7)

Then reread this: http://gemrb.sourcef...?id=plugins:ttf

Then build latest android version with sdl_ttf and freetype.

Then add this to GemRB.cfg:

CustomFonts=1
CustomFontsPath=/system/fonts/

Then change iwd/fonts.2da and how/fonts.2da to:

2DA V1.0
 NORMAL
 RESREF  NEED_PALETTE FIRST_CHAR LAST_CHAR FONT_NAME PT_SIZE  STYLE COLOR
 0 NORMAL  1  33  255  DroidSansMono  42  0 0xffffffff
...

Then run IWD ... and nothing happened - the same small dialogue fonts :sad:

Am I miss some configuration? Have Santa already brought me TTF fonts for Xmas? Or are his deers late?

Link to comment

I doubt that the android repo has merged the TTF code; TTF code was only merged into master yesterday. Try getting the latest code from git and building.

 

I updated the TTF wiki page; CustomFonts is no longer needed.

 

Edit: also TTF isn't a core feature it is a plugin so that may affect what you need to do to building if you aren't using cmake. if you are using cmake then examine the cmake output to see why it isnt building.

Link to comment

Thanks, SyntaxError, I compiled plugin, and now need some help with configuration. Trying it on linux for clarity.

Latest GemRB 1c7cdc1.

IWD:TotLM clean install.

GemRB.cfg:

GameType=how
CustomFontsPath=/usr/share/fonts/truetype/ttf-dejavu/
...

Font file:

ls -l /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
-rw-r--r-- 1 root root 606452 2008-05-19 10:44 /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf

Override/how/fonts.2da:

2DA V1.0
NORMAL
RESREF		NEED_PALETTE	FIRST_CHAR	LAST_CHAR	FONT_NAME	PT_SIZE		STYLE	COLOR
0	NORMAL		1				33			255			DejaVuSans	24			0		0xffffffff
1	INFOFONT	1				33			255			DejaVuSans	24			0		0xffffffff
2	NUMBER		0				48			57			DejaVuSans	24			0		0xffffffff
3	INITIALS	0				33			255			DejaVuSans	24			0		0xffffffff
4	NUMBER2		0				48			57			DejaVuSans	24			0		0xffffffff
5	NUMBER3		0				48			57			DejaVuSans	24			0		0xffffffff
6	NUMFONT		1				33			255			DejaVuSans	24			0		0xffffffff
7	REALMS		0				33			255			DejaVuSans	24			0		0xffffffff
8	REALMS2		1				33			255			DejaVuSans	24			0		0xffffffff
9	STONEBIG	0				33			255			DejaVuSans	24			0		0xffffffff
10	STONESM2	0				33			255			DejaVuSans	24			0		0xffffffff
11	STONESM3	0				33			255			DejaVuSans	24			0		0xffffffff
12	STONESML	0				33			255			DejaVuSans	24			0		0xffffffff
13	TOOLFONT	1				33			255			DejaVuSans	24			0		0xffffffff
# state "fonts" are the status icons. You probably don't want to edit these.
14	STATES	  0				1			255			STATES		14			0		0xffffffff
15	STATES2	 0				1			255			STATES2		14			0		0xffffffff

# Customization How To: http://gemrb.sourceforge.net/wiki/doku.php?id=plugins:ttf

Console output on startup:

...
[PluginMgr]: Loading: /usr/local/lib/gemrb/plugins/TTFImporter.so... TTF Font Importer...[OK]
...
[ResourceManager]: Searching for fonts.2da...[GemRB Override]
[ResourceManager]: Searching for NORMAL... NORMAL.bam...[chitin.key]
[bAMImporter]: Constructing BAM font: 223 characters...
[ResourceManager]: Searching for INFOFONT... INFOFONT.bam...[chitin.key]
[bAMImporter]: Constructing BAM font: 223 characters...
[ResourceManager]: Searching for NUMBER... NUMBER.bam...[chitin.key]
[bAMImporter]: Constructing BAM font: 11 characters...
[ResourceManager]: Searching for INITIALS... INITIALS.bam...[chitin.key]
[bAMImporter]: Constructing BAM font: 223 characters...
[ResourceManager]: Searching for NUMBER2... NUMBER2.bam...[chitin.key]
[bAMImporter]: Constructing BAM font: 11 characters...
[ResourceManager]: Searching for NUMBER3... NUMBER3.bam...[chitin.key]
[bAMImporter]: Constructing BAM font: 11 characters...
[ResourceManager]: Searching for NUMFONT... NUMFONT.bam...[chitin.key]
[bAMImporter]: Constructing BAM font: 223 characters...
[ResourceManager]: Searching for REALMS... REALMS.bam...[chitin.key]
[bAMImporter]: Constructing BAM font: 223 characters...
[ResourceManager]: Searching for REALMS2... REALMS2.bam...[chitin.key]
[bAMImporter]: Constructing BAM font: 223 characters...
[ResourceManager]: Searching for STONEBIG... STONEBIG.bam...[chitin.key]
[bAMImporter]: Constructing BAM font: 223 characters...
[ResourceManager]: Searching for STONESM2... STONESM2.bam...[chitin.key]
[bAMImporter]: Constructing BAM font: 223 characters...
[ResourceManager]: Searching for STONESM3... STONESM3.bam...[chitin.key]
[bAMImporter]: Constructing BAM font: 223 characters...
[ResourceManager]: Searching for STONESML... STONESML.bam...[chitin.key]
[bAMImporter]: Constructing BAM font: 223 characters...
[ResourceManager]: Searching for TOOLFONT... TOOLFONT.bam...[chitin.key]
[bAMImporter]: Constructing BAM font: 223 characters...
[ResourceManager]: Searching for STATES... STATES.bam...[chitin.key]
[bAMImporter]: Constructing BAM font: 255 characters...
[ResourceManager]: Searching for STATES2... STATES2.bam...[chitin.key]
[bAMImporter]: Constructing BAM font: 255 characters...
[Core]: Fonts Loaded...[OK]																						

Old fonts in game.

Could you help me? I think I missed some configuration options.

Link to comment

You've done great work towards health of the eyes of GemRB users!

 

Complete instructions for android users:

1) Install latest android build (newer then 21.12).

2) Add fonts directory path to GemRB.cfg

CustomFontPath=/system/fonts/

3) In file /sdcard/app-data/net.sourceforge.gemrb/override/<your game type>/fonts.2da change line starts with

0	NORMAL	1	33	255	NORMAL   14	0	0xffffffff

to

0	NORMAL	1	33	255	DroidSans	20	0	0xffffffff

You can use any TTF font.

Tthis is example of font your should use, when playing BG2 by solo kensai/mage bringing 'celestial fury' with you and not using pause in battles:

 

kI6p9.png

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...