SC4 Devotion Forum Archives

SimCity 4 General Discussion and Tutorials => Tips, Tricks and Tutorials => Tutorials on Custom Content Creation => Topic started by: RippleJet on February 22, 2007, 04:02:12 PM

Title: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: RippleJet on February 22, 2007, 04:02:12 PM
LTEXT - Language Text Files
How to make multilingual buildings and queries

By RippleJet

For understanding this it is assumed that you have at least limited modding experience and that you have used iLive's Reader (http://sc4devotion.com/csxlex/lex_filedesc.php?lotGET=656).

Definition and Links

A definition of the LText files can be found in the thread called LTEXT Files - Definition and Tutorial (http://sc4devotion.com/forums/index.php?topic=548.0).

If you want help with creating queries, I recommend Daeley's How to Create/Edit Query Interfaces (http://sc4devotion.com/forums/index.php?topic=1012.0).

TGI Pointers

LText files are referred to by pointers addressing the LText file's TGI (Type, Group, Instance). The Type ID of an LText file is always 0x2026960B. The Group ID and Instance ID should be randomly selected, eg. by using the TGI Generator included in iLive's Reader (in the Tools menu).

There are two ways to point to an LText file through its TGI address:

1. From an exemplar file using a Key property. A key property contains all three elements of the address, Type ID, Group ID and Instance ID:


2. From a query using a resource field. A resource field contains only the Group ID and the Instance ID of the address:


The normal way to use an LText file is to set it up with the same TGI as pointed to by any of the ways mentioned above. This allows more editing of the text, eg. inclusion of line breaks and LUA tokens. It also allows the use of special characters, thanks to the Unicode format. Note however, that the Reader does not include support for editing full unicode text (such as certain Polish and all Far Eastern characters).

Multilingual Group ID Offsets

As can be seen in all official landmark plugins that Maxis made for SimCity 4, it is possible to include several languages in separate LText files, but still address them with only one TGI. This is done by adding offset values to the Group ID.

The LText file for a specific language is chosen based on a fixed offset from the Group ID of the pointer. The offset values are:


It should be noted that the very first file (group offset 0x00) is not required if all subsequent files are available. This is true despite the fact that there would not be a file available at the address pointed to by a TGI address elsewhere. This is the case with all Maxis official landmarks.

Examples

All about offsets mentioned above is easier to explain and understand through examples.

The picture below shows Reader with the Brandenburg Gate, one of Maxis Official Landmarks (http://simcity.ea.com/coolstuff/landmarks/index.php):

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg244.imageshack.us%2Fimg244%2F6183%2Freaderbrandenburggate80uw2.jpg&hash=5c63f57aedd901fc4221388308b9b5c0f637ea42) (http://img411.imageshack.us/img411/492/readerbrandenburggate10qg8.jpg)

The content of the building Exemplar File is shown to the right. The User Visible Name Key points to the address 0x2026960B, 0x0A554AE0, 0xAB4F4313. However, there is no LText file available with that address (TGI). Instead the LText files within the red square to the left will be used. The content of these files is:


Note that the Instance ID is the same for all files, only the Group ID changes. Comparing these contents with the offset values above, you can easily determine which language is which. Note that the content of the Far Eastern languages do not make sense as shown in Reader.

The picture below shows Reader with my mod, the Private Schools with Sliders (http://www.simtropolis.com/forum/messageview.cfm?catid=41&threadid=85226&enterthread=y):

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg164.imageshack.us%2Fimg164%2F9230%2Freaderprivateschoolui80xx2.jpg&hash=eb36ce64d5b970b53a6f8f5dd2ae3cf573aeced4) (http://img513.imageshack.us/img513/1743/readerprivateschoolui15fe2.jpg)

The content of the Query User Interface (UI) is shown to the right. The field captionres points to the address 0x2026960B, 0x3B6BFD02, 0x6A58F047. There is an Ltext file available with this address (TGI). However, the game will always check for Group ID offsets, as shown within the red square to the left. The content of these files is:


See if you can determine which languages are included. Note once more, that the Instance ID is the same for all files, only the Group ID changes. In the example above, there are no LText files for US English, UK English, Polish or any Far Eastern languages. All these languages would instead use the first (English) file, at Group ID offset 00.

It should also be noted that it would be easier to check the offsets if the Group ID of the first file would always end in 00. I do recommend this if you have even the slightest hesitation in making hex addition, or if you are providing translations into several languages. If you are making a translation into a language which is not the one your copy of SimCity runs, you should read about SC4 Registry: How to Switch Languages and Driving Sides (http://sc4devotion.com/forums/index.php?topic=3961.0) for testing purposes.

Finally, a slight word of warning. It is vital to be careful with the numbering of the Group ID offsets. Otherwise you might provide completely wrong languages for certain people.
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: jeronij on February 22, 2007, 04:23:40 PM
This tutorial is being translated. Please, be patient....  :-\
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: RippleJet on August 13, 2007, 03:48:40 AM
Quote from: jeronij on February 22, 2007, 04:23:40 PM
This tutorial is being translated. Please, be patient....  :-\

Nah, it's been ready for ages... :D

And if you want help with translating your stuff into different languages, please post a request in the "Translation Requests (http://sc4devotion.com/forums/index.php?board=184.0)" board. :thumbsup:
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: JoeST on May 26, 2008, 02:08:57 PM
Hey... I duno if this is the right place to ask... but is it possible to include an ltext file into another ltext file? if so how (whats the syntax)?

Thanks

Joe (a n00b @ modding atm)
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: Andreas on May 26, 2008, 02:29:50 PM
What do you want to achive with such a thing? An LTEXT file is basically just a sub-file that contains a text string, which could be referenced in an exemplar file, in a UI file or in a LUA script. So you cannot reference an LTEXT file in another one.
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: JoeST on May 26, 2008, 02:33:22 PM
ok, but you can dynamicaly link exemplar properties into LTEXT files (such as plop cost etc..) I was just wondering thats all... *cough*redundant data reduction*cough* heh

Thanks for you quick reply

Joe
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: Andreas on May 26, 2008, 02:37:51 PM
Ah yes, there are certain placeholders for monthly cost and the like, but I guess those are defined by default by the game. So you cannot add your own placeholders for avoiding repetitive text strings. If you have, say, a new set of lots for the park menu, you might want to create one LTEXT file for the description and add a general text, plus those placeholders for monthly cost and the like. Then you'll reference this LTEXT file in the Item Description Key property of all lots, instead of creating one LTEXT file for all lots.
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: RippleJet on May 29, 2008, 01:28:01 AM
You can reference any property value (in the building exemplar) that's got one single rep in the LTEXT file linked to by an Item Description Key.
You cannot use this format in LTEXT files used in a query window though.

There are two formats for that presentation, m(oney) and d(ecimal), syntax being:

#m:XXXXXXXX#
#d:XXXXXXXX#

where XXXXXXXX is the hexadecimal Name Value of the property.

m: adds the simolean § symbol after the property value.
d: displays the value with two decimals if the property value is Float32, otherwise as an integer.


Eg. the property with Name Value 0xEA54D286 is Budget Item: Cost
and the property with Name Value 0x4AA60EBC is Catalog Capacity

Thus, most ingame mass transit stations have this in their Item Description LTEXT files:

Quote
Monthly Cost:           #m:ea54d286#
Passenger Capacity:   #d:4aa60ebc#
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: thetinker on March 01, 2009, 02:05:34 AM
Hi RippleJet,
I'm not a poster by nature, but I've been searching for that tidbit for some time, specifically, only properties w/one rep being referenced. Is that set in stone? School monthly cost is an array of 2 numbers, bldg. & busing costs, and I have to assume the game differentiates them using some index associated with a named variable, iid, etc. (Sorry, I'm a noob to modding, don't have all the nomenclature down yet.) If using the standard placeholders from the bldg. exemplar will only reference a single rep, is it possible to use something a little deeper, like a "g_game_blah_blah" variable in the LTEXT? If so, (or even if not) has anyone compiled one or more lists of such variables? Can you point me in the right direction? BTW, as just a nobody, I really do appreciate all you somebodies who have done all this discovery. Maybe one of these days I can give back a little.
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: Swamper77 on March 01, 2009, 02:17:07 AM
Quote from: thetinker on March 01, 2009, 02:05:34 AM
If using the standard placeholders from the bldg. exemplar will only reference a single rep, is it possible to use something a little deeper, like a "g_game_blah_blah" variable in the LTEXT? If so, (or even if not) has anyone compiled one or more lists of such variables? Can you point me in the right direction?

There is a file already in the game that contains the entire list of token strings or texts that reference the game's variables. That file is a LUA file with the TGI address of 0xCA63E2A3 0x4A5E8EF6 0xFFBF9CCF. The file also contains references for use in LTEXT files that the game's news ticker message windows use. These should not be used in LTEXT files for menu items. This LUA file is one of the few that Maxis documented thoroughly with comments.

-Swamper
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: RippleJet on March 01, 2009, 02:54:24 AM
Quote from: thetinker on March 01, 2009, 02:05:34 AM
Hi RippleJet,
I'm not a poster by nature, but I've been searching for that tidbit for some time, specifically, only properties w/one rep being referenced. Is that set in stone? School monthly cost is an array of 2 numbers, bldg. & busing costs, and I have to assume the game differentiates them using some index associated with a named variable, iid, etc.

Yes, if we're talking about property values that can be referenced from the item description's LTEXT file, that seems to be set in stone.
Entering m:EA54D286 in the Item Description LTEXT file for a school would retrieve only the monthly cost for the school, but not the monthly cost for the school buses.
I haven't found any way of accessing reps 2 and higher from the item description.


Quote from: thetinker on March 01, 2009, 02:05:34 AM
is it possible to use something a little deeper, like a "g_game_blah_blah" variable in the LTEXT? If so, (or even if not) has anyone compiled one or more lists of such variables?

Those LUA tokens can unfortuantely not be used in an item description. They can be used in queries though. They do not provide information about the building exemplar that the query is called from though, they provide information from different global variables within the game.

I'm attaching that LUA file that Swamper is referring to as an txt file. I have it printed out for easier reference. ;)
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: thetinker on March 01, 2009, 11:55:51 PM
Quote from: RippleJet on March 01, 2009, 02:54:24 AM
Yes, if we're talking about property values that can be referenced from the item description's LTEXT file, that seems to be set in stone.... I haven't found any way of accessing reps 2 and higher from the item description.... Those LUA tokens can unfortuantely not be used in an item description. They can be used in queries though.... I'm attaching that LUA file that Swamper is referring to as an txt file.

Quote from: Swamper77 on March 01, 2009, 02:17:07 AM
There is a file already in the game.... That file is a LUA file with the TGI address of 0xCA63E2A3 0x4A5E8EF6 0xFFBF9CCF.
-Swamper

Thank you both. I found that file's TGI in another msg., and have already made a txt file, but thank you again. Its a shame we can't get to those additional reps, but I guess I'll muddle through.

On the query point, I was aware of this, but again, I'm just getting my feet wet. In using iLive's Reader, I had looked at UIs with the preview, and could not figure out how the LUA tokens were referenced. Only later in text view did I find the iid reference (unless I'm missing something in the preview). I have only looked at a few UIs so far, and they (so far) have only used a numerical reference, i.e "#--------". Can I use the text token, or do I have to find the actual reference id. If the latter, do I have to search UIs for what I want, or have all you modders compiled an (available/accessible) list?

I am trying to find as much of this info on my own as I can, but I also don't want to reinvent the wheel, and web site search functions are a liitle limiting if you are not quite sure what you are looking for. (BTW, for any fellow noob, the LUA token syntax in my prior post is wrong. Don't want to confuse anyone. The form is "g.game_blah_blah".)

Finally, on a personal note, I'm an old retired curmudgeon, just trying to keep my brain sharp, and I've loved this game since CGA SimcityClassic. I'm more interested in playing and experimenting than socializing on the forums, but I'd like to give back a little. I really (really!) appreciate the prompt response from 2 well-respected modders, and I'd like to give back a little if I can.

I have played a little with the fonts.ini file, and have made some very rough mods that change the size of the in-game labels (not signs) from very large to very tiny, though the changes do have some impact on the number of characters that are displayed, some more, some less than Maxis default. There is an upper limit, probably related to a hard-coded text buffer size. Also, though the label text is saved with a city, its size is NOT! Change to a different mod size, and that is reflected in a re-loaded city. There may (or may not) be a use there for a creative player.

I have also discovered that the font is a subset of the old DOS terminal font, with many of the symbol and high ASCII characters available in the label entry box using the ALT-number pad technique. I've found it useful as a !free! way to mark out future power/pipe line, civic bldg. placements, etc.

Somewhere around I have some in-game pics of a table of available characters, and if anyone is interested, I can try to find them and make the mods  and the pics available. I don't have much time to play with them anymore, but if anyone wants to use the info for a publishable mod, I'd be happy to help.

Well, I want to go play now, so....
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: RippleJet on March 02, 2009, 12:29:10 AM
Quote from: thetinker on March 01, 2009, 11:55:51 PM
On the query point, I was aware of this, but again, I'm just getting my feet wet. In using iLive's Reader, I had looked at UIs with the preview, and could not figure out how the LUA tokens were referenced. Only later in text view did I find the iid reference (unless I'm missing something in the preview). I have only looked at a few UIs so far, and they (so far) have only used a numerical reference, i.e "#--------". Can I use the text token, or do I have to find the actual reference id. If the latter, do I have to search UIs for what I want, or have all you modders compiled an (available/accessible) list?

LUA Tokens (in the form of #game.g_blah_blah#) can only be used in LTEXT files. The LTEXT file has to be linked to from the query with the captionres field (Caption Resource). This points to the Group ID and Instance ID of the LTEXT file (which always has to have a Type ID of 2026960B).

In order to display property values for the building in the query, you need to use the id field. I once compiled all id's that I was aware of in an Excel sheet, which I've attached to this post. I would however recommend that you also check how those id's are used for the ingame buildings.
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: Swamper77 on March 02, 2009, 12:40:16 AM
Quote from: thetinker on March 01, 2009, 11:55:51 PM
I really (really!) appreciate the prompt response from 2 well-respected modders, and I'd like to give back a little if I can.

Me, respected? Depends who you talk to. While you can try to shower me with compliments, I just usually brush them off. I don't take compliments very well, so I'm sorry if this statement seems a bit rude. I've always been this way about people praising me. It's just how I am. &ops

QuoteI have played a little with the fonts.ini file, and have made some very rough mods that change the size of the in-game labels (not signs) from very large to very tiny, though the changes do have some impact on the number of characters that are displayed, some more, some less than Maxis default. There is an upper limit, probably related to a hard-coded text buffer size. Also, though the label text is saved with a city, its size is NOT! Change to a different mod size, and that is reflected in a re-loaded city. There may (or may not) be a use there for a creative player.

I have also discovered that the font is a subset of the old DOS terminal font, with many of the symbol and high ASCII characters available in the label entry box using the ALT-number pad technique. I've found it useful as a !free! way to mark out future power/pipe line, civic bldg. placements, etc.

Very interesting. We used to think that the fonts were not modifiable in any way. We're still not sure of how their fonts are stored or created, though.

QuoteSomewhere around I have some in-game pics of a table of available characters, and if anyone is interested, I can try to find them and make the mods  and the pics available. I don't have much time to play with them anymore, but if anyone wants to use the info for a publishable mod, I'd be happy to help.

Somewhere in one of the game's files, there is a "hex to alphabet" key which maps the characters on the keyboard to specific hex numbers. These hex numbers are 2 digits per letter. Somewhere else, there is information on the character map for the information that is stored in the INFO files that are created when you take screenshots with the game's camera tool.

-Swamper
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: thetinker on March 03, 2009, 07:58:33 PM
Sorry, guys (or gals? persons?), a little RLS. ("MEGASTORM HITS! DOOM PREDICTED!")

Quote from: RippleJet on March 02, 2009, 12:29:10 AM
LUA Tokens (in the form of #game.g_blah_blah#) can only be used in LTEXT files....

I once compiled all id's that I was aware of in an Excel sheet, which I've attached to this post.

I think I understand, but I'm going to dig down into your Census Repository Facility, which BTW is a really neat tool, and highly recommended, at least by me, (though I did modd it a little for my personal use. Thank you for the spreadsheet, its a godsend.


Quote from: Swamper77 on March 02, 2009, 12:40:16 AM
Me, respected? Depends who you talk to. While you can try to shower me with compliments, I just usually brush them off. I don't take compliments very well, so I'm sorry if this statement seems a bit rude. I've always been this way about people praising me. It's just how I am. &ops

Swamper, if you recall my earlier post, I'm an old curmudgeon. I don't recall showering anyone. But as a newcomer, I am trying to be respectful, and I am appreciative, a quality that seems in short supply nowadays. So let me just revise "well-respected" to "well-known", and move on to...


Quote from: Swamper77 on March 02, 2009, 12:40:16 AM
Very interesting. We used to think that the fonts were not modifiable in any way. We're still not sure of how their fonts are stored or created, though.

I haven't modded the fonts, I've simply changed the default font spec for labels in the Fonts.ini file (TGI = 0x00000000, 0x4A87BFE8, 0x2A87BFFC) from Arta MT to Courier LD and changed some of the scaling and spacing characteristics. You also have to change the font in the sub-section "Fonts used for in-game development tools" of the same file from "Plain=Arial MT" to "Plain=Courier MD" if you want to see the characters in the label input field.

If you change the font you get a good selection of useful box-drawing, math, greek symbols, etc. that are not available in any of the other fonts supplied with the game. Changing the font has no down-side, it's all positive.

Changing the size, scaling, and spacing characteristics requires some cost benefit analysis. Big fonts sizes reduce the # of characters you can fit in a label but have a lot of detail. Small sizes allow longer strings, but reduce the detail in the character, which can be a problem with some characters. The gamma, sharpness, scaling, and spacing parms assist in fine tuning this. The linespacing parm can shift the label above or below the default centerline placement on transit networks, though it can be visually displaced if you rotate your view. With small font sizes, it may be difficult to pick a specific label to manipulate if labels are placed close together. At least on my (old) machine, there is perhaps a half second delay between the time my cursor hovers over a label hotspot, and the selected label "lighting up", so its easy to overshoot. A little patience helps. Finally, if you use a label with a size that allows for say a 24 character string, then switch to one that only allows say 16 characters, when you reload the city, your label will be a large yellow rectangle. You can select the label and reduce the size of the string, but it might be tough finding and selecting the labels.

As I said, the label sizes are not saved with the city, so if you have a selection of font mods, you could perhaps use a very small size for detailed notations in laying out a neighborhood, and once development is complete, switch to a larger size for other purpose.

I'm a little wary of the legality of distributing specific internal Maxis files, so I'm hesitant to make my .dat file public, but I put together a page with some sample pics, here, http://home.covad.net/~jay07zorch/sc4pics/ (http://home.covad.net/~jay07zorch/sc4pics/), if you're interested. If someone can assure me Maxis won't mind, I'd publish it, but I need time to put together some docs, as this was all done a few years back, and I didn't take notes. Still, its not very complicated if you have the time and patience to experiment.

When I was playing with this a couple of years ago, I found half a handful of posts on Simtropolis that weren't really helpful, but had some tantalizing guesses about the format being used. Between those, the comments in the Fonts.ini file, and a little digging around via Google, I have a theory without the resources to prove or disprove, so here goes... I believe some of the high-end Photoshop pkgs. have a tool or utility to create typefaces from an image. I think Maxis did this and is in some way UV mapping an image section (I think the .mxf files are sort of a big FSH file) onto a specific character, stringing them together into a label image, and presenting it visually as a layer object. There it is, you can all pick it apart, its just my guess, and I'm not going to revisit it.


Quote from: Swamper77 on March 02, 2009, 12:40:16 AM
Somewhere in one of the game's files, there is a "hex to alphabet" key which maps the characters on the keyboard to specific hex numbers. These hex numbers are 2 digits per letter. Somewhere else, there is information on the character map for the information that is stored in the INFO files that are created when you take screenshots with the game's camera tool.

-Swamper

Hmm, are you refering to one of the 4 Key.cfg files that maps the keyboard shortcuts? Or something else? I'ld love to map the "Obliterate City" shortcut to "Place a Label", but I've been unable to figure out where to find that id. Anybody?

Well, time to go, want to play...

Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: RippleJet on March 04, 2009, 03:32:33 AM
Quite impressive work you've done! :)
Very few have even thought of looking that deep into the in-game fonts.

I know the Japanese version of the game sometimes has difficulty fitting certain text strings into the same space as in our version (e.g. with the Census Repository's Query), due to the font used being wider.

I wonder if you could provide a solution to this by looking into fonts.ini from a Japanese installation. ::)


Quote from: thetinker on March 03, 2009, 07:58:33 PM
I'm a little wary of the legality of distributing specific internal Maxis files, so I'm hesitant to make my .dat file public, but I put together a page with some sample pics, here, http://home.covad.net/~jay07zorch/sc4pics/ (http://home.covad.net/~jay07zorch/sc4pics/), if you're interested. If someone can assure me Maxis won't mind, I'd publish it, but I need time to put together some docs, as this was all done a few years back, and I didn't take notes. Still, its not very complicated if you have the time and patience to experiment.

Maxis (or EA) won't mind. Ever since iLive created Reader, Maxis content has been modded and re-released. ;)

If you write a proper readme, this could probably be uploaded on the LEX as well.
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: Andreas on March 04, 2009, 05:36:32 AM
This looks quite fascinating indeed. I always wondered why EA introduced a wider font for the query UIs (for displaying the name of a building or lot) with Rush Hour, since the font they used in SC4 Vanilla was much narrower, so you could user longer names without any problems. Of course it's a tad harder to read, but with a bit of fine-tuning, I guess one could develop a nice compromise.
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: thetinker on March 04, 2009, 12:42:48 PM
Quote from: RippleJet on March 04, 2009, 03:32:33 AM
Quite impressive work you've done! :)
Very few have even thought of looking that deep into the in-game fonts.

I know the Japanese version of the game sometimes has difficulty fitting certain text strings into the same space as in our version (e.g. with the Census Repository's Query), due to the font used being wider.

I wonder if you could provide a solution to this by looking into fonts.ini from a Japanese installation. ::)

Maxis (or EA) won't mind. Ever since iLive created Reader, Maxis content has been modded and re-released. ;)

If you write a proper readme, this could probably be uploaded on the LEX as well.

"Shucks, 'twern't nothin', Ma'am." I was just unhappy with the Maxis implementation, and I read in a post there was a font file. One of my failings is getting obsessed with a problem.

Well, I don't read Japanese. If it is in English, I'd be happy to look at it, PM it to me with some specifics on the problem, but if you open the Fonts.ini file in Reader, its just a text file you can copy and paste into any text editor. It specs out which font to use for every element of the User Interface, in individual sections, such as:


; ----------------------------------------------------------------
; Region UI
; ----------------------------------------------------------------
; These are all the fonts used in the region UI.  If not specified here,
; then Generic fonts have been used.

; Region > City Info Labels
; ---------
RegionShowInfoCityName4x4   = "StocletITC TT",  "18",  "bold|aa=bg|linespacing=2|xscale=1.2|xadvancescale=0.99",    0x8a8cc980
RegionShowInfoMayorName4x4   = "StocletITC TT",  "18",  "bold|aa=bg|linespacing=2|xscale=1.2|xadvancescale=0.99",    0x8a8cc981
RegionShowInfoCityName2x2   = "StocletITC TT",  "16",  "bold|aa=bg|linespacing=2|xscale=1.2",    0x8a8cc982
RegionShowInfoMayorName2x2   = "StocletITC TT",  "16",  "bold|aa=bg|linespacing=2|xscale=1.2",    0x8a8cc983
RegionShowInfoCityName1x1   = "StocletITC TT",  "14",  "bold|aa=bg|linespacing=2|xscale=1.2|xadvancescale=0.99",    0x8a8cc984
RegionShowInfoMayorName1x1   = "StocletITC TT",  "14",  "bold|aa=bg|linespacing=2|xscale=1.2|xadvancescale=0.99",    0x8a8cc985


; Region > City Launcher
; ---------

etc.

At the beginning of the file is this helpful info:

; This file is composed of multiple lines, each of which describes font specification.
; The format of each line is this:
;    <style name> = <font face name list>, <size>, <style parameters separated by |>, <GUID>
;
; A simple example of this is:
;    NewsBody = "Arta", "14", "Italic", 0xeadd276d
;
; The above states that we have a font style called "NewsBody" which uses the face
; name Arta, is size 14, italic, and has been assigned the arbitrary GUID of 0xeadd276d.
;
; A more complicated example is this:
;    NewsBody = "Arta, Arial", "14", "Bold | Italic | LineSpacing=2 | aa=bg | underline", 0xeadd276d
;
; The above states that we have a font style called "NewsBody" which uses the face
; Arta but falls back to Arial if Arta isn't available, is size 14, and is bold, italic,
; has a line spacing of 2, is antialiased to the background and is underlined and has
; been assigned the arbitrary GUID of 0xeadd276d.
;
; Here is the full current list of supported style parameters with explanations and
; examples where useful:
;
;    Bold                    Requests a boldened version of the font.
;    Italic                  Requests an italicized version of the font.
;    Underline               Requests an underlined version of the font.
;    Strikethrough           Requests a strikethrough (line through middle) version of the font.
;    Shadow                  Requests a shadowed version of the font.
;    XScale=1.0              Requests a font with a given horizontal scaling. Values are in the floating point range of 0.1 to 10.0. 1.0 is default; 0.5 shrinks the font horizontally by half. Example: XScale=1.25
;    YScale=1.0              Requests a font with a given vertical scaling. Values are in the floating point range of 0.1 to 10.0. 1.0 is default; 0.5 squashes the font vertically by half. Example: YScale=0.85
;    AA=None | BG | Color    Request one of three anti-aliasing modes: none, antialias to the background, or anti-alias to a specific color (specified by the BGColor parameter). Example: AA=BG
;    Color=r,g,b             Requests a font with the given foreground RGB color. Values are in the range of integers of 0-255, inclusive. Example: Color=234,12,0
;    BGColor=r,g,b           Requests a font with the given background RGB color. Values are in the range of integers of 0-255, inclusive. Example: BGColor=234,12,0
;    Gamma=1.0               Requests a font with the given 'gamma' value. Values are in the range of floating point 0.0-10.0. A gamma of 1.0 is default, with higher values resulting in lighter font edges and lower values resulting in darker font edges. Example: Gamma=1.25
;    Sharpness=0.0           Requests a font with a given antialiasing sharpness. A sharpness of 0 is default, with negative values being somewhat blurry and positive values being somewhat sharp. Example: Sharpness=0.1
;    CharSpacing=0           Requests a font with a given horizontal character pixel spacing adjustment. Adds or subtracts pixels between characters. Values are in the range of integers between -10 and +10. Example: CharSpacing=-1
;    LineSpacing=0           Requests a font with a given vertical line spacing pixel adjustment. Adds or subtracts pixels between lines by adding pixels to the top of each line. Values are in the range of integers between -10 and +10. Example: LineSpacing=3
;    XAdvanceScale=1.0       Requests a font with a given horizontal 'advance' scaling. Advance refers to the distance from the start of one character to the start of the next. Note that XAdvanceScale is different from XScale because XAdvanceScale doesn't scale the character but only the distance between characters. Values are in the range of 0.1 - 10.0. Example: XAdvanceScale=0.95
;


Just a note, be careful not to word wrap lines in the file. Some lines are very long and will wrap in viewers and editors, which can be confusing.

Within the SC4 installation directory is a folder called "Fonts" which contains the fonts:


    Arial Mt
    Arta
    CordialUPC
    Courier LD
    HG-Gothic
    Hy Round Gothic
    Mhei B5
    Mhei GB
    Stoclet ITC TT

I realy don't recall, but I think one of these fonts is like Windows "Martlett" which only has a few characters used in windows elements, like the minimize/maximize/close buttons. It could be the Mhei fonts. All the rest are complete alphanumeric sets, but only the Courier font has the additional symbols.

If you can figure out the "Style Name" for the UI element you want to modify, its just a matter of trying values to see what looks good. With a little experimenting, you can begin to anticipate what different values will actually do. You could, theoretically create a whole new "skin" for the game.  I have to say, there is nothing that specifically delineates a "QueryDialogHeader", so you may have to modify something more generic. Also, you may have to tune the specific UI file for box area, etc.

On the Maxis point, I'm sure you're right, But I can see a lawyer making a distinction between a BAT'd or LE'd version of content, and even Reader modified exemplars, as opposed to say extracting a copyrighted S3D model, tweaking it and publishing it on the net. I know the Fonts.ini file is probably safe, but I'm a cautious old curmudgeon. The font mod is the complete fonts.ini file with just a few changes. (I don't think you can only use a few lines in a mod without screwing the game, though I haven't tried; crashing the game usually leads me to a reboot, and a lengthy Scandisk). Personal use probably falls under Fair Use. Publishing it...?

The other problem is personal taste. If you want the symbols (which could be useful in Queries), you need the Courier font. You may not need the symbols, but prefer a different font, or italics. What size do you want? I like to cram information in densely, so I use tiny fonts. which can be tricky to work with in the case of labels. Someone else might want default labels, but want to change the DataView, or Signs, or Mayor Advice. I'd be willing to provide a sample label mod, but the real gift is probably a thorough explanation of how the style parameters interact. That might take a little time, cause, honestly, its not high on my priority list. It was an old project, and you guys are getting into lots more exciting things I want to explore. Anyone with Reader (or DatGen) can do this with a little patience. So, persuade me to take the time. Where can I find the appropriate code to plug into Key.cfg to map "Place Labels" to a keyboard shortcut? Anybody?


Quote from: Andreas on March 04, 2009, 05:36:32 AM
I always wondered why EA ....

Andreas, who knows why EA/Maxis does/did anything? I miss Hydroelectric Dams! Thank you, Mythical Winged Horse, and all you other water explorers out there.

EDIT: Wow! I typed "P......", and you guys replaced it with a URL. THAT'S celebrity! I guess I'm going to have to follow that link and see where it goes.
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: Andreas on March 04, 2009, 03:46:14 PM
Quote from: thetinker on March 04, 2009, 12:42:48 PM
Andreas, who knows why EA/Maxis does/did anything? I miss Hydroelectric Dams! Thank you, Mythical Winged Horse, and all you other water explorers out there.

EDIT: Wow! I typed "P......", and you guys replaced it with a URL. THAT'S celebrity! I guess I'm going to have to follow that link and see where it goes.


Well, don't get your hopes up - that winged horse has locked himself in his little forum, building huge walls around him. Just three days ago, I was banned from there (for telling the truth, I assume), like many other respected members of this community.
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: RippleJet on March 04, 2009, 03:57:57 PM
Quote from: thetinker on March 04, 2009, 12:42:48 PM
Well, I don't read Japanese. If it is in English, I'd be happy to look at it, PM it to me with some specifics on the problem, but if you open the Fonts.ini file in Reader, its just a text file you can copy and paste into any text editor. It specs out which font to use for every element of the User Interface, in individual sections, such as:

We need Masuda san in here, with a copy of fonts.ini from his installation... ::)
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: sithlrd98 on March 04, 2009, 07:24:13 PM
Now this is something different! I like where this is going &apls

Jayson
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: MAS71 on March 05, 2009, 02:11:00 AM
Hi there ! :) I'm here!!  ;D
I'm sorry always to Ripplejet san for my not enough undestanding of English. :-[
I'd already send japanese Font.ini on PM. I'm hope to that will be your any helps.  ;)

Thank you.
-Mas'71
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: RippleJet on March 05, 2009, 03:17:34 AM
The fonts INI file (TGI 0x00000000, 0x4A87BFE8, 0x2A87BFFC), that I got from Masuda san,
is actually identical with the one that is included in my version of SC4.

All styles have the same fonts, same sizes, same xscales, ...
Thus, that can not be the reason for the differences seen in the images below.

The images show the query of the Census Repository Facility, Version 2,
and were posted the same day in the CAM thread (http://sc4devotion.com/forums/index.php?topic=1177.80) during beta testing:

1. This one was posted by Barby:
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fi5.photobucket.com%2Falbums%2Fy171%2Fbarbyw%2Flansmarkcensus.jpg&hash=4b1a818aba9f0ed2fd9d088e28575e2db8868119)

2. This one was posted by Masuda san:
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg522.imageshack.us%2Fimg522%2F6417%2Fcam07cap30cx5.gif&hash=8b51bc990dfa4bd3bfe685fa60c05d5205507c58)


The font styles used in the query are:

GenHeader for the titles (e.g. "Census Repository Facility")
GenHeader     = "StocletITC TT",    "18",  "bold|aa=bg|linespacing=2|xscale=1.2|xadvancescale=0.99",      0x4a809916

GenBodyLight for the three lines between RalphaelNinja and the Close button
GenBodyLight  = "Arta",             "13",  "italic|aa=bg|linespacing=2|xscale=0.95|xadvancescale=0.99",   0x4a809918

GenButton within the Close button
GenButton     = "Arta",             "16",  "aa=bg|linespacing=2|xscale=0.95|xadvancescale=0.99",          0x4a809919

PUckDate for the ordinary text
PUckDate         = "Arta",             "11",  "aa=bg|linespacing=1|xscale=0.95|xadvancescale=1",       0x4a809912


I guess this indicates that the font (mxf) files, even if having the same filenames,
are not the same in the Japanese version of the game, as in ours...

Could Masuda san show us the directory listing of his fonts folder?
This is the content of mine:


25.08.2003  06:03            50,000 Arial MT (Bold Italic).mxf
25.08.2003  06:03            50,000 Arial MT (Bold).mxf
25.08.2003  06:03            50,000 Arial MT (Italic).mxf
25.08.2003  06:03            60,000 Arial MT.mxf
25.08.2003  06:03            40,000 Arta (Italic).mxf
25.08.2003  06:03            40,000 Arta.mxf
25.08.2003  06:03            90,000 CordiaUPC (Bold).mxf
25.08.2003  06:03           100,000 CordiaUPC.mxf
25.08.2003  06:03            90,000 Courier LD (Bold Italic).mxf
25.08.2003  06:03            80,000 Courier LD (Bold).mxf
25.08.2003  06:03            80,000 Courier LD (Italic).mxf
25.08.2003  06:03            70,000 Courier LD.mxf
25.08.2003  06:03         2,600,000 HG-Gothic (Bold).mxf
25.08.2003  06:03         2,700,000 HG-Gothic.mxf
25.08.2003  06:03         2,320,000 Hy Round Gothic (bold).mxf
25.08.2003  06:03         7,910,000 Hy Round Gothic.mxf
25.08.2003  06:03         6,160,000 MHei B5 (Bold).mxf
25.08.2003  06:03         2,590,000 MHei GB (Bold).mxf
25.08.2003  06:03            50,000 Stoclet ITC TT (Bold).mxf
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: ebina on March 05, 2009, 04:05:41 AM
Japanese version contains the same font files. Difference is that Japanese version of SimCityLocale.dat includes modified fonts INI, all letters are displayed in HG-Gothic with different font size in our language version. I think some language versions of SimCityLocale.dat also include special fonts INI.
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: RippleJet on March 05, 2009, 05:06:29 AM
Thanks, Ebina san! That's good to know! :)
Could you post a copy of the fonts INI file included in the Japanese SimCityLocale.dat?
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: ebina on March 05, 2009, 05:18:18 AM
Sure. Attached a dat file.
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: RippleJet on March 05, 2009, 06:53:36 AM
Thanks, Ebina!
That explains a lot. :)

Looking at the file sizes, it's also obvious that only three fonts contain a full character set (including Japanese, Chinese, Korean and Thai): ::)

Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: thetinker on March 05, 2009, 08:44:46 AM
 RippleJet, I sent you a PM, then saw the latest posts. It appears that the only thing affected is the "Census/Repository/Blame" text, with the GenBodyLight font center aligned. It may be getting proportionalized, that is a word processing function where a line of text is stretched to run from margin to margin. Since the anchor point is in the center, the left and right text runs outside the box area. Try left aligning the text, then modify the style and box area to fit.

BTW, for anyone interested, I found the "Place Label" function entry code in the SC4.exe file, so now I have a keyboard shortcut, and you guys can't bribe me with it. Its MsgID is 0x0B980587. Extract the main Key.cfg file from sc_1.dat, find a shortcut you can do without, or an unconfigurd key, and use the MsgID above. Stick the .dat file in your plugins, and you're set to go.
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: RippleJet on March 05, 2009, 09:04:05 AM
Quote from: thetinker on March 05, 2009, 08:44:46 AM
RippleJet, I sent you a PM, then saw the latest posts. It appears that the only thing affected is the "Census/Repository/Blame" text, with the GenBodyLight font center aligned. It may be getting proportionalized, that is a word processing function where a line of text is stretched to run from margin to margin. Since the anchor point is in the center, the left and right text runs outside the box area. Try left aligning the text, then modify the style and box area to fit.

As I replied in the PM back to you:

The GenBodyLight, which I've used for the text to the left of the Close button is a 13pt Arta in our INI file.
In the Japanese INI file it's replaced by an 11pt HS-Gothic, which, despite being smaller, is a lot wider.

It's quite obvious that HS-Gothic's width is increased due to the complexity of the Japanese/Chinese characters.
I don't think there's any proportionality in that font, as there's a lot of empty space to the left and right of it when using 11pt Arta.

Besides, the width of the field reserved for those texts has been made wider in Version 3 of the Census Repository. ;)
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: thetinker on March 05, 2009, 09:26:00 AM
 Ripplejet, I put ebina's file in my plugins, plopped the repository, see. the problem. Quit the game, repaced your UI with mine, works perfect. Try it.
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: thetinker on March 05, 2009, 09:59:42 AM
 Ok, now that I've seen the problem, I went back and restored your original UI. Then I made 3 changes from the font styles GenBody Light to PUckDate in "Census/Repository/Blame". That's all it took. It looks fine on my USA/English installation with Ebina's Japanese fonts.ini file in place. I know her file has changed al the fonts in the rest of my game, so the UI is using the HG-Gothic set. Since all the Ltext you use is included in the .SC4Lot file, I can't see how the Japanese Locale.dat would interact. Of course, I have no idea how the Kana characters will look.

I know I'm getting tired, suddenly I can't spell worth a damn. I'll check back when you've had a chance to try what I did.

And, I re-reread your PM, and took one more look. With the changes I made listed above still, in place, I pulled ebina's file. Yes, that text is a little small, but still quite legible, even for old eyes like mine. So, I see you have three option:
1) The minor change above.
2) Two versions, one Western, one Japanese.
3) Include a custom fonts.ini file with the Japanese version. I haven't tried it, (and I'm not going to right now, I need sleep), but it might be possible to define a new style in the fonts.ini file. That's something that might be worth exploring, because it would offer a lot of flexibility.

