News:

Herr Otto Partz says you're all nothing but pipsqueaks!

Main Menu

Stunts font editor

Started by Cas, March 27, 2021, 10:06:13 PM

Previous topic - Next topic

Cas

So, I analysed the format of Stunts fonts, as I mentioned before, and found that it's really very flexible. I created a Wiki article describing the format, which you can read here. It was Daniel3D that prompted me to take a look at this matter and I've created a font editor and a couple of format converters that I will soon publish here.

Daniel3D and I have been testing Stunts to see how it behaves with modified fonts and we've encountered that it is feasible to add diacritical marks and new characters for better support of other languages. Daniel is now in the process of creating a font that will use a code page mostly compatible with Latin-1, but allowing some extra characters so that languages that are not fully supported in Latin-1 (such as Hungarian) can be supported as well.

With these fonts, it will become possible to create translations like what GTAMan15 has been working on with all necessary characters, so we'll start by facilitating these fonts and a code page converter I'm going to develop to him, so that he can continue with his work more comfortably. We could also develop translations to other languages. Expect the software here in the next few days :)

EDIT: Current version of the editor and coverter can be downloaded from here
Earth is my country. Science is my religion.


Daniel3D

#2
Part of the work involves adding the unmapped characters to the right position. Only the top half of Latin-1 is part of the font. (At least in the default font)
It was already known that some characters were used for editing purposes.

CAS found the following:
- Character 0 (null) - It is never printed because it marks the end of a string
- ] - It is almost never printed, because it's used to mark the end of line in multi-line text
- [ - It isn't printed in menus, as it marks the start of a menu option
- } - It isn't printed in menus, since it marks the beginning of the menu
               \ Edit: it's a half height enter. the space between the Title and the menu items.
- @ - It isn't printed when the text is to contain an input or parameter, in which case, it serves as a placeholder

these characters can be used if there is a copy on a different address.
To be included to that can't be in their original locations:
- O and o with double acute accent (Hungarian)
- U and u with double acute accent (Hungarian)
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

Daniel3D

Quote from: llm on March 28, 2021, 10:06:07 AM
did you had a look at the re-stunts assembler-code (wich produces a equal game binary) what the real code is doing?

I didn't, cause I can't.  8)
I've been mostly working on the visual part.
CAS has looked at characters that are used for different functions.
We also tested a lot. I'm fairly sure we didn't miss anything.
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

GTAManRCR

Quote from: Daniel3D on March 28, 2021, 10:10:54 AM
- ] - It is almost never printed, because it's used to mark the end of line in multi-line text

End of line in multi-line text? Then what about this?
Hejj bicska, bicska, bicska csantavéri kisbicska!

Daniel3D

#5
Quote from: GTAMan18 on March 28, 2021, 11:01:56 AM
Quote from: Daniel3D on March 28, 2021, 10:10:54 AM
- ] - It is almost never printed, because it's used to mark the end of line in multi-line text

End of line in multi-line text? Then what about this?
As far as I know,
A menu item is not and cannot be multi-line text.

Therefore, it doesn't work here.
In fact, the "enter" is translated by stressed to ] and printed by the Stunts engine, so you see the ] double.

The text above the option's menu which shows the version is also an example of plain text. That field prints all above-mentioned characters.
I used that to view them all, so I could make the true type Font.

EDIT; typo's
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

Cas

#6
Daniel has said it in detail. It seems Stressed only recognises ] as an end-of-line marker, but does not process the other Stunts control codes. Son when you enter an end-of-line, you get a ]. It looks like both [ and ] produce and end of menu option, but [ does not go to the next. So you can have two options on the same line, but you can't have an option that spans two lines.

Quote from: Ilmdid you had a look at the re-stunts assembler-code [...]?
I haven't checked that yet. The font format is pretty straightforward and I'm quite certain we got the results right. Only a few things I would like to find out and I could take a look at the original code, although something I'm very bad (slow) at is reading another person's code. The 30 years I've been programming, I've always done it on my own, so I have zero experience in reading somebody else's programming or programming in teams. However, it'd be good to find out the exact meaning of the word that changes between 1 and 2.

Here I'm posting the editor and the converters to and from PF format. PF format is limited (fixed width, always 8, and all 256 characters have to be defined), but it is partially compatible. The keys to use the editor are:

L - Load a font
S - Save a font
Arrow keys - move the glyph (or change maximum cell size)
Tab - switch between moving the glyph and changing maximum cell size
Enter - activate/deactivate character
< and > - Change individual character width
CTRL+C and CTRL+V - Copy and paste characters
Space - Look at the whole font and select a character
+/- - Go to next/previous character
Earth is my country. Science is my religion.

Daniel3D

Quote from: Cas on March 28, 2021, 10:32:29 PM
< and > - Change individual character width
+/- - Go to next/previous character
these don't require you to hold shift. so, - and _ are both accepted as -
the same goes for =/+ and ,/< and ./>   8)
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

Daniel3D

The default font is edited to include latin-1 characters,
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

Daniel3D

Attached the old and new font.
Also, the other two fonts.
These are in your stunts folder as well, but should you mess them up,
here is a backup.  8)

Fontled has no real use to expand. It is not used for text.
Fontn (n for narrow) does need expanding,

Although the size of the font can be changed,
like CAS explained the track selection menu doesn't support larger characters (yet).
That gives limited space for some special characters.
Feel free to experiment and improve my work.
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

Cas

I'll move the editor package to the first post for easy access!!
Earth is my country. Science is my religion.

GTAManRCR

FONTDEF.FNT goes well for menus
Had to replace the two accented I's to make it display correctly
? is now currently a ? (Small o with double acute accents)
Hejj bicska, bicska, bicska csantavéri kisbicska!

GTAManRCR

For some reason the small double acute accented o triggers the questionmark, so I had to replace it
Hejj bicska, bicska, bicska csantavéri kisbicska!

Daniel3D

#13
The U, u, O and o with double acute accents are in the font table, but at an alternate location.
CAS will make a tool for that.

I don't know if the ASCII code (144-147)works,
With "Alt + 147"  the character should appear in a in-game field (track name) but if it translates through stressed I don't know.
I was wrong...
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

GTAManRCR

ALT+144=É
ALT+145=?
ALT+146=?
ALT+147=ô
None of them is ? (Alt+0245)
Hejj bicska, bicska, bicska csantavéri kisbicska!