Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Creating a custom TrueType font tailored to Dwarf Fortress  (Read 8406 times)

Moosey

  • Bay Watcher
  • [moose brute extract]
    • View Profile
Creating a custom TrueType font tailored to Dwarf Fortress
« on: March 21, 2011, 01:09:56 pm »

I'm in the process of creating a font for use with Dwarf Fortress's TrueType feature, made to fit the interface.  That is, a monospaced font whose character aspect is perfectly square, so that it matches up with DF's display grid when using a square graphic tileset like Ironhand or Mayday -- in fact, it's based directly on the letters in Mayday's tileset.  It would free up the letter spaces in the tileset for use as additional graphics, and inversely keep all graphics out of the punctuation and other rare characters in text.  The biggest drawback of a TTF font, pre-placed text appearing misaligned, would not apply to this font.

Early results are promising:
Spoiler (click to show/hide)

However, the game crashes in some modes (the "V" view units and "T" view items in buildings views, specifically).  Is this a bug in DF, or due to something missing or broken in my font?  Also, I notice that some text screens (the "thoughts and preferences" screen, for instance) are rendered with the tileset, not the TTF.  Is this going to be fixed?
Logged
Backs to the wheel
There's granite to shove

swampwater

  • Bay Watcher
  • needs alcohol to get through the working day
    • View Profile
Re: Creating a custom TrueType font tailored to Dwarf Fortress
« Reply #1 on: March 22, 2011, 01:00:02 am »

I wish I had answers, but mostly I'm posting just to watch and bump since this is something I'm pretty interested in. I haven't had TTF mode crash on me in those screens so I think it must be your font- though I can't think of why other than some sort of line-overrun problem... I haven't done extensive font testing, but your project is exactly the sort of thing I was searching for, so I hope it works out. :) I have only done basic playing around with fontmakers before but if you need some help I'm willing to do what I can.
Logged

Halaster

  • Escaped Lunatic
    • View Profile
Re: Creating a custom TrueType font tailored to Dwarf Fortress
« Reply #2 on: March 25, 2011, 03:15:47 pm »

Looking really good. Hope you can sort out the issues and release this.
Logged

Uristocrat

  • Bay Watcher
  • Dwarven Railgunner
    • View Profile
    • DF Wiki User Page
Re: Creating a custom TrueType font tailored to Dwarf Fortress
« Reply #3 on: March 25, 2011, 04:28:13 pm »

However, the game crashes in some modes (the "V" view units and "T" view items in buildings views, specifically).  Is this a bug in DF, or due to something missing or broken in my font?  Also, I notice that some text screens (the "thoughts and preferences" screen, for instance) are rendered with the tileset, not the TTF.  Is this going to be fixed?

I would test the same modes with the original truetype font to check that.  Also, search the bug tracker.  I haven't used TTFs because of the issues you're trying to solve, so I'm not too sure.

I do seem to remember that I might have seen a crash once, though, when I tried using TTF, but I didn't use it for very long so I don't remember any more.
Logged
You could have berries on the rocks and the dwarves would say it was "berry gneiss."
You should die horribly for this. And I mean that in the nicest possible way.

gramks2k

  • Bay Watcher
    • View Profile
Re: Creating a custom TrueType font tailored to Dwarf Fortress
« Reply #4 on: March 25, 2011, 04:43:59 pm »

So if I am understanding this correctly this would free up 26+ tiles for use for other things without affecting any of the text in the game? Brilliant!
Logged

Sarvesh Mossbeard

  • Bay Watcher
    • View Profile
Re: Creating a custom TrueType font tailored to Dwarf Fortress
« Reply #5 on: March 25, 2011, 05:07:54 pm »

I approve!
Logged
Quote
You forgot a detail: Dorfs get webbed in GCS webs and trigger traps. Right now we have some 12 caged dwarves, including you.

Uristocrat

  • Bay Watcher
  • Dwarven Railgunner
    • View Profile
    • DF Wiki User Page
Re: Creating a custom TrueType font tailored to Dwarf Fortress
« Reply #6 on: March 26, 2011, 01:24:48 am »

Here we go, I found the TTF bug on Mantis.  It's not marked as resolved, so I'm guessing that this still causes crashes.  Might want to compare it to your experiences (and comment on the bug if you've been getting this crash in a newer version than .18).

Bug 0003762

Good luck with the font, though.  I really like the idea of separating letters from objects :)
Logged
You could have berries on the rocks and the dwarves would say it was "berry gneiss."
You should die horribly for this. And I mean that in the nicest possible way.

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Creating a custom TrueType font tailored to Dwarf Fortress
« Reply #7 on: March 26, 2011, 09:51:44 am »

Yeah, currently TTF mode crashes on me a lot during "v"-looking at creatures. So it's not your fault, keep your great work and we all hope that it's fixed someday. Did Baughn disappear forever? It was his work I think.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Moosey

  • Bay Watcher
  • [moose brute extract]
    • View Profile
Re: Creating a custom TrueType font tailored to Dwarf Fortress
« Reply #8 on: April 10, 2011, 02:48:08 pm »

Oh my!  I haven't been watching my own thread.

Anyway, my findings so far:  With some fonts (my own included), this crash happens in a repeatable fashion.  With others (the system Courier font, for example), the crash does not happen at all, even under identical circumstances.  So what's the difference?  My first thought that the game might be using an unusual code for a character somewhere, and the lack of that character in the font is causing the crash.  After filling out every reasonable (and many unreasonable) character in my font with something, even if just a scribble, the crash still happens.