I really have to go now. Have fun.
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: thetinker on March 05, 2009, 11:30:01 AM
 Before I walk away from this for a day or so, let me share one golden insight into HOW the font specs interact.

1) The font size can be anything from 0 to 256.  Bigger size, bigger character, right? Maybe. The smaller the size, the less detail and crispness in the character, but the more characters you can fit on a line. Big font sizes give very crisp, detailed characters, but fewer on a line, and of course, very large. Using smaller sizes, you can tune them somewhat with the gamma, sharpness, and anti-aliasing parameters, but there are limits to how much you can effect a smaller size to enhance it's appearance. Despite the tendency of Maxis/EA to spec odd point sizes, like 13, the best results come from using sizes that are multiples of 16. Also the typeface matters. Two fonts can be spec'd at the same size, but differ in actual size. (BTW, the color parameter has no effect on labels, that seems to be hardcoded.)

2) I use very tiny labels, on the order of 6-8 characters per simcity grid cell. Trying to use a 4 or 6 point font will degrade the characters significantly, with some characters, into ilegibility.  The SECRET (shhh...) is to pick a large font size and use the x-scale and y-scale parameters to scale it down. To get about 4 characters per grid cell, I use a size 80 font, x and y scaled to about 0.25. I get the best of both worlds, small, clearly legible characters.  CharSpacing and XAdvanceScale are used to adjust the spacing between character. They do affect one another in a subtle way I'm too fried to try to explain, so experiment with incremental changes first on one, then the other. Linespacing simply lifts the character above or below the horizontal centerline.

