Re: Re: fbsplash - text rendering
Jiří Gabriel
george.gabriel at seznam.cz
Thu Sep 24 20:23:47 UTC 2009
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090924/4d3c193a/attachment.htm>
-------------- next part --------------
> ------------ Původní zpráva ------------
> Od: Denys Vlasenko <vda.linux at googlemail.com>
> Předmět: Re: fbsplash - text rendering
> Datum: 24.9.2009 02:23:12
> ---------------------------------------------
> On Tuesday 22 September 2009 12:11, Alexander Griesser wrote:
> Michele > Sanges wrote:
> > In order to introduce the patch that adds the text > rendering
to the
> > fbsplash applet, I think it is better subdivide the > patch into
small
> > pieces.
> > I attach a first patch that manages > the new parameters (text
position;
> > text color; text size); please, > take a look and eventually
apply it.
> > Then I will send the second part > of the patch.
>
> Replying to this old post here: Can someone > please really
consider
> applying that to trunk? It's a great addon, I > just switched from
using
> splashy (from Debian) in userspace to fbsplash > and missed the
text
> feature, applied this patch and everything works > perfect.
Not in that form.
Sorry, but just adding any > code is not acceptable, or bbox
ends up with unmaintained code like one in > e2fsprogs/old_e2fsprogs
/*
Code needs not be perfect, but it needs > to be "reasonably good".
Since this patch needed too much work to > be performed "by email",
I tried to do it locally, but failed (got > distracted by other
stuff).
My fault.
The attached patch is > where I stopped. It is incomplete.
If anyone is willing to > work on it, please send patches.
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. 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.
Command "write:text" - colorized by \e[30m .. \e[1;37m sequences for
console compatibility and colorize char by char. Need anyone more
than 16 colors in splash texts?
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. 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.
TABs and BS I not need.
Need anyone right aligned text for standard [OK/ERROR] boot
messages?
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
More information about the busybox
mailing list