Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit) (+1)

Having seen your stream, this can be simplified; for some reason I had assumed you wanted something integrated with the font editor.

Given a field named "f" and a canvas named "c", you can set the font of the canvas and field to your custom font manually, and then give the field the following script:

on change do
 c.clear[]
 c.text[f.text (0,0),(1,2)*c.lsize]
end

Since the contents of the canvas is always being redrawn from scratch to reflect the field contents, you could optionally reduce the file size of your deck a little bit by marking the canvas as "volatile" and dividing the script into a card script that updates the canvas whenever the card is refreshed:

on view do
 c.clear[]
 c.text[f.text (0,0),(1,2)*c.lsize]
end

And a script for the field to kick off an update whenever it changes:

on change do
 view[]
end

And if you wanted the canvas to always reflect the font(s) chosen for the field widget and any rich text inside it, you could generalize the script further to copy the field's font setting to the canvas before doing any drawing and use the field's .value (the rich text contents of the field) instead of .text (the plain-text contents):

on view do
 c.font:f.font
 c.clear[]
 c.text[f.value (0,0),(1,2)*c.lsize]
end

Hope that helps!

(+2)

Thank you again!! I realized that I phrased my original question in a confusing way, and I once again really appreciate your help! I'll dig into this tonight and try to make some adjustments. It's been a delightful process building out a font though!