Jump to content

Pretty Please let modders have a monospace font to work with.


Recommended Posts

For people writing KSP mods that use Unity GUI widgets, these are the font resources that KSP loads and allows us to use:

Arial

CALIBRI

HEADINGFONT

calibri

calibrib

calibriz

calibril

dotty

Unlike for loading some other Unity resources, like meshes and textures, fonts cannot currently be loaded by a mod. KSP doesn't look for them in the gamedata folders, and even breaking the mod "keep it all in gamedata" design by putting a TTF file in $KSP_HOME/Resources or $KSP_HOME/KSP_data/Resources won't allow it to be loadable by the mod writer (I know, I've tried all of these).

The only fonts mod writers are capable of using are the ones in the list above. And the problem is... none of them are monospaced. I've been trying for days to be able to provide the users of the kOS mod with an in-game text editor widget using Unity's GUI.TextArea, and I cannot seem to escape from the fact that to do so I must use a proportional width font because that's all KSP will allow a mod to use. For typing in script program files you really should have a monospace font.

What the kOS mod resorted to for its terminal window to look monospaced is to create a texture file of hardcoded bit image tiles for each character and it manually does all the work of placing each character's image on the screen in its correct location individually as an image texture. This of course precludes using any of Unity's built-in GUI text tools to do anything with this kind of "font".

What I really could use is either:

1. Provide the ability for Mod writers to load their own fonts into Unity by giving them a place to put .TTF files in their GameData folder that will be checked and loaded by KSP when it scours the mod GameData folders.

or

2. I can understand if there's a desire not to have a proliferation of many fonts as that can make programs look random and ugly, so instead have SQUAD add a monospace font of their own choosing to the Unity Resources that they load. (Be careful to choose one that doesn't cause important symbols like "[,],(,),{,}" to be shown as ambiguously identical, as some fonts do that and that makes them less universally usable). A number of different fonts are available for download from the internet under various licensing terms and I'm sure one can be found that is legal to include in a commercial product free of charge.

Right now if a mod maker wants something monospaced in their mod they really have to do it entirely by hand and can't use Unity's gui tools for it, and that seems like a rather awkward and unnecessary limitation. It would hardly take any work to just add one font file to the Resources in the next release (solution #2 above). I'm sure kOS can't be the only mod that's trying to make something that looks "computery", and a monospace font is useful for doing that.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...