3) None of this matters if you don't want to mess with an enduser's pre-defined Maxis/EA named styles, so you are left with fighting with the problem RippleJet is having in trying to compromise between what Maxis supplied, and what he wants to do.

4) IF someone wants to try an experiment, find the style [Symbols = "SimDingbat"] in the fonts.ini file. There is no SimDingbat font supplied with the game, unless its hidden in the .exe, but even if it is, it isn't used in the game. Replace SimDingbat with one of the supplied font names, spec its parms to something distinctive you can spot in the game, then reference it in a Query. If that works, try redefining the style name "Symbol" to, say, RibbleJetQueryStyle, and reference it  in the Query. If that works, try adding a new style name, and define it, reference it, and check it.  If that works, then we can worry about setting up a registry database for people to reserve style names for the billion or so font.ini mods that will suddenly appear.

Bye, now. ZZzz..
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: RippleJet on March 05, 2009, 01:59:44 PM
Quote from: thetinker on March 05, 2009, 09:59:42 AM
Ok, now that I've seen the problem, I went back and restored your original UI. Then I made 3 changes from the font styles GenBody Light to PUckDate in "Census/Repository/Blame". That's all it took.

Yes, and as I told in the PM to you, that is the option I was considering.
On the other hand, I would first want to see how the current Version 3 of the Census Repository Facility looks to a Japanese player.

