Bay 12 Games Forum

Please login or register.

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

Author Topic: df2ttf - Automatic TTF generator  (Read 13091 times)

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: df2ttf - Automatic TTF generator
« Reply #15 on: February 24, 2012, 07:00:02 am »

u think you could make a ttf of the 12x12 of mayday or Mordaes_12x12_101

can be found here

http://dffd.wimbli.com/category.php?id=16&string=&sort=file_id&order=asc&limit=50&page=1

I'm interested in phoebus the most, but this guy mentions it without linking it (i messaged him)

http://www.bay12forums.com/smf/index.php?topic=52186.210

Mayday's is a good alternative to phoebus, so that one would be nice.

Do you know of any already made ttf--not having been converted, but made from the groundup-- that resemble a graphic tileset best at a 12x12 resolution?  I understand your program was made for this, but I'm wondering if a ttf was already out there.

Is it possible to use an alternative to cygwin as mentioned on the fontforge site?
Alternatives to cygwin.

/Quote
There are now alternatives to cygwin.

Someone has ported fontforge to mingw, which is much simpler to download than cygwin:

    fontforge-mingw
Quote/

Update 2:

I got cygwin installed.  Fontforge isn't exactly clear on where I'm supposed to get x windows system from within cygwin (doing a search for "window" shows nothing, "x" only shows x11, so I installed the full x11 package).  Fontforge is instaleld by default within cygwin apparently.

running your script now starts with no errors, but I'm not getting output.  It just stops running after 10-20 seconds.

