ID:1012122
 
(See the best response by Super Saiyan X.)
Demo:
https://dl.dropbox.com/u/1619190/demo.zip

Screenshot:


Code:
textbox
parent_type = /obj
icon = 'blank.dmi'
var
txt
color = "white"
font = "tahoma"
align = "center"
valign = "top"
size = 1
width = 128
height = 128
padding_top
padding_bottom
padding_left
padding_right

proc
update()
maptext_width = width
maptext_height = height
maptext="<font color=[color] face=[font] size=[size] align=[align] valign=[valign]>[txt]"

bound // bound to a client or atom in some way
var/owner
New(o)
owner=o
//update()

screen
parent_type = /textbox/bound
update()
var/mob/a = owner
a.client.screen -= src
a.client.screen += src
..()

convo
parent_type = /textbox/screen
//icon = 'convobox.dmi'
width = 250
height = 90
size = 3
align = "left"
screen_loc = "4,1:6"
layer = 1023
//pixel_y = 3
//pixel_y = -3
//pixel_x = 6

New()
..()
var/obj/o = new
//o.screen_loc = "4:1"
o.icon = 'convobox.dmi'
o.pixel_x = -6
o.pixel_y = -3
o.layer=layer
underlays+=o
var/obj/k = new
k.icon = 'avbyond.png'
k.overlays += 'over_pic.dmi'
k.pixel_y = 64
k.pixel_x = -64
k.layer=1024
overlays += k

overlay
parent_type = /textbox/bound
update()
..()
var/atom/a = owner
a.overlays-=src
a.overlays+=src

mob/verb/test(t as text)
var/textbox/overlay/o = new(src)
o.txt = t
o.pixel_y=-12
o.pixel_x=-16
o.width = 64
o.height= 64
o.update()

mob/var/textbox/convo/c
mob/verb/test2(t as text)
if(!c) c = new(src)
c.txt = t
c.update()


Problem description:
The text inside the textbox never stays within the boundaries of maptext_width, or (i presume) maptext_height. Is it me doing something wrong or is this a bug?

Best response
It's because there are no locations in the string where a line break can be inserted. Not necessarily a bug, 'intended behavior' most likely - unless they have a way of hyphenating the text properly.
Thanks for the repose, though I'm afraid I don't quite follow you there, sorry.
What do you mean by 'hyphenating the text properly'? What can I do to get around this issue?
The common way of splitting a really long "word" (as seen in your image) would be to hyphenate it. It needs a place where it can go to the next line. Where as, if it has spaces instead of being one long "word", it'd line break automatically on those spaces.
So, if your maptext is "sdfgfgjhsdgfhgsdfgjhsdfgsgdfjgsfgjhsdgfuywerdfs", but you only have maptext_width for a third of that per line - you'd want it to go like this instead, right?:
"sdfgfgjhsdgfhgs-
dfgjhsdfgsgdfjgs-
fgjhsdgfuywerdfs"

You can insert hyphens, and line breaks on your own with some maths, or something.
This is poor autowrap design. :/
Probably. I believe Tom said to report it as a bug in a previous post, because it's 'supposed' wrap even without spaces. Check bug reports for it? Bump it.