Specifying font in config.txt for nameable assets doesn't work.

JCitron

Trainzing since 12-2003
I have modified one of the built-in station platform signs for my own purpose and want to change the font to something else besides the common Sans Serif or Arial font that's used on all signs. I checked the Wiki for information on this and found this mesh-table.

Code:
mesh-table
{
  default
  {
    mesh industry.lm
    auto-create 1
    effects
    {
      0
      {
        kind name
        [B]font garamond[/B]
        fontsize 0.15
        fontcolor 30,30,30
        att a.name0
        name name
      }
      1
      {
        kind name
     [B]   font swiss[/B]
        fontsize 0.3
        fontcolor 30,30,30
        att a.name1
        name name
      }
    }
  }
}

Following the lead here, even in placement for the font-line and ensuring the font-name is spelled correct, I am unable to get this to work.

Has this ever worked? Or is this now a bug in T:ANE.

John
 
I don't think it has ever worked - that is the first I have ever heard of font selection in the config.txt file. I was (and still am) under the impression that text characteristics for nameable assets were built into the mesh (or something similar such as attachment points) that only the original asset creator could change. But I stand ready to be corrected.
 
Following the lead here, even in placement for the font-line and ensuring the font-name is spelled correct, I am unable to get this to work.

Windows font names have changed significantly over the years, and those particular names are subject to a setting for font substitutions, which might not be consulted for this purpose (or might not even be set up on a particular PC). See:
https://technet.microsoft.com/en-us/library/cc939628.aspx

You should try using font names supported by current versions of Windows. See:
http://www.ampsoft.net/webdesign-l/WindowsMacFonts.html
 
John,

kind name
font garamond
doesn't seem right to me. It appears to have two (operations) (variables) on the same line without a break

I suspect something like this might work

kind: font
name: garamond

there is also a fonts-path tag which may be relevant.
 
Last edited:
There are no operations and variables in the config.txt. It's always a tag (= name of config entry) and its value, which are separated by whitespace (space, tab, ...). For some tags the value is a container ({ ... }) containing paired tags ans values.
The listing in the first post is formally correct.

Peter
 
Your container looks right. I guess it's a bug. I just tested this in TS2010 and you can change fonts just fine.

Recall, however, that fonts have always been wrong in T:ANE and this is a known issue. They still render much smaller and lighter than they do in previous versions, which suggests that font rendering is not a priority. Maybe a bug report on this will let N3V know that the font system as a whole needs to be looked at.
 
Thanks guys,

I will bug report this.

I did change the font size and that worked, however, their percentage values are wrong in the code.

John
 
As I remember for a number of years ago, only three fonts were allowed when making changes. Ariel, Times Roman, and, of course, I can't remember the other one.
 
In the TANE installation resources folder there is a file called fonts.txt. Within that file appears to be font description containers. I tried some of the names given to the fonts such as "swiss12_italic" in a name effect and an italicised font did show.

I'm not entirely convinced the fonts described in that file are intended for name effects so I would caution their use. If they are, then it would useful if N3V published those names in the name effects container WiKI page.
 
A quote from the 2006 API Guide:

"Trainz supports any installed True Type font, however installed fonts available vary across different versions of Windows, so either stick to something safe like arial or do your homework and make sure the font you use is installed across Windows 98, Windows 2000 and Windows XP. "
 
A quote from the 2006 API Guide:

"Trainz supports any installed True Type font, however installed fonts available vary across different versions of Windows, so either stick to something safe like arial or do your homework and make sure the font you use is installed across Windows 98, Windows 2000 and Windows XP. "

Thanks Trev!

These base fonts have been pretty much standardized since that time. Using the built-in Times New Roman, however, doesn't work. From the looks of it you can have any font you want as long as it's Arial. :)

The file that Paul (pcas1996) mentions is in the ../resources folder.

Fonts.txt contains the following:

Code:
html_default
{
  name      "Arial"
  size      16
  smooth    1
}
font8
{
  name      "Arial"
  size      14
  bold      0
  italic    0
  underline 0
  strike    0
  shadow    1
  smooth    0
}
font12
{
  name      "Arial"
  size      18
  bold      0
  italic    0
  underline 0
  strike    0
  shadow    1
  smooth    0
}
font21
{
  name      "Arial"
  size      32
  bold      1
  italic    1
  underline 0
  strike    0
  shadow    0
  smooth    1
}
swiss
{
  name      "Arial"
  size      24
  bold      0
  italic    0
  underline 0
  strike    0
  shadow    0
  smooth    1
}
swiss10
{
  name      "Arial"
  size      13
  bold      0
  italic    0
  underline 0
  strike    0
  shadow    0
  smooth    0
  spacing   0
}
swiss12
{
  name      "Arial"
  size      14
  bold      0
  italic    0
  underline 0
  strike    0
  shadow    0
  smooth    0
  spacing   0
}
swiss12_italic
{
  name      "Arial"
  size      14
  bold      0
  italic    1
  underline 0
  strike    0
  shadow    0
  smooth    0
  spacing   0
}
swiss_shadow
{
  name      "Arial"
  size      24
  bold      1
  italic    0
  underline 0
  strike    0
  shadow    1
  smooth    1
}
swiss_bold
{
  name      "Arial"
  size      24
  bold      1
  italic    0
  underline 0
  strike    0
  shadow    0
  smooth    1
}
courier12
{
  name      "Courier New"
  size      14
  bold      0
  italic    0
  underline 0
  strike    0
  shadow    0
  smooth    1
  spacing   0
  numchars  256
}
arial
{
  name      "Arial"
  size      24
  smooth    1
  numchars  256
}


I wonder if adding the another installed font to the file will fix this. If it does fix the problem, I will report it as a bug. This may have existed for sometime, but leave it to me to bring it up again.

John
 
Back
Top