View Single Post
Old 29-02-16, 14:07   #11
AkyV
Moderator
 
Join Date: Dec 2011
Location: Hungary
Posts: 4,779
Default

10. Customization with WindowsFont Script command

Q: what can I customize with a WindowsFont command?
A:
- old, TRLR/TRLE texts – for font size, underlined/bold/Italic characters, letter shadow and its color, supporting native characters
- FLIPEFFECT without Parameters - for font size, underlined/bold/Italic characters, letter shadow and its color, supporting native characters
- FLIPEFFECT with Parameters= PARAM_PRINT_TEXT - for font size, underlined/bold/Italic characters, letter shadow and its color, supporting native characters
- FLIPEFFECT with Parameters= PARAM_WTEXT - for font size and color, text alignment, underlined/bold/Italic characters, letter shadow and its color, vertical typing, supporting native characters
- diary, texts on binoculars, TRNG savegame table - for font size and color, position, underlined/bold/Italic characters, letter shadow and its color, supporting native characters
- textpad - for font size and color, text alignment (only theoretically?), underlined/bold/Italic characters
- ammo text - for font size, underlined/bold/Italic characters, letter shadow and its color, supporting native characters
- Demo cutscene discussions – for font size, underlined/bold/Italic characters, letter shadow and its color, supporting native characters
- unimportant TRNG texts – for font size, underlined/bold/Italic characters, letter shadow and its color, supporting native characters

I didn’t mention some minor features (Ultra Bold or very slim characters, the same character width, printing from right to left), because I didn’t really have successful tests with them. Theoretically any text types I just listed should be able to apply them.

Q: which is the validity of a WindowsFont command?
A: you can have one, two or three WindowsFont for each command like this:

- One for the one and only possible DefaultWindowsFont Script command in title.
- One for each Parameters= PARAM_WTEXT Script command in title/any level.
- Two (for title/contents fonts) for each Diary Script command in title/any level. (Yes, diary works even it title!)
- One for each #TITLE_FONT# command in diary page setups.
- One for each #TEXT_FONT# command in diary page setups.
- Three (for title/savegame slot/statistics fonts) for each SavegamePanel Script command in title/any level.
- One for each Customize= CUST_BINOCULARS Script command in any level.

The WindowsFont of DefaultWindowsFont will be used for all the old, FLIPEFFECT (without Parameters or with Parameters= PARAM_PRINT_TEXT), ammo, actor discussion and unimportant texts of the game.
Other WindowsFont commands will be used only for the feature, to which that WindowsFont belongs. (So eg. the WindowsFont for a savegame panel title of a particular level will be used only for the title of that savegame panel.)