But perhaps I've missed some.  The main culprit I'm looking at is the item descriptor symbols, since these generally only appear in the screens where it crashes.  There's a manual page that describes all the possible descriptors (I'm picking approximate matches from a Unicode chart for some of these):

Thing (regular)
-Thing- (well crafted)
+Thing+ (finely crafted)
¤Thing¤ (superior)
≡Thing≡ (exceptional)
*Thing* (masterpiece)
«Thing» (decorated)
‼Thing‼ (on fire)
(thing) (foreign)
{thing} (forbidden)
xThingx, XThingX, XXThingXX (damaged)
◀Thing▶ (magical) (wait, magic?  where?!)

Some of these symbols are mundane, and others are quite esoteric.  Does anybody know the exact Unicode numbers for what DF uses for these designations?  I must say I don't feel like designing characters for the full 50,000+ Unicode spectrum just in case.
Logged
Backs to the wheel
There's granite to shove

Thrin

  • Bay Watcher
  • [PERMITTED_JOB: GRAPHICS_SURGEON]
    • View Profile
Re: Creating a custom TrueType font tailored to Dwarf Fortress
« Reply #9 on: April 10, 2011, 09:03:35 pm »

Well, I don't know much about ascii, unicode, or ttf's, but I think this wikipage might help you out.

Edit:

Looking at the page above and comparing with my current tileset, these are my best guesses:

Code: [Select]
Thing
Thing

-Thing-
2d Thing 2d

+Thing+
2b Thing 2b

*Thing*
2a Thing 2a

≡Thing≡
2261 Thing 2261

☼Thing☼
263c Thing 263c

«Thing»
ab Thing bb

‼Thing‼
203c Thing 203c

(Thing)
28 Thing 29

{Thing}
7b Thing 7d

Damage just seems to be x X and XX.

◄Thing►
25c4 Thing 25ba
Magical is, of course, a guess, as I have nothing in the game to compare to.

Also, the word "thing" has lost all meaning to me.
« Last Edit: April 10, 2011, 10:27:30 pm by Thrin »
Logged

Spectre Incarnate

  • Bay Watcher
  • Possibly inside a dragon's toothy maw.
    • View Profile
Re: Creating a custom TrueType font tailored to Dwarf Fortress
« Reply #10 on: April 11, 2011, 05:14:58 am »


Some of these symbols are mundane, and others are quite esoteric.  Does anybody know the exact Unicode numbers for what DF uses for these designations?  I must say I don't feel like designing characters for the full 50,000+ Unicode spectrum just in case.

Most computers come installed with a Character Map, under Accessories > System Tools.

Also, as far as I've seen, TTFonts make my game crash when looking at a creature with a long name, usually a beast or other bad guy that has made a name for him/herself in the history books. I hope that helps ya, cause it'd be awesome if you could get that working better. Thanks so much for trying!
Logged
The in-game text has punctuation!  Who knew?
Mister Adams,
How many licks does it take to get to the [candy] center of a Dwarf Fortress?

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: Creating a custom TrueType font tailored to Dwarf Fortress
« Reply #11 on: April 11, 2011, 06:46:46 am »

TTF font mode crashes when it encounters certain letters above ASCII 127, but not always.  Basically it reads/writes to an uninitialized section of code. Baughn was supposedly trying to fix it, but I haven't heard anything past "OH I know what's doing it" really
Logged
I like fortresses because they are still underground.

Totaku

  • Bay Watcher
  • The little oni that strikes the earth
    • View Profile
Re: Creating a custom TrueType font tailored to Dwarf Fortress
« Reply #12 on: April 11, 2011, 07:50:17 am »

Yeah, currently TTF mode crashes on me a lot during "v"-looking at creatures. So it's not your fault, keep your great work and we all hope that it's fixed someday. Did Baughn disappear forever? It was his work I think.

Well he did disappear for a while. But he came back lately. And I think he is aware of the issue since it was brought up on Ironhand's custom graphic pack, mainly due to the fact he used Truetype by default as well.

So he knows there's a problem with true type, it's just a matter of how soon the problem will be fixed, and when it'll be implmented into DF.
Logged
That's one small step for man, one giant leap for Otakukind!

And maker of the mod in progress known as Suika Fortress Now for 0.34.xx!

KurzedMetal

  • Bay Watcher
    • View Profile
Re: Creating a custom TrueType font tailored to Dwarf Fortress
« Reply #13 on: June 20, 2011, 06:07:20 am »

I'm kinda chanting necromantic spells here...
But the bug you guys were talking about is marked as resolved now. Did you try your font in the lastest versions?
And I was looking for a TTF font (mostly for the genre and masterwork icons), how's your project going? :)
Logged
Quote from: ARandomGuyOnTheInternet
When 80% of your fans use 3 different external programs simultaneously to play your game comfortably, you might need to stand back and think "Maybe...Maybe I should get around making a UI designed to be used by carbon-based entities, like mammals".

kotekzot

  • Bay Watcher
    • View Profile
Re: Creating a custom TrueType font tailored to Dwarf Fortress
« Reply #14 on: June 20, 2011, 09:04:16 am »

I believe the fix will only appear in post .25 releases.
Logged
Dwarf Fortress: Where violent death is a renewable resource
Bro, your like... thinking like a square man... its like, the WHOLE lamprey is just like, one big NECK dude, you know? its like hahahaha! dude protect the trees though, seriously. *inhale*... anyways... you like, want this dead black bear, bro?
Pages: [1] 2