So far we've only seen queries belonging to Version 2. Version 3 is available on the LEX. ;)
Even the UI file you sent me, is from the old version 2. :P

Masuda san or Ebina san? ::)


Quote from: thetinker on March 05, 2009, 09:59:42 AM
It looks fine on my USA/English installation with Ebina's Japanese fonts.ini file in place. I know her file has changed al the fonts in the rest of my game, so the UI is using the HG-Gothic set. Since all the Ltext you use is included in the .SC4Lot file, I can't see how the Japanese Locale.dat would interact. Of course, I have no idea how the Kana characters will look.

The file Ebina san (he is a he) posted was extracted from the Japanese SimCityLocale.dat.
Actually, if entered as UNICODE in an LTEXT file, Japanese characters (katakana, hiragana and kanji) all appear correctly in our games as well.

I doubt those would be included in the small Arta or StocletITC TT font files though...
Thus, I don't know how those are handled within the game.


Quote from: thetinker on March 05, 2009, 09:59:42 AM
3) Include a custom fonts.ini file with the Japanese version. I haven't tried it, (and I'm not going to right now, I need sleep), but it might be possible to define a new style in the fonts.ini file. That's something that might be worth exploring, because it would offer a lot of flexibility.

Providing a custom fonts INI file might be tricky though.
First of all I have no idea if the Chinese, Korean and Thai versions of the game use the same fonts INI file in their SimCityLocale.dat files.