Technically you can attach the same WindowsFont to more than one feature. (Eg. WindowsFont#1 is attached to both Diary1 and Diary2 as the font of the general diary titles.)

Syntax:
WindowsFont= IdWindowFont, WindowFontName, WindowsFontFlags (WFF_...), SizeFont, ColorRbgId, ShadowColorRgbId

The first two fields are not for the customization:

- IdWindowFont is the ID of the command, to refer in some other Script commands (DefaultWindowsFont, Diary etc.) to this command.
- WindowFontName is where you define the font you use for this WindowsFont.

Don’t forget: the command for WindowsFont (DefaultWindowsFont, Diary etc.) must be typed AFTER its WindowsFont command in the Script.

Q: how to customize the font color with a WindowsFont command?
A: type the ID of a ColorRGB Script command in ColorRbgId field of the command.
The color defined in that ColorRGB will be used for that font.

The color will be used only for the feature, to which that WindowsFont belongs. - So eg. the WindowsFont for a savegame panel title of a particular level will be used only for the title of that savegame panel.
Type IGNORE if it is DefaultWindowsFont what is attached to this WindowsFont, because DefaultWindowsFont will ignore this field.

Notes:
- Don’t forget: the ColorRGB commands for WindowsFont must be typed BEFORE its WindowsFont command in the Script.
- You can draw even colored (non-white) characters in font editors. However, those colored characters will be ugly if the game engine will also color them. That’s why, if you have colored characters made by font editors, then customize white color now.

Q: how to customize the text position with a WindowsFont command?
A: type a constant in WindowsFontFlags field of the command:

WFF_CENTER_ALIGN: each line of the text will be aligned to the center of the area in which area the text is typed.
WFF_LEFT_ALIGN: each line of the text will be aligned to the left edge of the area in which area the text is typed.
WFF_RIGHT_ALIGN: each line of the text will be aligned to the right edge of the area in which area the text is typed.

The position will be used only for the feature, to which that WindowsFont belongs. - - So eg. the WindowsFont for a savegame panel title of a particular level will be used only for the title of that savegame panel. (In the case of PARAM_WTEXT texts, the exact position on the screen needs to be customized in PARAM_WTEXT. In the case of textpads, the exact position on the screen needs to be customized in the Image Script command of the texpad background. Besides, I don’t think these WFF constants really work with keypad. See RIB_ALIGN_CENTER in Parameters= PARAM_INPUT_BOX instead.)
Type IGNORE if it is DefaultWindowsFont what is attached to this WindowsFont, and if you don’t want to use other WFF constants for customization. Because DefaultWindowsFont will ignore WFF constants for position customization.

Q: how to customize the font size with a WindowsFont command?
A: type the size number in SizeFont field of the command.

The size will be used only for the feature, to which that WindowsFont belongs. - So eg. the WindowsFont for a savegame panel title of a particular level will be used only for the title of that savegame panel.
The size for the WindowsFont of DefaultWindowsFont will be used for all the old, FLIPEFFECT (without Parameters or with Parameters= PARAM_PRINT_TEXT), ammo, actor discussion and unimportant texts of the game.

Q: how to adjust the underlined/bold/Italic characters with a WindowsFont command?
A: type a constant in WindowsFontFlags field of the command:

WFF_BOLD: Bold characters.
WFF_ITALIC: Italic characters.
WFF_UNDERLINE: underlined text.

These properties will be used only for the feature, to which that WindowsFont belongs. - So eg. the WindowsFont for a savegame panel title of a particular level will be used only for the title of that savegame panel.
These properties for the WindowsFont of DefaultWindowsFont will be used for all the old, FLIPEFFECT (without Parameters or with Parameters= PARAM_PRINT_TEXT), ammo, actor discussion and unimportant texts of the game.

Notes:
- You can use more customizations in WindowsFontFlags field, if you use Sign + between the constants. Eg. position and bold and Italic customization: WFF_CENTER_ALIGN+WFF_BOLD+WFF_ITALIC.
- You don't need to use DefaultWindowsFont for your regular font only for the reason you want to use Bold or Italic characters.
Because if you load a font of your Windows into NG Font Editor, then it is easy to adjust Bold or Italic feature there.

Q: how to add shadow for the letters, with a WindowsFont command?
A: type a constant in WindowsFontFlags field of the command:

WFF_SHADOW: each letter will have a shadow.

Plus, type the ID of a ColorRGB Script command in ShadowColorRgbId of the command.
The color defined in that ColorRGB will be used for the shadow.

The shadow+color will be used only for the feature, to which that WindowsFont belongs. - So eg. the WindowsFont for a savegame panel title of a particular level will be used only for the title of that savegame panel.
The shadow+color for the WindowsFont of DefaultWindowsFont will be used for all the old, FLIPEFFECT (without Parameters or with Parameters= PARAM_PRINT_TEXT), ammo, actor discussion and unimportant texts of the game.

Q: how to adjust vertically typed text, with a WindowsFont command?
A: type a constant in WindowsFontFlags field of the command:

WFF_ROTATE_90: it will rotate the text with 90 degrees, clockwise.
WFF_ROTATE_INV_90: it will rotate the text with 90 degrees, anti-clockwise.

If you use this, then the text will be typed vertically only if you type a text with a FLIPEFFECT using Parameters= PARAM_WTEXT, if this WindowsFont is assigned to that Parameters= PARAM_WTEXT.

Note:
Be careful with this property. First of all, use only one-lined text.
And another thing: I suspect, sometimes (?) the printed string will "draw" other strings along as well.

Q: how to support native characters with a WindowsFont command?
A: first of all, type a constant in WindowFontName of the command, you need to name the required font with a code number, like:

204: Arial

The meaning of the most important code numbers:

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

Then, if the characterset still doesn’t work, you also need to try to type a constant in WindowsFontFlags field of the command:

WFF_UNICODE - recommended mostly with Asian characters.
WFF_UTF8 - recommended mostly with Eastern European characters.

The support will be used only for the feature, to which that WindowsFont belongs. - So eg. the WindowsFont for a savegame panel title of a particular level will be used only for the title of that savegame panel.
The support for the WindowsFont of DefaultWindowsFont will be used for all the old, FLIPEFFECT (without Parameters or with Parameters= PARAM_PRINT_TEXT), ammo, actor discussion and unimportant texts of the game.

WFF_UNICODE:
You also need to do this:

1. Put the text (you want to print, using this WindowsFont) into a DOC or RTF file, saving anywhere. Always type the text between two $$$$ blocks. For example: $$$$Text$$$$
2. Choose the last [ExtraNG] string, which must be empty.
3. Click on Binary String button, then click OK, then select that DOC/RTF.
4. Choose it on the pop-up panel:

- Click Cancel to close the panel. Now that $$$$Text$$$$ will show up as the contents of that string, converted into a special character-sequence. For example: &537AF6766567
- Or type a file name here, and a TXT in Script folder will be created for the converted contents. (See above how to print strings with Sign @)

5. Now you can print that &537AF6766567 on the screen, where naturally "Text" will be printed.

Note: I think this method is a bit buggy, i.e. the chosen string will remain empty after the procedure sometimes. However, that TXT will be saved in Script folder everyway now. So, if the string remained empty, then you can open that TXT to copy/paste the converted text there into any [ExtraNG] string - or, use that TXT, with Sign @, in any [ExtraNG] string.
Now you can print that &537AF6766567 on the screen, where naturally "Text" will be printed.

WFF_UTF8:
You also need to do this:

1. Create a TXT, with some contents like this (or overwrite the contents, if the file already exists):

<START_CONFIGURATION>
Version=LanguageName
Charset=CharSetNumber
PropFont=Arial
FixedFont=Courier
<END>

LanguageName: type your language here, eg. "Hungarian"
CharSetNumber: type the characterset code number you use, eg. 238
PropFont: this font is the name of a font of your Windows. NG Center will use it for some additional texts (eg. for button names).
FixedFont: this font is the name of a font of your Windows. NG Center will use it mostly for showing string contents.

The file name is always "my_scripter_constants.txt". Always save it in a "LANG_" subfolder of NG Center main folder, with your language name (eg. "LANG_Hungarian" folder).

2. Close NG Center then launch it again.
3. Now you can choose that language on the Settings tab of NG Center. Click OK twice, so NG Center will be re-launched automatically.
4. Type a text into a string in your language. Save and re-launch NG Center. If the text is still there properly then probably you will able to print it properly on the screen. (If I understand Paolone well, then it works only with [Strings]. I didn't really test it…)

Note: a copy of my_scripter_constants.txt will be created in NG Center main folder if you choose your language.
Never forget to remove this copy before you update the contents of the original TXT in your LANG_ subfolder.

Q: you mentioned minor customizations above. How can I adjust them?
A: type a constant in WindowsFontFlags field of the command:

WFF_FORCE_FIXED_PITCH: the same character width
WFF_FROM_RIGHT_TO_LEFT: printing from right to left (for Arabic or Hebrew characters)
WFF_LIGHT: very slim characters
WFF_ULTRA_BOLD: Ultra Bold characters

Last edited by AkyV; 30-06-17 at 17:10.
AkyV is offline