Bay 12 Games Forum

Please login or register.

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

Author Topic: Tool to generate text tilesets  (Read 28261 times)

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Tool to generate text tilesets
« on: July 09, 2014, 11:54:00 pm »

Text tilesets for TwbT do not have to contain any special hand-drawn symbols, so it should be possible to use just any font as is. But I couldn't find any tool to generate tilesets from fonts, so here it is. Can also be used as a starting point for creating customised ASCII tilesets.

http://www.mifki.com/df/fontgen.html

Works best and fonts look best in Chrome. In the font name field you can specify any font available locally or any font from Google Fonts collection (of course monospaced fonts are better). Font weight is a CSS font weight.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Tool to generate text-only tilesets for TwbT
« Reply #1 on: July 10, 2014, 12:08:44 pm »

I love it.

Thats all.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Tool to generate text-only tilesets for TwbT
« Reply #2 on: July 10, 2014, 12:30:05 pm »

This is awesome, thanks mifki!

Now if you find your head constantly tilted to the right, you can use an italic Courier font and see the game properly :)
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: Tool to generate text-only tilesets for TwbT
« Reply #3 on: July 14, 2014, 07:23:16 pm »

Awesome!  I might use this if there's no 'native' option for a graphics pack. 
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Tool to generate text-only tilesets for TwbT
« Reply #4 on: July 28, 2014, 11:55:35 am »

Mifki, could you please make a square version of this?
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

therahedwig

  • Bay Watcher
    • View Profile
    • wolthera.info
Re: Tool to generate text-only tilesets for TwbT
« Reply #5 on: July 28, 2014, 12:30:22 pm »

Mifki, could you please make a square version of this?

Change cw:10; in the bottom to decide cell-width.
Like, for example:

{"fw":"normal","fn":"Berkshire Swash","fs":14,"dx":3,"dy":-1,"cw":18,"ch":18}

This won't change the wall-tiles properly, but it's enough for a TwbT font tileset.

This is useful, :)
Logged
Stonesense Grim Dark 0.2 Alternate detailed and darker tiles for stonesense. Now with all ores!

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: Tool to generate text tilesets
« Reply #7 on: October 10, 2014, 06:43:02 am »

I've updated the tool.

Now it's possible to move and resize individual characters (click on a character to select it).

Just paste this (use select button below)
Code: [Select]
{"fw":"normal","fn":"Anonymous Pro","fs":14,"dx":1,"dy":-2,"cw":10,"ch":16,"cust":{"1":{"dx":-1,"dy":0,"ds":-2},"2":{"dx":-1,"dy":0,"ds":-2},"5":{"dx":-1,"dy":0,"ds":-1},"6":{"dx":0,"dy":0,"ds":0},"10":{"dx":-1,"dy":0,"ds":0},"11":{"dx":-1,"dy":0,"ds":-2},"12":{"dx":-3,"dy":0,"ds":-1},"14":{"dx":-3,"dy":0,"ds":-3},"15":{"dx":-1,"dy":0,"ds":-4},"16":{"dx":-1,"dy":0,"ds":-4},"17":{"dx":0,"dy":0,"ds":-1},"30":{"dx":-1,"dy":0,"ds":-4},"31":{"dx":-1,"dy":0,"ds":-5},"32":{"dx":0,"dy":0,"ds":0},"59":{"dx":0,"dy":0,"ds":0},"158":{"dx":0,"dy":0,"ds":-3},"247":{"dx":0,"dy":0,"ds":-2},"251":{"dx":0,"dy":0,"ds":-3}}}
into the import/export field to see the difference. Oh yes, use Chrome, it renders text better and I actually didn't test much in other browsers.

I now expect creation of nice text fonts of various sizes for twbt so that people won't complain about ugly curses font anymore.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Tool to generate text tilesets
« Reply #8 on: October 10, 2014, 11:15:07 am »

A suggestions: Add a link to this thread from the first post in the TwbT thread. Or, considering how small this thread is, just copy all this here into the TwbT thread.

My reasoning is that this thread here is rather inactive, partly because its harder to find (?), so it might be better to keep everthing TwbT in one place.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

HaterSkater

  • Bay Watcher
  • #000000
    • View Profile
Re: Tool to generate text tilesets
« Reply #9 on: October 10, 2014, 06:07:29 pm »

