|
From: Bastian M. <bma...@we...> - 2013-05-21 13:26:47
|
Mojca, I think your interpretation of things is about right. The treatment you describe is needed to handle e.g. multiline labels. Please note that term/README provides some more information concerning parameters etc. and the implementation e.g. for cairo clearly shows how things are supposed to work. While implementing the code for Windows I noticed some oddities, though: The core code does not apply linetype before calling boxed_text. I guess in principle the color of the box should match the current line color, but at least for wxt it always comes out black. There actually is a corresponding FIXME in the core code. It is also not clear to me how to handle rotated labels. Currently, set label 1 "rotated text" rotate by 45 boxed does produce rotated text, but the box is not rotated (wxt terminal). Should that case be handled by enlarging the box or by rotating it? For sake of clarity, I would also propose to provide an enum to define actions (instead of magic numbers). Also most API sets provide a "draw a filled rectangle with border" function. So instead of using two successive boxed_text calls, we could save one API call per filled box. The terminal code should also reserve room for enhanced text. But according to the comment, that doesn't work just yet for the cairo terminals. Concerning the spacing around the labels, I personally think it is unfortunate to let terminals decide about the default spacing. For things like tic marks etc. the core code uses term->hchar/vchar as a "unit" of length. Bastian Am 21.05.2013 14:15, schrieb Mojca Miklavec: > Dear developers, > > I'm trying to understand how exactly the boxed text should be > implemented in a terminal, but it's not clear to me how it even works. > > Is the implementation of enhanced text mode necessary? I see that the > terminal should provide a function > boxed_text(unsigned int x, unsigned int y, int option) > but it's not clear to me what the function needs to do. > > Can I expect a scenario like this one? > boxed_text(...,...,0) # initialize > put_text(<x>,<y>,"some") # label1 > put_text(<x>,<y>,"text") # label2 > put_text(<x>,<y>,"floating") # label3 > put_text(<x>,<y>,"around") # label4 > boxed_text(...,...,1) > where the last command is supposed to draw a frame around all four > labels, no matter where on the picture they are? > > If not - how exactly should this work? > > Mojca |