Jump to content

Custom Fonts for plugins


Recommended Posts

Thanks, I had considered that approach, but I know for a fact unity supports true type font loading. The problem is that it seems like they can only be loaded using the UnityEngine.Resources class, and our plugin directories don't seem to be traversed by that loader.

I could read the files in as a byte stream using KSP.IO, but unity's font class doesn't have a constructor that will read those bytes. I could look into subclassing their font class and building a custom ttf loader, but needless to say that could be quite intensive.

If I can somehow get the unity Resources class to look inside the gamedata directory, it would be problem solved. Any thoughts?

Documentation: http://docs.unity3d.com/Documentation/ScriptReference/Resources.html

Link to comment
Share on other sites

  • 1 month later...

Here is a very tricky problem...

I'm trying myself to use a specific font, so I had a look on KOs code to see how Nivekk implemented his C64-like font.

He uses a png file from where characters are extracted.

https://github.com/Nivekk/KOS/blob/master/TermWindow.cs

Cause I only need digits, an other way consists of arrays of png files. Look at this tip :

http://answers.unity3d.com/questions/37277/Custom-score-texture.html

I'll try this last one.

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...