If we created a custom INI file, optimized for a certain market, that might screw up quite a lot other fonts in the game if people elsewhere installed it.
People would be asking why all their fonts suddenly changed into HS-Gothic (without knowing the name of the font of course)...
And that we could never avoid, regardless how well we wrote that in the readme... ::)
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: MAS71 on March 05, 2009, 07:57:53 PM
Upload pics of both here.(Japanese version) "$Deal"$

- Census Repository Facility Version 2 -
Quote2. This one was posted by Masuda san:
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg522.imageshack.us%2Fimg522%2F6417%2Fcam07cap30cx5.gif&hash=8b51bc990dfa4bd3bfe685fa60c05d5205507c58)

- Census Repository Facility Version 3 -
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg12.imageshack.us%2Fimg12%2F3900%2Fcamcensus01640.gif&hash=7a5d174f69a379738a1879ac52d3a31d2ec80e78)
- Original Size -
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg12.imageshack.us%2Fimg12%2F4628%2Fcamcensus01w.th.gif&hash=7ae8cbdd3f23ab5af1dead2f898c0646344f6dca) (http://img12.imageshack.us/img12/4628/camcensus01w.gif)


#### Edited ####
by the way,
A screen size of PC is 1024 x 768 I using.
Is this UI-window's size would change(fit) by(with) screen size of PC??
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: thetinker on March 05, 2009, 08:51:40 PM
Quote from: RippleJet on March 05, 2009, 01:59:44 PM
Yes, and as I told in the PM to you, that is the option I was considering.
On the other hand, I would first want to see how the current Version 3 of the Census Repository Facility looks to a Japanese player.

So far we've only seen queries belonging to Version 2. Version 3 is available on the LEX. ;)
Even the UI file you sent me, is from the old version 2. :P

Sorry about any miscommunication. I don't currently have my workspace set up for this kind of network collaboration, and I was bouncing back and forth between applications and networking, so I was modifying and posting before I got your PM. ( I was also quite bleary.) I will grab  a copy of version 3, and take a look.

Quote from: RippleJet on March 05, 2009, 01:59:44 PM
Masuda san or Ebina san? ::)

