how to add HUD like infos to X - X

This is a discussion on how to add HUD like infos to X - X ; Hi all in c.o.l.x., I need to display some infos in a HUD (Head-Up Display) style on a X display. Like shown here : http://en.wikipedia.org/wiki/Head-up_display Basically I'd like to add some fluorescent green ASCII characters on top of everything else ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: how to add HUD like infos to X

  1. how to add HUD like infos to X

    Hi all in c.o.l.x.,

    I need to display some infos in a HUD (Head-Up Display) style on a X
    display.

    Like shown here :

    http://en.wikipedia.org/wiki/Head-up_display

    Basically I'd like to add some fluorescent green ASCII characters on
    top of
    everything else on the screen (maybe outlined by a 1-pixel black
    border).

    I'm using Debian / X / Gnome with 20 virtual desktops.

    Note that I don't do any 3D and I do *not* want to do that using
    fancy 3D extension.

    What would be lovely would be a tiny shell command that I could call
    like this :

    ....# hud "ABC 123" 150 100

    And it would display "ABC 123" in green at location 150 100.

    This could either appear on the 20 virtual desktops or just on
    the one I'm currently in (no preference about that, whatever is
    easier).

    I've got no idea where to start with, hence my question : where
    do I start ?

    Would it be easier to use my own bitmap font (I've got a special
    font I'd like to use for this HUD) or to use some X font facility ?
    (I just need monospaced ASCII chars, nothing fancy).

    In which language should this be coded ? (C ?)

    Any method names / hints / examples / pointers to open source
    programs doing something similar mostly welcome,

    Alex


    P.S : my C skills are quite rusty but I probably could still
    craft something.



  2. Re: how to add HUD like infos to X

    alexandre_paterson@yahoo.fr staggered into the Black Sun and said:
    > I need to display some [info] in a HUD (Head-Up Display) style on a X
    > display. Basically I'd like to add some fluorescent green ASCII
    > characters on top of everything else on the screen (maybe outlined by
    > a 1-pixel black border).


    osd_cat , part of the xosd package. Like so:

    echo "A Message" | osd_cat -p middle -c green -d 2 -s 1 -f \
    '-adobe-courier-bold-r-normal--24-240-75-75-m-150-iso8859-*' -

    > Note that I don't do any 3D and I do *not* want to do that using
    > [a] fancy 3D extension.


    All modern cards do 3D in one way or another. There is a movement in
    the graphics card hardware community to ditch 2D altogether and do
    everything using 3D.

    > And it would display "ABC 123" in green at location (150,100).


    osd_cat allows you to specify "top", "middle", and "bottom". You could
    hack it to allow you to specify coordinates if you want.

    > In which language should this be coded ? (C ?)


    osd_cat is in C. HTH, bonne chance, etc.,

    --
    "Cheer up, things could be worse." So I cheered up, and sure enough,
    things got worse.
    Matt G|There is no Darkness in Eternity/But only Light too dim for us to see

  3. Re: how to add HUD like infos to X

    In article ,
    wrote:
    > Hi all in c.o.l.x.,
    >
    > I need to display some infos in a HUD (Head-Up Display) style on a X
    > display.
    >
    > Like shown here :
    >
    > http://en.wikipedia.org/wiki/Head-up_display
    >
    > Basically I'd like to add some fluorescent green ASCII characters on
    > top of
    > everything else on the screen (maybe outlined by a 1-pixel black
    > border).
    >
    > I'm using Debian / X / Gnome with 20 virtual desktops.
    >
    > Note that I don't do any 3D and I do *not* want to do that using
    > fancy 3D extension.
    >
    > What would be lovely would be a tiny shell command that I could call
    > like this :
    >
    > ...# hud "ABC 123" 150 100
    >
    > And it would display "ABC 123" in green at location 150 100.


    What I did to get http://royalty.mine.nu:81/desktop.jpg was this:

    /export/X11/bin/get-random-background chooses an image, converts it to
    PNG & the right size, and writes it to /var/background/random.png
    It is called by cron periodically, or I can run it whenever I want.

    Then when I change virtual desktops, /export/X11/bin/label-desktop is
    invoked by my window manager, which runs it as

    /export/X11/bin/label-desktop "desktoplabel"

    You could add in location if you wanted.

    label-desktop does:

    echo "$desktoplabel" | pbmtext -font "$fontfile" | ppmtopgm | tee \
    "$overlay" | pnmdepth 255 | pgmedge | pgmedge | pnminvert > "$tempfile"

    pnmarith -minimum "$overlay" "$tempfile" | pnminvert > "$mask"

    pngtopnm /var/background/random.png | pnmcomp -xoff=-70 -yoff=1080 \
    -alpha="$mask" "$overlay" - "$dest"

    # those position values are experimentally determined, though I suppose
    # you could derive them

    feh --bg-scale "$dest"

    xrefresh
    (cleanup)

    See
    http://royalty.mine.nu:81/cgi-bin/ge...nd&button=View
    and
    http://royalty.mine.nu:81/cgi-bin/ge...op&button=View

    You'll need a font-conversion program once, to convert an X font for use
    with pbmtext. Looks like pbmtext wants a BDF, so you need something
    that outputs one of those. I used something user-hostile, years ago.
    Don't remember now what it was. Good thing I like the font.

    --
    -eben QebWenE01R@vTerYizUonI.nOetP http://royalty.mine.nu:81
    SCORPIO: Get ready for an unexpected trip when you fall screaming
    from an open window. Work a little harder on improving your low self
    esteem, you stupid freak. -- Weird Al, _Your Horoscope for Today_

  4. Re: how to add HUD like infos to X

    On Jan 1, 1:15 am, Dances With Crows wrote:
    ....
    > osd_cat , part of the xosd package. Like so:
    >
    > echo "A Message" | osd_cat -p middle -c green -d 2 -s 1 -f \
    > '-adobe-courier-bold-r-normal--24-240-75-75-m-150-iso8859-*' -


    Excellent!

    I did a quick "apt-get xosd-bin" and it's very close to what I need.


    > osd_cat allows you to specify "top", "middle", and "bottom". You could
    > hack it to allow you to specify coordinates if you want.


    Yup... I'll look into that.

    Now I really need two things : convert the bitmap font I plan to use
    so
    that I can use it under X and hack the source of osd_cat so I can
    specify
    exact (x,y) screen coordinates.

    Thanks a lot,

    Alex



  5. Re: how to add HUD like infos to X

    alexandre_paterson@yahoo.fr staggered into the Black Sun and said:
    > Dances With Crows wrote:
    >> echo "A Message" | osd_cat -p middle -c green -d 2 -s 1 -f \
    >> '-adobe-courier-bold-r-normal--24-240-75-75-m-150-iso8859-*' -

    > I did a quick "apt-get xosd-bin" and it's very close to what I need.
    >> osd_cat allows you to specify "top", "middle", and "bottom". You
    >> could hack it to allow you to specify coordinates if you want.

    > Yup... I'll look into that.


    "-p top -o 30 -i 50" moves the starting point of the text 30 pixels to
    the right and 50 pixels down from (0,0). This might be adequate for
    your needs and would mean you don't have to do any coding.

    > Now I really need two things : convert the bitmap font I plan to use
    > so that I can use it under X


    Which format is the font in? If it's BDF, you should be able to just
    bdftopcf it, put it in the appropriate directory, and either do ttmkfdir
    on that dir or xset -fp rehash . Maybe both. If it's not in BDF, you
    may need to convert it. Sorry, the last time I messed around with fonts
    at this low of a level was on an SE/30 with ResEdit. HTH anyway,

    --
    A project for developing fully automatically driven cars
    (not just those misnamed auto-pilots) has been improved by your
    explosive flatulence. --MegaHAL, trained on ASR
    Matt G|There is no Darkness in Eternity/But only Light too dim for us to see

  6. Re: how to add HUD like infos to X

    On Jan 1, 4:05 pm, Dances With Crows wrote:
    > alexandre_pater...@yahoo.fr staggered into the Black Sun and said:
    >
    > > Dances With Crows wrote:
    > >> echo "A Message" | osd_cat -p middle -c green -d 2 -s 1 -f \
    > >> '-adobe-courier-bold-r-normal--24-240-75-75-m-150-iso8859-*' -

    > > I did a quick "apt-get xosd-bin" and it's very close to what I need.
    > >> osd_cat allows you to specify "top", "middle", and "bottom". You
    > >> could hack it to allow you to specify coordinates if you want.

    > > Yup... I'll look into that.

    >
    > "-p top -o 30 -i 50" moves the starting point of the text 30 pixels to
    > the right and 50 pixels down from (0,0). This might be adequate for
    > your needs and would mean you don't have to do any coding.


    I found that out before reading your message, that was indeed
    perfectly adequate

    > > Now I really need two things : convert the bitmap font I plan to use
    > > so that I can use it under X

    >
    > Which format is the font in? If it's BDF, you should be able to just
    > bdftopcf it, put it in the appropriate directory, and either do ttmkfdir
    > on that dir or xset -fp rehash . Maybe both. If it's not in BDF, you
    > may need to convert it. Sorry, the last time I messed around with fonts
    > at this low of a level was on an SE/30 with ResEdit. HTH anyway,


    I really needed a specific tiny font, so I converted one pcf font
    back to bdf, then I used an bdf editor to manually edit the ASCII
    chars I needed and did exactly like you pointed out.

    It worked perfectly

    Thanks again,

    Alex


+ Reply to Thread