How to add a new font?

For topics that do not fit in another sub-forum.

Moderator: Oberlus

Message
Author
And
Space Krill
Posts: 2
Joined: Fri Mar 03, 2006 2:33 am

How to add a new font?

#1 Post by And »

For translation FreeOrion into Russian it is necessary to add a font supporting cyrillics. How it to make?

User avatar
pd
Graphics Lead Emeritus
Posts: 1924
Joined: Mon Mar 08, 2004 6:17 pm
Location: 52°16'N 10°31'E

#2 Post by pd »

Either by using the options menu(-> ui appereance) or by opening the config.xml and changing the values for those tags:

Code: Select all

    <font>Vera.ttf</font>
    <font-bold>VeraBd.ttf</font-bold>
    <font-size>12</font-size>

Yoghurt
Programmer
Posts: 376
Joined: Sat Jun 28, 2003 8:17 pm
Location: Heidelberg, Germany

#3 Post by Yoghurt »

I'll think we use DejaVu for this.

DejaVu is based on Vera, and added support for cyrillic and other languages

Yoghurt
Programmer
Posts: 376
Joined: Sat Jun 28, 2003 8:17 pm
Location: Heidelberg, Germany

#4 Post by Yoghurt »

BTW: What encoding are you using?

I'd propose UTF-8

Yoghurt
Programmer
Posts: 376
Joined: Sat Jun 28, 2003 8:17 pm
Location: Heidelberg, Germany

#5 Post by Yoghurt »

I've added DejaVu to the SVN repository.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12819
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

#6 Post by Geoff the Medio »

Yoghurt wrote:I've added DejaVu to the SVN repository.
They should be included in the next point release, but until then, the files can be downloaded manually from here. Just get:

DejaVuSans-Bold.ttf
DejaVuSans-BoldOblique.ttf
DejaVuSans-Oblique.ttf
DejaVuSans.ttf
License.DejaVu

and put them in your main FreeOrion/ directory, then do as pd suggested.

Yoghurt: perhaps there should be an additional (optional?) line at the start of stringtable files to indicate what font files to use by default, so that anyone changing the stringtable doesn't then have to manually change all the font files as well?

Yoghurt
Programmer
Posts: 376
Joined: Sat Jun 28, 2003 8:17 pm
Location: Heidelberg, Germany

#7 Post by Yoghurt »

I think we will just replace Vera with DejaVu, as DejaVu == Vera + additional chars

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12819
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

#8 Post by Geoff the Medio »

Note that v0.3.1-RC4 uses and contains the new DejaVu font...

Yoghurt
Programmer
Posts: 376
Joined: Sat Jun 28, 2003 8:17 pm
Location: Heidelberg, Germany

#9 Post by Yoghurt »

Did Zach say anything about the encoding?

I'd go with UTF-8, as already said.

Naesbye
Krill Swarm
Posts: 11
Joined: Thu Dec 11, 2008 9:46 pm

Re: How to add a new font?

#10 Post by Naesbye »

For the record, DejaVu has been updated and expanded several times since the 2.1 version included presently. A lot of the Latin/Greek/Cyrillic characters have been refined and some new characters have been added.

I contributed a little to it myself some time ago - http://dejavu.sourceforge.net/wiki/index.php/User:Lars - to get the glyphs for Mac Command and Option keys included.

Might I suggest an update of the included fonts? I seem to recall they were renamed slightly at one point, but that might have been before version 2.1.....

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12819
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: How to add a new font?

#11 Post by Geoff the Medio »

I've updated the DejaVu fonts and license in SVN to vesrion 2.27.

antgraf
Space Krill
Posts: 2
Joined: Mon Jan 05, 2009 11:52 am

Re: How to add a new font?

#12 Post by antgraf »

Guys, could you please point me is cyrillic supported now? I'm using 0.3.10 release with DejaVu fonts. Cyrillic is displayed incorrectly both for UTF-8 and ANSI encodings.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12819
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: How to add a new font?

#13 Post by Geoff the Medio »

The SVN version, and hopefully-soon-to-be-released v0.3.11 do support cyrillic text. Use UTF-8 encoding.
Attachments
FreeOrion main splash menu with Russian stringable, illustrating cyrllic characters
FreeOrion main splash menu with Russian stringable, illustrating cyrllic characters
FreeOrion_Rus_Stringtable.png (497.35 KiB) Viewed 2591 times

User avatar
Josh
Graphics
Posts: 452
Joined: Mon Dec 31, 2007 10:49 am
Location: California, USA

Re: How to add a new font?

#14 Post by Josh »

O geez, now I can't read it. Is there a way to switch it back?

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12819
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: How to add a new font?

#15 Post by Geoff the Medio »

Your local community college probably has language courses...

Post Reply