The file Ebina san (he is a he) posted was extracted from the Japanese SimCityLocale.dat.
Actually, if entered as UNICODE in an LTEXT file, Japanese characters (katakana, hiragana and kanji) all appear correctly in our games as well.

I doubt those would be included in the small Arta or StocletITC TT font files though...
Thus, I don't know how those are handled within the game.

I didn't notice an attachment with Masuda san's post. I used the one from Ebina, and Ebina, no offense was intended. I am a typically provincial American, and interpreted the "..ina" as the female diminuative. My apologies.

I know nothing about international typography, so I have to bow to your expertise. I would suspect that non-Western installations have the English fonts.ini embedded in the sc_1.dat file, and for foreign markets, EA included that market's font.ini  in the SimCityLocale.dat, as it is logically loaded later and would overwrite the original. If it were my call as a company exec, that's the way I would have gone. The font package was probably intended to include enough variety for a world market. (Note the HG-Gothic is never mentioned in the Western fonts.ini) Since most commercial typefaces are proprietary and would require licensing, EA either licensed a moderately compatible group, or created their own (my previous Photoshop speculation). Either way, they propably did not anticipate the huge trans-national modding efforts, so they chose cost-effective compromises. I guess we just have to be creative enough to overcome those limitations. Your work is amazing, and you shouldn't take it as a personal defeat if you get 'gotcha'd" by those limited choices.

