ID:373022
 
(See the best response by Stephen001.)
Code:
mob/var/obj/console
mob/var/console_lines_displayed
mob/var/console_timeout = 0
mob/var/list/mem_text
mob
Login()
..()
console = new
console.screen_loc = "1,1"
src.client.screen += console
mem_text = new
//mem_text += "hello world"
spawn while(src)
console_timeout()


proc
console_timeout()
console_timeout-=10
if(console_timeout <= 0)
console_timeout = 0
if(console_lines_displayed <= 1)
console.overlays.Cut()
else
redraw(1)
sleep(10)

redraw(lines)
console_lines_displayed = lines
console.overlays.Cut()
console_timeout = 80

if(lines <= 1) lines = 1
if(lines >= mem_text.len) lines = mem_text.len

var/iy = lines * 8 - 8
for(var/i = mem_text.len - lines + 1, i <= mem_text.len, i++)
var/ret = draw_text(mem_text[i], iy)
iy -= 8 + ret

mob/proc/draw_text(t as text, py)
var/px = 0
var/ppy=py

for(var/i = 1, i <= lentext(t), i++)
var/chr = copytext(t, i, i+1)
var/image/img = image(icon = 'font_black_new.dmi', icon_state = chr)
if(px >= 480)
px = 0
ppy -= 8
img.pixel_x = px
img.pixel_y = ppy
console.overlays += img
px += 8
return py-ppy

mob/verb/say(t as text)
for(var/mob/m in view())
m.add_mem_text("[src.key]:[t]", 8)

mob/proc/add_mem_text(t, max_text)
if(mem_text.len >= 256)
mem_text -= mem_text[1]
mem_text += t
redraw(max_text)


Problem description:
Looking for criticism / ways to improve this. This is inspirit of using zero windows controls in game and having everything happen in the map screen control.

So far the only thing that feels bad about it, aside from the code being a very quick proof in concept and sloppy, is the console_timeout loop. Also, the fact that I can't make it a client-oriented function that sorts out lines of text onto the screen instead of what happens by default (server tells the client to draw stuff on the screen instead of giving it some text to draw).
well even though this only uses one object for all onscreen text, it turns out to be slow because i guess overlays aren't that quick over-the-wire.
*sigh* there's no fast way to do this because the client has no concept of doing it's own work. the server does everything for it.
Best response
Essentially this mechanism has been covered in some detail by Lummox JR (among others), and implemented into a library:

http://www.byond.com/developer/LummoxJR/DmiFontsPlus

Essentially, it is a difficult area to make efficient with free-form DMI style 'fonts'. Failing that, atom.maptext will offer a simplistic 'text area' style mechanism for rendering a console screen for instance, with the server pushing updates and managing the simulated notion of scrolling and cut-off. Is that the kind of thing you are generally after?
Its not fast over multiplayer because the server literally tells the client to draw things to the screen (slower), instead of handing the client a buntch of text for the client to figure out how to draw (faster).

the only way for the client to do this on its side is to use the built in output pane which is a windows control and doesn't look like a game.
maptext is implemented on the client-side. The server sends the text that needs drawing, and a sense of maximum bounds for where it can draw, the client then makes the decision on actually drawing this, clipping strategy, anti-aliasing etc.

This is essentially part of the given atom's appearance data. If the atom has no icons at all associated with it, one would assume that it's appearance data is simply the map text (unrendered), and a few numbers for bounds of maptext, bounds of atom etc.

Reference: http://www.byond.com/forum/?post=364795#comment1453505
ah but we're waiting for an official release.
Until then, you seem to have explored your alternative options. So I guess this developer help thing is ... kinda done?
Map text will work for what I'm trying to do, as long as we can load some sorta font file.
You can apply some HTML tagging to maptext, as I understand it.

I'm afraid you'll have to just try it and see. My memory of playing with maptext is that it did seem to support standard fonts via IE supported set of fonts (so system fonts, standard serif and sans ones) and colours. If you do try though, post your results here for future people searching to see, please.