Changing Font (text) Of Rune

This does not work for versions 1.00-1.02. There are ways to change the fonts there too, I will write more about that later.

To change the fonts of Rune you need to make a new FontInfo class and a new RuneRootWindow class, and then tell Rune to use these new classes. Here is how to do it:

1. New package setup

Make a new folder in your game System folder. Choose a suitable name for your package, I named my folder “FontChange”. Inside this folder make a new folder with the name “Classes”. Inside this folder make two new files, “FontChangeFontInfo.uc” and “FontChangeRootWindow”.

You should now have these two files:

C:\Rune\FontChange\Classes\FontChangeFontInfo.uc
C:\Rune\FontChange\Classes\FontChangeRootWindow.uc

Now we need to add some code to these new classes. Open up FontChangeFontInfo.uc in a text editor and add:

//=========================
// FontChangeFontInfo.uc
//=========================
Class FontChangeFontInfo extends FontInfo;

// Debugging, Scoreboard ping
static function font GetStaticSmallFont()
{
	//return Font'SmallFont';
	return Font(DynamicLoadObject("NewFonts.Font16", class'Font'));
}

// Scoreboard, Pause message
static function font GetStaticMedFont()
{
	//return Font'MedFont';
	return Font(DynamicLoadObject("NewFonts.Font16", class'Font'));
}

// Chat messages
static function font GetStaticBigFont()
{
	//return Font'Haettenschweiler16';
	return Font(DynamicLoadObject("NewFonts.Font26", class'Font'));
}

// Progress messages
static function font GetStaticLargeFont()
{
	return Font'RuneLarge';
	//return Font(DynamicLoadObject("NewFonts.Font24", class'Font'));
}

// Not used
static function font GetStaticRuneMedFont()
{
	return Font'RuneMed';
	//return Font(DynamicLoadObject("NewFonts.Font30", class'Font'));
}

// Not used
static function font GetStaticCreditsFont()
{
	return Font'RuneCred';
	//return Font(DynamicLoadObject("NewFonts.Font30", class'Font'));
}

// Not used
static function font GetStaticButtonFont()
{
	return Font'RuneButton';
	//return Font(DynamicLoadObject("NewFonts.Font30", class'Font'));
}

As you can see we are just telling the game to load our own fonts instead of the default ones. Some of the fonts defined there are not used for anything.

Then open FontChangeRootWindow.uc and add:

//=========================
// FontChangeRootWindow.uc
//=========================
Class FontChangeRootWindow extends RuneRootWindow;

// These are for the GUI menus
function SetupFonts()
{
    // Window text, console text, game version text
    Fonts[F_Normal] = 	  	Font(DynamicLoadObject("NewFonts.Font14", class'Font'));

    // Window titles, selected tabs
    Fonts[F_Bold] = 	  	Font(DynamicLoadObject("NewFonts.Font14", class'Font'));

    // Big menu buttons
    Fonts[F_RuneButton] = 	Font(DynamicLoadObject("NewFonts.Font30", class'Font'));

    // Not used
    Fonts[F_Large] = 	  	Font(DynamicLoadObject("NewFonts.Font10", class'Font'));
    Fonts[F_LargeBold] =  	Font(DynamicLoadObject("NewFonts.Font10", class'Font'));
    Fonts[F_RuneMedium] = 	Font(DynamicLoadObject("NewFonts.Font10", class'Font'));
    Fonts[F_RuneBig] = 	  	Font(DynamicLoadObject("NewFonts.Font10", class'Font'));
    Fonts[F_RuneLarge] =  	Font(DynamicLoadObject("NewFonts.Font10", class'Font'));
}

Save both files.

2. Compiling the code

First open Rune.ini and search find the list with all the “EditPackages=”. At the end of this list, after all other EditPackages add:

EditPackages=FontChange

Save the file and exit.

Next open up a command prompt (Start Menu–>Run–>cmd or something) and navigate to the Rune system folder. Then write this in the command prompt window:

ucc make

This should compile the code from the two new classes into a package called FontChange.u. Close the command prompt.

3. Importing the new font

Now you need to find a font you want to use in the game, for this example I am using some font I downloaded for free from the internet called “BadaBoom BB”. You can use any true type font really, just search with google and find something you like.

If you use a font from the internet you must install it in Windows before you import it to Rune! Go to the control panel or something and and find the place where you install fonts.

After you got your font create a text with the following content:

new TrueTypeFontFactory PACKAGE="NewFonts" Name=Font8 FontName="BadaBoom BB" Height=8 AntiAlias=1 CharactersPerPage=64
new TrueTypeFontFactory PACKAGE="NewFonts" Name=Font10 FontName="BadaBoom BB" Height=10 AntiAlias=1 CharactersPerPage=64
new TrueTypeFontFactory PACKAGE="NewFonts" Name=Font12 FontName="BadaBoom BB" Height=12 AntiAlias=1 CharactersPerPage=64
new TrueTypeFontFactory PACKAGE="NewFonts" Name=Font14 FontName="BadaBoom BB" Height=14 AntiAlias=1 CharactersPerPage=64
new TrueTypeFontFactory PACKAGE="NewFonts" Name=Font16 FontName="BadaBoom BB" Height=16 AntiAlias=1 CharactersPerPage=64
new TrueTypeFontFactory PACKAGE="NewFonts" Name=Font18 FontName="BadaBoom BB" Height=18 AntiAlias=1 CharactersPerPage=16
new TrueTypeFontFactory PACKAGE="NewFonts" Name=Font20 FontName="BadaBoom BB" Height=20 AntiAlias=1 CharactersPerPage=16
new TrueTypeFontFactory PACKAGE="NewFonts" Name=Font24 FontName="BadaBoom BB" Height=24 AntiAlias=1 CharactersPerPage=16
new TrueTypeFontFactory PACKAGE="NewFonts" Name=Font26 FontName="BadaBoom BB" Height=26 AntiAlias=1 CharactersPerPage=16
new TrueTypeFontFactory PACKAGE="NewFonts" Name=Font30 FontName="BadaBoom BB" Height=30 AntiAlias=1 CharactersPerPage=16
new TrueTypeFontFactory PACKAGE="NewFonts" Name=Font36 FontName="BadaBoom BB" Height=36 AntiAlias=1 CharactersPerPage=8
OBJ SAVEPACKAGE PACKAGE="NewFonts" FILE="..\Textures\NewFonts.utx"