Quote from: RippleJet on March 05, 2009, 01:59:44 PM
Providing a custom fonts INI file might be tricky though.
First of all I have no idea if the Chinese, Korean and Thai versions of the game use the same fonts INI file in their SimCityLocale.dat files.

If we created a custom INI file, optimized for a certain market, that might screw up quite a lot other fonts in the game if people elsewhere installed it.
People would be asking why all their fonts suddenly changed into HS-Gothic (without knowing the name of the font of course)...
And that we could never avoid, regardless how well we wrote that in the readme... ::)

I think the question is, are all markets getting the same font package. If my Western version doesn't use HG-Gothic, why is it in my fonts folder. They probably all get the same fonts. And no, custom font.ini files as they are currently used supplied by diferent modders would create a nightmare for the end user. Exactly why I didn't want to publish my label font mod, because other than a minor change to the label UI, the mod is only a custom font.ini file.

But... If the experiment I suggested in my prior post can work (and, I'm going to try that experiment tonight), then you avoid the nightmare. A new and unique style name, referencing a standard font, but specing a different set of parameters, and referenced only from a specific plugin mod would not interact with any other GUI element in the game, including other Queries, as long as they did not use that specific name. The only consideration would be which font a local market would use. It would never have occured to me, as a modder, that the Japanese are only using the HG-Gothic font.

As the mod's developer, you might be forced to supply a different .ini file for each market, where the style name uses that market's font. I say that because Ebina's file automatically converted your standard style name references. It wouldn't know what to do with a new style name. Best case, it would use a default font in the Query. Worst case, the game would choke on a null pointer. CTD.

And yes, in good conscience, you would have to check that your mod works with that font. I can see the difficulties in your case, because you are trying to pack a very large amount of data into a very small footprint. My turn to say "impressive work". You could always take the easy way out, and go for a bigger footprint in a version 3.1, but I think you, like me, prefer an elegant solution. I really like the way your layout looks. Very professional.

If you decide to stick with the unmodifed fonts.ini approach, I'm not sure I can offer any concrete help. You only have the style specs available, and have to work your layout around that roadblock. Not a problem with one language. But the title of the topic is "...multilingual..." I only wound up in here by accident, looking for that bldg. property rep tidbit.

I think, for the moment, I don't have anything else to offer. I'll check back in, in a day or too, to see if anything develops, or I have an insight. BTW, RippleJet, nice to meet you, and you, Swamper.
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: thetinker on March 06, 2009, 01:24:28 AM
IT WORKS!

I cleared all font modifications out of my plugins. I extracted an original clean fonts.ini to Test_fonts.dat.

I opened the Repository in Reader, a handy plugin whose UI I'm becoming familiar with, found a field using GenHeader, and replaced it with Symbols, and saved the file. Apparently, Symbols=SimDingbats exists somewhere in the SC4 installation. I found various symbols, trademark, copyright, etc., so it may actually be used in logos and credits, possibly some other miscellaneous out of the way places.

Exiting SC4, I added a new style name to Fonts.ini, TestMyTheory = "Hy Round Gothic ", "24", "bold", and an arbitrary GUID. (More on the GUID later.) Saved the file, opened the Repository in Reader, went to the field I had previously replaced with Symbols, and typed in TestMyTheory. I did the in-file save in Reader, and re-Previewed it. The UI only showed a tiny illegible font,  but I saved the file anyway. I ran SC4, plopped the Repository, queried it and up popped the Query with the 24 point Hy Round Gothic font in place in all its glory.

IT WORKS!

The problem in Reader occurs because iLive hard coded the standard fonts.ini style names into the .exe, (I checked), and did not expect anyone would customize it. He did make provision to display a default font, but at least on my machine it is too small to be readable. Perhaps if everyone is especially kind to iLive, we could prevail upon him to do an update. Or, one of you up-and-coming programmers could write a new UI Editor with some new capabilities.

BUT IT WORKS!

I have to do some more testing to see if there are conflicts with other GUI elements, but I don't expect any, except in one area, and that is the "arbitrary GUID" that is necessary, and which could lead to conflicts. I scanned through the fonts.ini and choose something in the middle range, about 0xA0 higher than GenHeader. I thought that was reasonably safe for the purpose of this experiment. And so...

* !A HUGE WARNING! *

To all modders looking at this technique. I am NOT a programmer, just a reasonably competent tinkerer. I seriously doubt that Maxis foresaw this kind of add-in customisation. There may be limits to memory buffers allocated for style definitions. I for one know nothing about the GUID implementation. There may be ranges that are totaly safe, and others that may cause your hard drive to run off with your cash (and your wife). We need to find someone in the community, with some real expertise to look at this.

* !DO NOT PUBLISH MODS USING THIS TECHNIQUE! *
* !THIS IS PROOF OF CONCEPT ONLY! *

I need to take some time to pull all my notes together into some kind of documentation, but for you adventurers who want to explore this for your personal use, have fun. Just be careful.

N.B. A footnote: I saved the city, exited SC4, removed the font mod from my plugins, and went back in. The game engine was intelligent enough to default to what I think is the hover query body text font, so it may be safe from that stand-point.
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: vil on March 06, 2009, 02:07:54 AM
Magic that...

Never mind japanese, at the very least StocletITC has most czech characters available, whereas Arta does not.

However Reader doesnt like UNICODE characters above 00FF (neither editing nor importing), hex editing works but on LTEXT import the 01´s get replaced by 00´s.

Any tips on editing LTEXT files anyone? Any hope for fixing the LTEXT import on reader?

example:

required             works in             UNICODE               after reader
character           reader                                          LTEXT import

á                      á                      E1 00                    E1 00
č                                              0D 01                   0D 00
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: RippleJet on March 06, 2009, 05:40:38 AM
Thank you, Masuda san for that query image! :)

