ID:2125055
 
(See the best response by Nadrew.)
Code:
var/list/font_rsc = list('Font.FON')
var/signfont = "Font"


var/obj/a = new/obj/Stats/NameDisplay
src.client.screen+= a
a.maptext="<font face='Signature'>[p.name]</font>"


Problem description:


I want to add font for maptext but i cannot make it work somehow. Help would be appriciated and an explanation
Best response
For one, it only supports true-type fonts (ttf), for two, you need to be 100% sure the fact matches what's inside of the file (opening it directly will tell you the friendly name to use).

For three, you should generally have the variables all setup before adding it to the screen to avoid any invalid information from appearing before it gets set.
In response to Nadrew
Nadrew wrote:
For three, you should generally have the variables all setup before adding it to the screen to avoid any invalid information from appearing before it gets set.

Is this really a thing? Can a frame actually pass between the line of code where an object is added to client.screen and the next line of code where its appearance is changed?
I've seen it happen where you get a split second of the default values before changing them, it's not common but it taught me not to add objects to the screen before they were ready.
Thanks, I changed it into ttf and it is working now.
In response to Nadrew
I'd like to hear Lummox's opinion on this, rather than chalk it up as just another unexplained and unintuitive BYOND quirk (which we should probably start keeping track of better).
It might not even happen anymore, lots of things have changed since I got into the practice of setting things up before adding it to the screen.

I'm not even sure it was possible for it to happen anywhere but locally where a touch of network lag would eliminate it.

Still, not bad practice to make sure something looks how you want it to look before making it visible.