A suggestions: Add a link to this thread from the first post in the TwbT thread. Or, considering how small this thread is, just copy all this here into the TwbT thread.

My reasoning is that this thread here is rather inactive, partly because its harder to find (?), so it might be better to keep everthing TwbT in one place.

^^^This^^^

That tool is absolutely amazing

upd: Oh, btw i wanted here to make fun of my brand new Lobster tileset (any google font, right? :D), just to realise that it won't download image via Safari
upd2: works, if instead of pressing "download" one will right-button-click and "download linked file"

that's hilarious   :D
Spoiler (click to show/hide)
« Last Edit: October 10, 2014, 06:26:17 pm by HaterSkater »
Logged
▲▲▲▲▲
;ÑÜ&,
.';,

Duerer TWBT tileset v.0.6.A

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Tool to generate text tilesets
« Reply #10 on: October 10, 2014, 08:54:03 pm »

Windings?
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

HaterSkater

  • Bay Watcher
  • #000000
    • View Profile
Re: Tool to generate text tilesets
« Reply #11 on: October 10, 2014, 10:36:51 pm »

Oh god, i missed that i can use local fonts. :o
Suggestion here: can you add an option not to smooth resulting image and use nearest neighbour interpolation instead
Logged
▲▲▲▲▲
;ÑÜ&,
.';,

Duerer TWBT tileset v.0.6.A

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: Tool to generate text tilesets
« Reply #12 on: October 10, 2014, 10:43:14 pm »

Oh god, i missed that i can use local fonts. :o
Suggestion here: can you add an option not to smooth resulting image and use nearest neighbour interpolation instead

What do you mean? Font smoothing?

CLA

  • Bay Watcher
    • View Profile
Re: Tool to generate text tilesets
« Reply #13 on: October 11, 2014, 04:58:20 am »

Man, this is useful.
Any chance of an standalone/offline version? I'd much prefer having a small program in a folder I can point to a ttf file instead of using system fonts with an online application.
I could download the html and use it without internet of course, but it's just not the same.



Quote from: mifki
What do you mean? Font smoothing?
He's talking about the resizing/rasterizing algorithm you use. For some fonts, nearest neighbor (i.e. no form of aliasing or smoothing is applied) might produce better results.
In general, I think it would be great to have an option to export as eps (vector file) and do the resizing yourself.

Quote from: HaterSkater
can you add an option not to smooth resulting image and use nearest neighbour interpolation instead
You could just set the tile size to something like 100px and adjust the font size accordingly. Export that image and resize it with NN in your favorite bitmap editing program.
I played around with a few resizing algorithms, but some fonts just don't work that great with only a few pixels, no matter what you use to resize.
I think first and foremost, this tool is useful to create a template from which you can work; With a lot of fonts, I wouldn't say that the output is already very usable, and you definitely need to do some manual redrawing.

Another request:
Allow selecting multiple tiles with shift clicking so you can move them together.
Logged
CLA - an ASCII-like Graphic Pack with simplified letter-like creature graphics. The simple and clean looks of ASCII with distinct creature graphics - best of both worlds!

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

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: Tool to generate text tilesets
« Reply #14 on: October 11, 2014, 05:57:23 am »

Man, this is useful.
Any chance of an standalone/offline version? I'd much prefer having a small program in a folder I can point to a ttf file instead of using system fonts with an online application.
I could download the html and use it without internet of course, but it's just not the same.

Why not the same? It works perfectly when opened in a browser from local folder. If you're offline you'll be able to use only system fonts, if you're online you'll be able to use Google fonts as well. Theoretically it may be possible to support loading ttf fonts that are not installed in the system, but I need to try. Do you usually have fonts that are not installed in your system?


He's talking about the resizing/rasterizing algorithm you use. For some fonts, nearest neighbor (i.e. no form of aliasing or smoothing is applied) might produce better results.
In general, I think it would be great to have an option to export as eps (vector file) and do the resizing yourself.

I don't understand because I'm not doing any resizing. I just take an image with size based on the specified cell width and height, and render characters onto it (well not me manually, the browser renders).

Different systems and browsers are using different algorithms of smoothing fonts when rendering text that may work better or worse for some fonts. I'll see whether I can control this in html.
Pages: [1] 2 3