Quote from: MAS71 on March 05, 2009, 07:57:53 PM
A screen size of PC is 1024 x 768 I using.
Is this UI-window's size would change(fit) by(with) screen size of PC??

No, the query has a fixed size of 760 × 596 pixels.


Quote from: thetinker on March 05, 2009, 08:51:40 PM
You could always take the easy way out, and go for a bigger footprint in a version 3.1, but I think you, like me, prefer an elegant solution.

Since the "footprint" already is close to 800 × 600 pixels, I don't want to increase it.
There probably are quite a number of players out there still having that resolution in SC4.

And since Masuda san kindly showed that the text which is GenBodyLight (11 pt HS-Gothic),
now (in Version 3) fits between the BSC logo and the Close button, I'm pretty satisfied with it. ;)


Quote from: thetinker on March 06, 2009, 01:24:28 AM
The problem in Reader occurs because iLive hard coded the standard fonts.ini style names into the .exe, (I checked), and did not expect anyone would customize it. He did make provision to display a default font, but at least on my machine it is too small to be readable. Perhaps if everyone is especially kind to iLive, we could prevail upon him to do an update. Or, one of you up-and-coming programmers could write a new UI Editor with some new capabilities.

iLive has been MIA since some four years back, and is certainly not coming back to do any modifications.
On the other hand, I never use the UI Editor, I make all queries in Reader's text view, which provides a lot preciser control over the layout.


Quote from: vil on March 06, 2009, 02:07:54 AM
However Reader doesnt like UNICODE characters above 00FF (neither editing nor importing), hex editing works but on LTEXT import the 01´s get replaced by 00´s.

Any tips on editing LTEXT files anyone? Any hope for fixing the LTEXT import on reader?

Vil, can you use the letter č while editing LTEXT files in PIM-X?
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: vil on March 06, 2009, 01:30:26 PM
Oh yes it works fine!

Cant open arbitrary LTEXTS in PIM-X though can I? Like from SimcityLocale.dat?

Can create new, paste text, save and  :-\  TGIs with reader.
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: RippleJet on March 06, 2009, 01:43:02 PM
Ahh, now I understand...
And no, you cannot add č in Reader in an LTEXT file...

Instead I would create a phony ploppable lot in PIM-X, convert the Item Description into a "multilingual" LTEXT file,
and finish that LTEXT file in PIM-X for whatever purpose you need it, including whatever Czech characters you desire...

Then copy that LTEXT file in Reader to where ever you need it, change it's TGI, but do not change its content.

Maybe we should ask Stéph for a tool, only to edit LTEXT files with... ::)
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: vil on March 06, 2009, 02:09:15 PM
Exactly :thumbsup:

Youre going to like this:

delete all the arial****.mxf files from Program Files\Maxis\SimCity 4 Deluxe\Fonts

copy in your favorite arial.ttf true type font that has all the unicode characters in the world and set everything in [Font Styles] .ini to "Arial"

:satisfied:
Title: Re: LTEXT - Language Text Files (How to make multilingual buildings and queries)
Post by: RippleJet on March 06, 2009, 02:27:29 PM
Neat, vil! :thumbsup:
In other words, TTF's can be used, just as well as MXF's :)