Sign in to follow this  

Need Help in Adding and Applying a New Font

Recommended Posts

AFS Co.    51
Assets = {
    Asset("FONT", "fonts/")

TALKINGFONT_WORMWOOD_CUSTOM = "talkingfont_wormwood_custom"

AddPrefabPostInit("wormwood", function(inst)
    inst.components.talker.fontsize = 40
    inst.components.talker.font = TALKINGFONT_WORMWOOD_CUSTOM

This is my code for applying new Wormwood font. It seems to have no problem to load the mod and join in server, but the game crashes as my Wormwood say anything, leaving no noticeable error traceback or something. Could anyone give me some helping hand?

Edited by AFS Co.

Share this post

Link to post
Share on other sites
AFS Co.    51

Status update: I just tried to insert it directly into FONTS table:

local TALKINGFONT_WORMWOOD_KR = "talkingfont_wormwood_custom"

table.insert(GLOBAL.FONTS, {filename = MODROOT.."fonts/", alias = TALKINGFONT_WORMWOOD_CUSTOM, fallback = fallback_wormwood})

--fallback_wormwood is well-defined as well

and this worked. I set the fallback for the custom font to TALKINGFONT_WORMWOOD. But some Unicode glyphs doesn't show, so I want to set secondary fallback or something. Any good method?

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this