[phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 1823: Undefined array key 12345
[phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 1833: Trying to access array offset on value of type null
[phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 1833: Trying to access array offset on value of type null
[phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 1823: Undefined array key 12345
[phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 1833: Trying to access array offset on value of type null
[phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 1833: Trying to access array offset on value of type null
[phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 1823: Undefined array key 12345
[phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 1833: Trying to access array offset on value of type null
[phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 1833: Trying to access array offset on value of type null
[phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 1823: Undefined array key 12345
[phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 1833: Trying to access array offset on value of type null
[phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 1833: Trying to access array offset on value of type null
OldUnreal (Engine) • Unreal Fonts
Page 1 of 2

Unreal Fonts

Posted: Fri Oct 30, 2009 5:07 pm
by Marzanna
While translating Unreal I got headache about fonts.
And I have a couple of questions.
I) Why UnrealEd doesn't import Arial Bold and Tahoma Bold?
It doesn't import it at all! It just imports another font!
And why UnrealEd imports theese fonts running in wine!?
But it doesn't import Tahoma font!
It so confusing...
II)How can I make LargeFont? Do I need to make it myself in graphic editor or it can be imported too?

Re: Unreal Fonts

Posted: Fri Oct 30, 2009 5:50 pm
by スマイル・ドラゴン
I have no idea how to make the bitmapped fonts, the ones you see named as "SmallFont" "TinyFont" "MedFont" "BigFont" and "LargeFont", which are stored on Engine and are the constant defaults, nobody's ever told me how the hell these things work and how you're supposed to generate them, Deus Ex has custom versions of these fonts, and I don't even know how they import them.

As for how to make them, you will need a bitmap editor that can edit PCX files, and I can imagine you'll have to hand draw them or type them yourself using your image editors text tool. Don't ask me how to map the resultant image to a font since nobody's documented this, ever.

As for what you described, I have no idea why the TTF font importer is going screwy for you, maybe it can't read the font for some reason? I thought UT99 imported Arial Bold for the spree messages...

Re: Unreal Fonts

Posted: Fri Oct 30, 2009 8:00 pm
by []KAOS[]Casey
1) #EXEC new TrueTypeFontFactory PACKAGE="MyPackage" Name=ArialBold10 FontName="Arial Bold" Height=10 AntiAlias=0

It appears you need quotes, no quotes = imports Arial for some reason. Seems to look bold so I think it's fine.

2)#EXEC new TrueTypeFontFactory PACKAGE="MyPackage" Name=Tahoma10 FontName="Tahoma" Height=10 AntiAlias=0

Height is equviliant to font size, so name it according to Name for a good convention

Be sure to add "Count=xxxx" to increase over the 256 default font import.

Count=65535 will import ALL characters but will use a HUGE amount of memory, I would only use it to grab a few extra characters you need.

Re: Unreal Fonts

Posted: Fri Oct 30, 2009 8:07 pm
by []KAOS[]Casey
Updated post

Re: Unreal Fonts

Posted: Fri Oct 30, 2009 8:18 pm
by Marzanna
Count=65535 will import ALL characters but will use a HUGE amount of memory, I would only use it to grab a few extra characters you need.
I didn't find Count usefull, I just edited fonts by copying Cyrillic charachters to first 255 cells. And it works well.
I use this script to import fonts.

Code: Select all

new TrueTypeFontFactory PACKAGE="UWindowFonts" Name=Tahoma10 FontName="Tahoma" Height=10 AntiAlias=0
 new TrueTypeFontFactory PACKAGE="UWindowFonts" Name=Tahoma20 FontName="Tahoma" Height=20 AntiAlias=1
 new TrueTypeFontFactory PACKAGE="UWindowFonts" Name=Tahoma30 FontName="Tahoma" Height=30 AntiAlias=1 CharactersPerPage=32
 new TrueTypeFontFactory PACKAGE="UWindowFonts" Name=TahomaB10 FontName="Tahoma Bold" Height=10 AntiAlias=1
 new TrueTypeFontFactory PACKAGE="UWindowFonts" Name=TahomaB20 FontName="Tahoma Bold" Height=20 AntiAlias=1 XPad=2
 new TrueTypeFontFactory PACKAGE="UWindowFonts" Name=TahomaB30 FontName="Tahoma Bold" Height=30 AntiAlias=1 CharactersPerPage=32 XPad=2
 new TrueTypeFontFactory PACKAGE="UWindowFonts" Name=UTFont12 FontName="Verdana" Height=12 AntiAlias=0
 new TrueTypeFontFactory PACKAGE="UWindowFonts" Name=UTFont24 FontName="Arial Narrow" Height=24 AntiAlias=1
 new TrueTypeFontFactory PACKAGE="UWindowFonts" Name=UTFont40 FontName="Arial Bold" Height=40 CharactersPerPage=32 AntiAlias=1
 OBJ SAVEPACKAGE PACKAGE="UWindowFonts" FILE="..\Textures\UWindowFonts.utx"
But it doesn't import neither original nor hacked tahomabd and arilabd
I can't understand why it works in wine!
About MedFont:
How Unreal gets glyph's coordinates to draw? I have MedFont which have different glyph layout rather then original MedFont.

Re: Unreal Fonts

Posted: Fri Oct 30, 2009 8:57 pm
by []KAOS[]Casey
Never really experimented with the font PCX deal. No idea, but I should be able to get the source texture from smirf to see if its just placement in the texture

Re: Unreal Fonts

Posted: Fri Oct 30, 2009 9:02 pm
by スマイル・ドラゴン
About MedFont:
How Unreal gets glyph's coordinates to draw? I have MedFont which have different glyph layout rather then original MedFont.
I'm starting to wonder how that works too... I wish someone would just shed some light on this instead of talking about TTFImporter.

Re: Unreal Fonts

Posted: Fri Oct 30, 2009 9:10 pm
by Marzanna
I've successfully imported all TTF fonts under wine! I just copied my tahoma.ttf to /usr/share/fonts/TTF and /usr/share/wine/fonts

Re: Unreal Fonts

Posted: Fri Oct 30, 2009 10:53 pm
by [§Ŕ] ŤhěxĐâŕkśîđěŕ
Never really experimented with the font PCX deal. No idea, but I should be able to get the source texture from smirf to see if its just placement in the texture
I don't think it's just the placement, many fonts are not monospace, not only that, they have different spacings as well. It's weird.

Re: Unreal Fonts

Posted: Sat Oct 31, 2009 6:35 am
by スマイル・ドラゴン
I don't think it's just the placement, many fonts are not monospace, not only that, they have different spacings as well. It's weird.
Yeah, try exporting the Engine font's with UTPT, as "FONT", and it exports a long .txt file that seems to specify in the bitmap which character is which, X,Y, coords for each ASCII character.

Re: Unreal Fonts

Posted: Sat Oct 31, 2009 4:15 pm
by [§Ŕ] ŤhěxĐâŕkśîđěŕ
Yeah... I also don't think there's an option to make a font monospace, so it saves up disk space that way... Oh well whatever I guess it's not a lot of space...

Re: Unreal Fonts

Posted: Sun Nov 01, 2009 7:14 pm
by Marzanna
I got information according to bitmap fonts. When importing to Unreal, special grid is used to make special file in package that stores information about coordinates and sizes.

Re: Unreal Fonts

Posted: Sun Nov 01, 2009 7:28 pm
by スマイル・ドラゴン
Care to elaborate on that Skaarj[ZR]? How does one go about making this grid? Uniform blue square units with the characters in them?

Re: Unreal Fonts

Posted: Mon Nov 02, 2009 1:11 pm
by Marzanna
Grid color must be first color from palette.
And grid must fit glyph size.

ADDED: it's 255th color

Re: Unreal Fonts

Posted: Tue Nov 03, 2009 11:52 am
by Marzanna
UnrealEd, Advanced Options and other Unreal windows use only 225 characters from TrueType fonts. So it can't use non-ANSI characters.
I've already told about that. But I want to know, Can it be fixed?

Re: Unreal Fonts

Posted: Tue Nov 03, 2009 3:06 pm
by []KAOS[]Casey
you have to set COUNT= to a number higher than 255, and you can't use constants like strings with those characters in them, typing them in a soneole and putting them in read only int files for localization should work, you can also use chr(x) in unrealed if you really want it hardcoded

Re: Unreal Fonts

Posted: Tue Nov 03, 2009 3:37 pm
by Marzanna
Can you explain me where i should set "COUNT="?
And how can I use "chr(x)"?

Re: Unreal Fonts

Posted: Tue Nov 03, 2009 4:20 pm
by []KAOS[]Casey
new TrueTypeFontFactory PACKAGE="UWindowFonts" Name=Tahoma10 FontName="Tahoma" Height=10 AntiAlias=0 Count=65535


chr(0xFF) displays char 255, it's uscript

Re: Unreal Fonts

Posted: Tue Nov 03, 2009 5:39 pm
by Marzanna
I'm talking about UnrealEd WINDOW. Not about ttf importing.

Image

Look at this shot. You can see some symbols in caption.
I suppose it can be fixed only by changing unreal sources.

Re: Unreal Fonts

Posted: Tue Nov 03, 2009 8:15 pm
by []KAOS[]Casey
smirf will need to look into that, it SHOULD support UTF-8

Re: Unreal Fonts

Posted: Tue Nov 03, 2009 8:55 pm
by Marzanna
If I save my translation in UTF-8, only strange squares will be visible.

Re: Unreal Fonts

Posted: Wed Nov 04, 2009 9:11 am
by Marzanna
I noticed strange font behavior. If I change Language to rut in Unreal.ini, LargeFont substitutes with MedFont in game. It happens with original fonts and with Cyrillic fonts. Why?

UPDATE: LargeFont doesn't work with frt and det languages too.
I see MedFont instead LargeFont! LargeFont works only with int language.

Re: Unreal Fonts

Posted: Sat Nov 07, 2009 12:45 pm
by Marzanna
Here, I described a way how to use localized fonts and not get net incompatible game. But it's not true for WhiteFont! How can I use another WhiteFont instead of original one?

P.S. Please, fix code tags, i don't know how to use wiki tags properly. fixed

Re: Unreal Fonts

Posted: Mon Jan 04, 2010 4:15 pm
by Smirftsch
messing with it quite some time now, but without much progress

it uses windows GDI CreateFont Function
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

CreateFontW(Height, 0, 0, 0, FW_NORMAL, 0, 0, 0, Charset, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, AntiAlias ? ANTIALIASED_QUALITY : NONANTIALIASED_QUALITY, DEFAULT_PITCH, *FontName)

I added the define for "Charset", while the charset list is the following (out of WinGDI.h):

#define ANSI_CHARSET 0
#define DEFAULT_CHARSET   1
#define SYMBOL_CHARSET    2
#define SHIFTJIS_CHARSET  128
#define HANGEUL_CHARSET   129
#define HANGUL_CHARSET    129
#define GB2312_CHARSET    134
#define CHINESEBIG5_CHARSET     136
#define OEM_CHARSET 255
#define JOHAB_CHARSET     130
#define HEBREW_CHARSET    177
#define ARABIC_CHARSET    178
#define GREEK_CHARSET     161
#define TURKISH_CHARSET   162
#define VIETNAMESE_CHARSET 163
#define THAI_CHARSET 222
#define EASTEUROPE_CHARSET 238
#define RUSSIAN_CHARSET   204

using the import like this:
new TrueTypeFontFactory  PACKAGE="UWindowFonts" Name=Tahoma10  FontName="Tahoma" Height=10 AntiAlias=0 Charset=204

it should return the russian charset, but it obviously doesn't work, why I don't know yet.
Not sure if its just because its an english windows I use, or if the CreateFontW needs some other parameter yet. The Font itself on my system seems to contain the russian charset also, so it can't be that the chars are replaced.
Unfortunately I haven't found a way to debug this yet, but the imported chars are just "printed" into the texture then and are not reworked internally in any way, so the problem must be in the import above.
Suggestions are welcome...

Re: Unreal Fonts

Posted: Mon Jan 04, 2010 4:40 pm
by [§Ŕ] ŤhěxĐâŕkśîđěŕ
Besides the RUSSIAN_CHARSET const sitting in the #define, is it actually used anywhere? If yes, how? Is it implemented in the CreateFont function? Too bad that code can't be leaked, lol.