I'm just beginning with scripting and finding it a little more challenging than I thought as, imo, the docs are more for reference than for telling you how things are actually done! I'm getting most of my info from the zdoomWiki..
I have this test code...
Code: Select all
class testText : EventHandler {
override void RenderOverlay(RenderEvent c) {
//HUDFont myfont = HUDFont.Create(smallfont);
HUDFont myfont = HUDFont.Create(infofont);
Statusbar.DrawString(myfont, "This is a Testing", (53,-43),
Statusbar.DI_SCREEN_LEFT_BOTTOM | Statusbar.DI_TEXT_ALIGN_RIGHT,
Font.CR_RED);
}
}
I have made a directory /fonts/infofont and in it I have placed png files of all the font characters, as exported from "UDFC_TEST_KOREANS" exporter. The thing is that the docs do not tell you, or at least I do not understand where it tells me, how to use the fonts. All it says is literally
So... how exactly do I use this font now that it is "created"?To add a Unicode font, follow these steps:
- Generate a series of PNG images where each image represents one glyph of the font. This can be done with a font generator, like this one.
- Make sure the name of each image is the Unicode codepoint of the character it represents, in hexadecimal notation. For example the image with the glyph for Latin Capital Letter A must be named 0041.png; glyph with the number 1 should be named 0031.png, and so on. If you're using a font generator, it should take care of this automatically.
- Place all of the images under the /fonts/<yourfontname>/ folder in your PK3 archive.
testFont Files @ufile.io (free anonymous file share website)
PS : this is a cross post form DoomWorld, as I noticed this fourm has a dedicated zscript section, I thought it would be a better place to hang.
PSS : Is there a zscripting / mod editing discord I can hang out in?