Replace BadaBoom BB with the name of your own font. Save the file as “import.txt” in your Rune system folder.

Open up the map editor RuneEd, then from the top menu open the log window (Top Menu->Window->Log). You can write commands in this window, and from here we will import the new fonts with the text file we just created. In the log window write this command:

exec import.txt

Now you will see many messages, and when you see Moving ‘..\Textures\Save.tmp’ to ‘..\Textures\NewFonts.utx’ you can close RuneEd.

You have now created the texture file containing the new font.

4. Changing the ini files

Now you have all the files you need, all that is left to do is to tell Rune to use these new packages and classes.

Open Rune.ini and add at the bottom:

[RuneI.RuneScoreboard]
FontInfoClass=FontChange.FontChangeFontInfo

[RMenu.RuneConsole]
RootWindow=FontChange.FontChangeRootWindow
MouseScale=0.400000
ShowDesktop=False
bShowConsole=False
MenuTranslucency=1.000000
UWindowKey=IK_None

Open User.ini and add at the bottom:

[RuneI.RuneHUD]
FontInfoClass=FontChange.FontChangeFontInfo

That is all. Save both ini files and start up the game. You should now see the new fonts wherever you enabled it.

The new font and the old one in comparison:

Advertisements

Posted on 2012/09/08, in Tweaks And Config and tagged , , , , , , , , , , . Bookmark the permalink. 11 Comments.

  1. how to change a counter or button’s like “multiplayer, options, new game” etc fonts?

    • The font of the menu buttons are changed as in example:

      Class NewClass extends RuneRootWindow;

      function SetupFonts()
      {
      Fonts[F_RuneButton] = Font(DynamicLoadObject(“Engine.SmallFont”, class’Font’));
      }

      That should be the line that changes the font for the menu buttons.

      Then just add to Rune.ini:

      [RMenu.RuneConsole]
      RootWindow=NewPackage.NewClass

      You can make the fonts change to fit different screen sizes if you want, I think that is what it does by default:

      http://www.menjin.org/undox/rrundox/RMenu.RuneRootWindow.html

  2. That don’t work : (
    I make new packages and class also make class bellow fontInfo. That dont work so i try also to add new classes to Fontchange.u but result always the same Rune crush when i press join button 😥 (and buttons are the same as usual) im using Rune 1.08c Gold edition with 1.09 menu. This is very important to my project Rune HD (i add new d3d9 and openGL render’s so i can import 1024×1024 textures not just standard 256×256 u can read more here: http://www.moddb.com/mods/rune-120-rune-hd) so if u have some free time i will be very gratefull to u if u help to fix that problem and offcourse if u want to join HD project ur also wellcome cuz we need scripter’s 😀

  3. Glad you’ve thought of fonts.. I’ve decided to help. Thanks goes to Voy for annoying me with this great info 🙂

    Heres what I did.. I loaded the new “PR Uncial” font tff file into my Windows’ bank of fonts. The name it is listed as there is what you will use to load it into a Rune font using OBJ LOAD (see below). Use these source files and my notes inside the package at torclan DOT com SLASH RMenuProject DOT zip. Drag the project folder onto UMake (included) and follow the project notes aka instructions.

    //=====================================================
    // RuneButton -> Basic Button Class
    //=====================================================
    class RuneButton extends UWindowDialogControl config(System);
    #exec OBJ LOAD FILE=”Textures\RMenu.utx” PACKAGE=RMenu
    #exec new TrueTypeFontFactory Name=NewButton FontName=”PR Uncial” Height=22
    AntiAlias=0 CharactersPerPage=64

    add this to extracted RMenu classes is RuneButton.uc

  4. i’ve done it and everything works good but i already have a 1.09 menu before and use it long time so when i change the FontName in #exec… from Pr Unicial to any other RMenu is mishmashed and it just don’t work and when i change the:
    Font = Font’Newbutton’;
    to:
    Font = Font(DynamicLoadObject(“NewFonts.NewButton”, class’Font’)); [Newfonts.Newbutton is my font utx package]

    in RuneButton.uc it works but i can’t join an server bc RMenu is also mishmashed i try to make a file bellow Runebutton and call it NewButton with code:

    class NewButton expands RuneButton;

    function Created()
    {
    //Font = Font’Newbutton’;
    Font = Font(DynamicLoadObject(“NewFonts.NewButton”, class’Font’));
    }

    but this new file somehow don’t overwrite older Runebutton any sugestions sensei? ^^

    • didnt you see conform.bat in the package? name the original RMenu to RMenu1, then compile the new RMenu, then run conform.bat

  5. works thank you so much Frozn 😀 if u ever come to poland u have a big joint from me 😀

  6. Froozn ! hehe how to scale hud in rune?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: