• Welcome to SC4 Devotion Forum Archives.

LTEXT - Language Text Files (How to make multilingual buildings and queries)

Started by RippleJet, February 22, 2007, 04:02:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RippleJet

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.

Definition and Links

A definition of the LText files can be found in the thread called LTEXT Files - Definition and Tutorial.

If you want help with creating queries, I recommend Daeley's How to Create/Edit Query Interfaces.

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:


  • User Visible Name Key
    The most commonly used naming property, which points to an LText file containing the name of a building or prop, or even foundations, disasters, terrain, graphs, etc.
  • Item Description Key
    Another commonly used property, which points to an LText file containing the description seen when hovering with the mouse over the item in a menu. An Item Desciption Key can be used in building exemplars for all ploppable buildings and other menu items.
  • Name Key
    A property similar to the User Visible Name Key, but used only in Ordinance Exemplars.
  • Description Key
    A property similar to the Item Description Key, but used only in Ordinance Exemplars.
  • Label (Crime)
    A property similar to the User Visible Name Key, but used only in Crime Exemplars.
  • My Sim: Name res key
    A property similar to the User Visible Name Key, but used only for personal names of sims.

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


  • captionres
    GZWinText and GZWinBtn legacies in queries may contain a resource field called captionres, which is used for displaying text (a caption) in a query or within a button.
  • tipres
    GZWinBtn legacies in queries may also contain a resource field called tipres, which is used for text (a tip) shown when hovering with the cursor above a button in a query.

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:


  • 0x00   Default Language (used if localized LText file is missing)
  • 0x01   US English
  • 0x02   UK English
  • 0x03   French
  • 0x04   German
  • 0x05   Italian
  • 0x06   Spanish
  • 0x07   Dutch
  • 0x08   Danish
  • 0x09   Swedish
  • 0x0A   Norwegian
  • 0x0B   Finnish
  • 0x0F   Japanese
  • 0x10   Polish
  • 0x11   Simplified Chinese
  • 0x12   Traditional Chinese
  • 0x13   Thai (my guess, do not take for granted)
  • 0x14   Korean (my guess, do not take for granted)
  • 0x23   Portuguese (Brazilian)

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:



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:


  • 0x2026960B, 0x0A554AE1, 0xAB4F4313   Brandenburg Gate
  • 0x2026960B, 0x0A554AE2, 0xAB4F4313   Brandenburg Gate
  • 0x2026960B, 0x0A554AE3, 0xAB4F4313   Porte de Brandebourg
  • 0x2026960B, 0x0A554AE4, 0xAB4F4313   Brandenburger Tor
  • 0x2026960B, 0x0A554AE5, 0xAB4F4313   Porta di Brandeburgo
  • 0x2026960B, 0x0A554AE6, 0xAB4F4313   Puerta de Brandenburgo
  • 0x2026960B, 0x0A554AE7, 0xAB4F4313   Brandenburger Tor
  • 0x2026960B, 0x0A554AE8, 0xAB4F4313   Brandenburg-porten
  • 0x2026960B, 0x0A554AE9, 0xAB4F4313   Brandenburger Tor
  • 0x2026960B, 0x0A554AEA, 0xAB4F4313   Brandenburger Tor
  • 0x2026960B, 0x0A554AEB, 0xAB4F4313   Brandenburgin portti
  • 0x2026960B, 0x0A554AEF, 0xAB4F4313   ÖéóÇóÖ므
  • 0x2026960B, 0x0A554AF0, 0xAB4F4313   Brama Brandenburska
  • 0x2026960B, 0x0A554AF1, 0xAB4F4313   p{!'è
  • 0x2026960B, 0x0A554AF2, 0xAB4F4313   -{!'€
  • 0x2026960B, 0x0A554AF3, 0xAB4F4313   #09@#@@4#L
  • 0x2026960B, 0x0A554AF4, 0xAB4F4313   €t€tø 8
  • 0x2026960B, 0x0A554B03, 0xAB4F4313   Portão de Brandenburgo

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:



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:


  • 0x2026960B, 0x3B6BFD02, 0x6A58F047   Local Limousine Funding
  • 0x2026960B, 0x3B6BFD05, 0x6A58F047   Financement local des berlines
  • 0x2026960B, 0x3B6BFD06, 0x6A58F047   Örtliche Limousinefinanzierung
  • 0x2026960B, 0x3B6BFD07, 0x6A58F047   Finanziamenti per limousine locali
  • 0x2026960B, 0x3B6BFD08, 0x6A58F047   Fondos para limusina local
  • 0x2026960B, 0x3B6BFD09, 0x6A58F047   Lokaal budget voor limousine
  • 0x2026960B, 0x3B6BFD0A, 0x6A58F047   Lokal limousinefinansiering
  • 0x2026960B, 0x3B6BFD0B, 0x6A58F047   Lokal limousinbudget
  • 0x2026960B, 0x3B6BFD0C, 0x6A58F047   Finansiering av skolelimousin
  • 0x2026960B, 0x3B6BFD0D, 0x6A58F047   Koululimusiinien määrärahat
  • 0x2026960B, 0x3B6BFD25, 0x6A58F047   Verba p/ Limusine Escolar

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 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.

jeronij

This tutorial is being translated. Please, be patient....  :-\
I am currently not active - Please, contact Tarkus for any site related matter. Thanks for enjoying SC4D :D


Autism Awareness;  A Father Shares
Mallorca My Mayor Diary


RippleJet

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" board. :thumbsup:

JoeST

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)
Copperminds and Cuddleswarms

Andreas

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.
Andreas

JoeST

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
Copperminds and Cuddleswarms

Andreas

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.
Andreas

RippleJet

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#

thetinker

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.

Swamper77

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
You can call me Jan, if you want to.
Pagan and Proud!

RippleJet

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. ;)

thetinker

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....

RippleJet

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.

Swamper77

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
You can call me Jan, if you want to.
Pagan and Proud!

thetinker

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/, 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...


RippleJet

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/, 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.

Andreas

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.
Andreas

thetinker

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.

Andreas

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.
Andreas

RippleJet

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... ::)