ID:91618
 
DmiFontsPlus by Lummox JR
An advanced text-on-map library for BYOND 4.0
18 fans · Created Oct 27 2008
DmiFontsPlus is a revamp of DmiFonts designed for the new icon features in BYOND 4.0. It's a utility and library in one package. New features include alpha transparency, easier icon manipulation (no more clumsy /iconset datum), and fewer separate icons taking up room in your games cache.

The utility program will convert any font to a PNG-compatible .dmi format, and create a .dm file that you can include in your games to use the font. The library can be used to render text in many ways.

The library includes:

  • Support for anti-aliased fonts
  • A fleet of powerful procs to measure and arrange your text
  • Multi-font procs to draw text in changing styles just like this
  • Comprehensive documentation
  • The infamous un-smiley demo



Upgraders please note: You will have to re-make your font files with this library, since the old library used BYOND 3.0 icons and did not support alpha transparency. In place of the old /iconset datum, a single large /icon datum is now used for your text. Manipulating icons is much easier now, but you will have to make adjustments to your code. The QuickName() and QuickText() procs, however, should be unaffected. You will also not be able to use DmiFonts and DmiFontsPlus together; they conflict with each other.
I started playing around with this library over the last couple days, and I must say that I am very impressed. This library is relatively straightforward to use and very powerful.
This library is neat...however, I have trouble seeing the simplicity in it than others may see. I simply want to use the Chat Bubble feature for some NPC's talking in a story line, and do not know how to do so in an easy manner.
I would like to be able to specify a canvas size for the icon_states in the icon file the utility generates. My glyphs are all 8x8px, but the icon_states are 32x32px, and I can't help but feel that this unnecessary extra padding will have a hit on CPU and network performance when displaying a large number of characters.

For clarity: I am using the generated .dmi files with my own text display system. I am not using the DmiFontsPlus library in my project.
Definitly recommended! Makes all the writing stuff so easy.
Very impressive. Not just the font conversion exe but also the programing style itself. I'm not one for butt kissing however I can only hope to one day create such a beautiful script. My hat is off to you at this point...
I love this library. :3
There is a runtime I get with this program. Generally it wouldn't mean anything but in this case it does. It shows up randomly, unexpected.

runtime error: bad icon operation
proc name: New (/icon/New)
usr: Ganing (/mob)
src: /icon (/icon)
call stack:
/icon (/icon): New('', null, null, null, null)
Arial 7pt (/dmifont/Arial7pt): DrawText("Ganing", 48, 1, 96, 4104, 0, -1, 3, 1, null, null)
Arial 7pt (/dmifont/Arial7pt): QuickName(Ganing (/mob), "Ganing", "#ffffff", "#000", null, 3, 5)
Ganing (/mob): CreateName(255, 255, 255)
Ganing (/mob): Login()
runtime error: bad icon operation
proc name: MakeIcon (/mob/proc/MakeIcon)
source file: Login System.dm,51
usr: Ganing (/mob)
src: Ganing (/mob)
call stack:
Ganing (/mob): MakeIcon()
Ganing (/mob): Login()

It even makes the skin go back to 3.5.
It is in fact an awesome library and a must-have resource for every developer. You did a great job, Lummox, congratulations!
Is there a way to change it so instead of the usr's key, it's a name they chose when they began? Like I have a system where I can chose my name(no save file yet) but is there a way to make it so It displays the name I chose instead of my key, because that is what I want
You can use any text you want; you're not limited to just using your key. The QuickName() proc for instance lets you specify the text. I'm not sure how this is unclear from the documentation.
Can this do multiple lines?

Like if I wanted to print some text on the map as below:

Time to Battle
Player 1 vs Player 2
GO!

I want to use it on a 'screen' on the map you see.