| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Message
| Well for one thing I can't reproduce that after trying a couple of fonts:
win = "test_" .. GetPluginID ()
WindowCreate (win, 0, 0, 180, 80, miniwin.pos_center_all, 0, 0xFFFFFF)
WindowFont (win, "f", "Helvetica", 10, true) -- define font
WindowText ( win, "f" , "Hello, world\n", 10, 10, 0, 0, 0, 0)
WindowShow (win, true) -- show it
Result:

No doubt it does it for some of them, otherwise you wouldn't have reported it.
For another thing, some fonts actually take the opportunity to use those "non-printable" positions to slip in some graphical characters, which might be useful. For example:
win = "test_" .. GetPluginID ()
WindowCreate (win, 0, 0, 380, 80, miniwin.pos_center_all, 0, 0xFFFFFF)
WindowFont (win, "f", "Helvetica", 10, true) -- define font
x = 10
for i = 0, 32 do
x = x + WindowText ( win, "f" , string.char (i), x, 10, 0, 0, 0, 0)
end
WindowShow (win, true) -- show it
Result:

So if I suppress character 10 just because it makes a box you don't like, then that will drop one of those graphic characters from your ability to display them. Why do that?
WindowText is an interface to the low-level character drawing routines. It doesn't claim to handle newlines or to suppress them. However I'll update the documentation to make that clearer.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|