Update 3:
I tried putting the files in the cygwin dir, and running it within cygwin.   I don't think that's what I'm supposed to do, cuz the .py files don't run within cygwin (unless my python didn't install right with cygwin?  Which I never installed via cygwin menu, but it is on there.  If I type python in cygwin, it starts up a python 'shell').

Update 4:
Okay, I'm making progress.  I copied the script and tileset in question to the fontforge-cygwin_2011_06_06 (which is a fontforge cygwin (alternative) install), and when I run the script, it opens fontforge, but fontforge is unresponsive.  My CPU isn't doing much, so I don't think it's doing anything.  I got the idea when I was looking at the script, and it made a call to fontforge.

Update 5:
Apparently the fontforge cygwin (alternative) install is in a different language.

Update 6:
Apparently the minigw alternative install had a fontforge.exe, so I tried putting the files in there and running it.  It justs exits out when trying to start the .py scripas it originally did.

Update 7:
Okay, it's not crashing now.  I modified the minigw fontforge.bat to prep.bat, and pulled out the reference to actually starting fontforge.  So my paths are setup to use fontforge in the minigw folder.  Then I renamed fontforge.bat to something else, then started prep.bat, and then started the .py script.  So now it looks like it's doing something, but again my cpu is really low.  So i'm not sure what it's doing, but fontforge.exe is open, and the .py script hasn't stopped.
« Last Edit: February 24, 2012, 08:08:57 am by thistleknot »
Logged

keenerd

  • Bay Watcher
    • View Profile
Re: df2ttf - Automatic TTF generator
« Reply #16 on: February 24, 2012, 08:35:32 am »

Boot up your linux flash drive.  I am presuming it is Ubuntu or some other Debian derivative.
Code: [Select]
sudo apt-get install python-imaging
sudo apt-get install fontforge
python df2ttf.py whatever_tileset.png

And then copy out the whatever_tileset.ttf.

Managing software on windows sucks.  Linux practically as good as Dwarf Therapist here.

And seriously, please get rid of the three screenfuls of useless error message from your first post.

http://kmkeen.com/tmp/mayday_12x12.ttf
http://kmkeen.com/tmp/mordae_12x12.ttf
« Last Edit: February 24, 2012, 08:41:22 am by keenerd »
Logged

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: df2ttf - Automatic TTF generator
« Reply #17 on: February 24, 2012, 09:20:05 am »

wee have liftoff (im doing it on my touchpad under an arm linux install, thx)!

frankienrg

  • Bay Watcher
    • View Profile
Re: df2ttf - Automatic TTF generator
« Reply #18 on: February 24, 2012, 07:32:06 pm »

can you do the 8x8, 10x10, 16x16 from this thread http://www.bay12forums.com/smf/index.php?topic=89856.0?

thanks!
Logged

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: df2ttf - Automatic TTF generator
« Reply #19 on: February 26, 2012, 01:09:22 am »

i have the 10x10 ttf.  I found the tocky 10x10 looks awesome as well.

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: df2ttf - Automatic TTF generator
« Reply #20 on: February 27, 2012, 02:55:04 pm »

when i do the tonky tileset from a prior pulled .png (I'm merging some vherid fonts into the tonky one).  It shows up larger than the original that came with the tileset ttf package available from http://dffd.wimbli.com/file.php?id=1922?  I guess the conversion isn't perfect.  The creator of the DFFD one's said he used fontcreator and an AHK script.  I'd love to figure out how to do it myself.  Even if I can't.  If I could just figure out how to mod my own.

this is what I'm trying to convert.  It's a tocky vherid hybrid
http://i41.tinypic.com/11uf09i.jpg

Update:

I found out why it's doing what it's doing (but don't know how to fix it).  In reference to the process not being perfect, they both look true to the original fonts, but the scaling is far different between the two conversions.  The font looks okay at larger settings, but try to fit that into dfterm2.

at first glance, individually, they boot look fine inside fontforge.  It's when you compare them that you notice the differences.   Df2ttf is converting them to look bigger somehow vs the dffd (elvang, font creator/ahk method).  Is there an easy fix?  I'm finding I'm not wishing to use the DF2TTF one's inside dfterm2 because there coming out too big (vs the DFFD ones).

« Last Edit: February 27, 2012, 06:37:44 pm by thistleknot »
Logged

keenerd

  • Bay Watcher
    • View Profile
Re: df2ttf - Automatic TTF generator
« Reply #21 on: February 27, 2012, 08:25:23 pm »

Vherid looks like a nice tileset.

http://kmkeen.com/tmp/vher8x8v2-2.ttf
http://kmkeen.com/tmp/vher10x10v4-1.ttf
http://kmkeen.com/tmp/vher16x16v1-5.ttf

Thistleknot, I have no clue.  It sounds like you may be using the wrong font size in your terminal.  Df2ttf is made to produce pixel fonts that work at the same resolution as the source.  You'll probably have to set that.  Very strange though.  I'll look into it when I have a bit more time.
Logged

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: df2ttf - Automatic TTF generator
« Reply #22 on: February 27, 2012, 10:23:18 pm »

I think I got it.  Fontforge has an option to select all, transform, scale down.  Then it asks me about emsize.  So I'm working on that.  60% is what I'm looking for, but when I save it, it doesn't show up in putty, but does in swriter, as well as notepad.

I guess I'm not using the right options when I go to generate fonts.

Update:

got it, had to check all checkboxes of scale uniformly, I was comparing to the original tocky, and without those additional checkboxes, it was spaced to far.
« Last Edit: February 27, 2012, 10:59:20 pm by thistleknot »
Logged

keenerd

  • Bay Watcher
    • View Profile
Re: df2ttf - Automatic TTF generator
« Reply #23 on: February 27, 2012, 10:47:17 pm »

You don't got it :-)

Fontforge will, if not given any other information, expand small fonts to fit inside that preview window.  I could see this in an 8x8 font.  However, Fontforge's preview has absolutely nothing to do with how it actually looks in the game.  I loaded the font, set the terminal's font size to 8px and it looked exactly as expected.

Basically, don't resize the font.  You will ruin it.

But it would be nice if my fonts "knew" the correct size and limited themselves to it.  Before I was setting SetWidth and SetVWidth but I guess those aren't the best things to use.  Maybe SetFontHasVerticalMetrics, maybe AddSizeFeature.  There are many many options to play with later.
Logged

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: df2ttf - Automatic TTF generator
« Reply #24 on: February 27, 2012, 11:18:57 pm »

well my thistleknot font works great at font size 12, which the default one created with df2ttf didn't do well with.  Now, if I used the default tocky at font size 8 in putty, it looks like crap as well.  It was when I set df2ttf tocky in putty at 12 that it looked "blown up".  After doing the mod with fontforge, now if I use my newly modded tocky at font size 12 in putty, it works.  So something did it right.

I give up, that process doesn't uniformly fix the issues I'm having with other fonts.  Some fonts still don't show up.

Update: I got it, when you are resize uniformly, or scale, or whatever, don't choose center, choose glyph origin.

update: the process didn't work w vherid fonts as well as it did w a tocky conversion.
« Last Edit: February 28, 2012, 09:14:30 am by thistleknot »
Logged

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: df2ttf - Automatic TTF generator
« Reply #25 on: February 29, 2012, 10:30:59 am »



So using the process I mentioned above for my custom font on the left (Thistleknotv4, can be found on dffd), and the generic conversion issues I'm having with 10x10 fonts on the right.  As you can see, the one on the right is unplayable at font size 12.  Shrinking the font to a lower size begins to truncate the issue.

Now, when I resized these "blown up" fonts in fontforge to 60%, they come out looking like the picture on the left at font size 12, which is playable.  I have to shrink them to the desired size I want to display at font size 12, for if I try to resize the font in putty, distortion occurs.  But I can find a "sweet" spot by leaving the font size alone (12 in this example).

So far, shrinking a 10x10 converted from df2ttf to 60% using the methods described above, makes the font playable at size 12 in putty.

keenerd

  • Bay Watcher
    • View Profile
Re: df2ttf - Automatic TTF generator
« Reply #26 on: March 01, 2012, 02:10:17 pm »

You are starting with a 10x10 tileset.  It is made to only work at 10x10.

You turn it into a TTF.  You use it in Putty.  For some mysterious reason, you set the font size in Putty to 12.  12 does not equal 10.  And then you wonder why it looks bad.

The picture on the left is at font size 8, which also looks pretty bad because 8 does not equal 10 either.

I am really confused why you are doing any of this.
Logged

codecx

  • Bay Watcher
    • View Profile
Re: df2ttf - Automatic TTF generator
« Reply #27 on: March 01, 2012, 05:30:48 pm »

Can someone tell me why having TTF in dwarf fortress is significant?

Like, TTF is the alternative vs fixed width font?

Not knocking it or anything. I'm just not wise on this topic. I'm guessing since I've always played it using a graphic set and never in ASCII, I never really noticed/cared.
« Last Edit: March 01, 2012, 05:32:20 pm by codecx »
Logged

keenerd

  • Bay Watcher
    • View Profile
Re: df2ttf - Automatic TTF generator
« Reply #28 on: March 01, 2012, 05:46:04 pm »

Can someone tell me why having TTF in dwarf fortress is significant?

You can host DF on one computer (for example, a fast beefy desktop) but play the game on another (for example, a little netbook).  Dozens of other weird things are possible too, but this is the main one.
Logged

codecx

  • Bay Watcher
    • View Profile
Re: df2ttf - Automatic TTF generator
« Reply #29 on: March 02, 2012, 01:05:48 pm »

OIC

I tried that once using puTTy but I can only get it working with ASCII. I use graphic sets, so I am guessing this doesn't apply to me :)

But for what its worth, that is pretty cool :)
Logged
Pages: 1 [2] 3