> ------------ Původní zpráva ------------
> Od: Denys Vlasenko <[email protected]>
> Předmět: Re: fbsplash - text rendering
> Datum: 25.9.2009 01:28:16
> ----------------------------------------
> On Thursday 24 September 2009 22:23, Jiří Gabriel wrote:
> > > It is a good idea to
> > > discuss API _before_ you start working
> > > on implementing it, to prevent
> > > redoing the work again when it needs changes.
> > >
> > > Let's discuss
> > > "write text" command.
> > >
> > > I propose the following format:
> > > "write[#CLR][.ROW[.COL]]:text"
> > > (or "write[,#CLR][,rROW][,cCOL]:text" - it's more extensible?)
> > > It should draw the text _and_ background picture, so that
> > > "write.10.20:HELLO"
> > > ...wait few sec...
> > > "write.10.20:     "
> > > would erase HELLO and restore the background.
> > > 
> > > (Or do we need "erase" cmd to draw background only inside text's pixels?
> > > That would work better if we will ever have proportional font...)
> > > Should it wrap around end of line? end of screen?
> > > Should it understand TAB? BS? CR/LF?
> > > --
> > > vda
> > 
> > Writing on more than one place is very complicated -
> > for erasing to background image.
> > We must cache whole image or
> > background picture must be available in any time - before pivot_root
> > and after. If we cache whole image then memory usage growth.
> 
> This may be controlled by a command-line option,
> so that size-conscious users can disable it.
> 
> > If we decompress and color recalculate before each write then
> > redrawing text be slowly.
> > My proposing:
> > New command
> > "textbox[:x:y[:maxwidth[:lines]]]" - define text area for writing.
> > Can be saved background of defined area only.
> 
> Maybe later. Let's have at least something simpler first.
> 
> > Command "write:text" - 
> > colorized by \e[30m .. \e[1;37m sequences for console compatibility
> > and colorize char by char.
> 
> We'll need ESC parser. Kinda complex.
 
ESC parser is about 260 bytes and command parameter color parser is about 150 
bytes.
100 bytes for compatibility with init.d functions (Starting........[ OK ]) 
where OK is green.

> > Need anyone more than 16 colors in splash 
> > texts?
> 
> Yes, I bet people will want that.

OK \e[R;G;Bm - nonstandard ESC, +10 bytes of code

> > First char of text can be \r - then last text line 
> > is replaced by new one otherwise old text scroll up (when multi
> > line textbox) and new line is displayed.
> 
> Maybe later. Let's have at least something simpler first,
> for example, simple non-wrapping output at any point in the image
> (the "cursor" goes to the right and off the screen).
> This is simple(r) to code.
> 
> > Command can be named 
> > "echo" for intuitive use.For clearing text can be usable
> > textbox command without parameters.After writing texts,
> > new use of command textbox always erase old textbox area
> > and define new.
> 
> And if user does NOT want to erase text?

New command for permanent (unerasable no rewritable) text output to any 
position like "put,ROW,COL:text" ?

> > TABs and BS I not need. Need 
> > anyone right aligned text for standard [OK/ERROR] boot
> > messages?
> 
> Perhaps not.
> 
> > For multiline boot messaging can be usable 
> > centered image and last few lines can be defined as scroll
> > area - then console outs leave image as is and text scrolling
> > under it. This code can be used in init scripts:
> > row=$((LINES - 5))
> > # scroll area on lower 5 lines only
> > echo -en "\033[6h\033[${row};${LINES}r\033[2J\033[${row};1H"
> > --
> > tykef
> 
> I prefer to not have ESC parser just yet.

This is not code for busybox this is standard linux console.
Echoed text is displayed and scrolled only on horizontal segment on screen,
and image displayed by fbsplash is affected only in few lines - this partition 
of image may be filled by background color.
Background of this text must is one color - from console palette.

> --
> vda
> 
--
tykef
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to