Underlined text in X - Xwindows

This is a discussion on Underlined text in X - Xwindows ; How do I underline text in X? Is it part of the font, like in Windows? (In Windows I set an "underlined" attribute and all text drawn in that font is underlined for me). -- / O O \ \_____/ ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Underlined text in X

  1. Underlined text in X


    How do I underline text in X? Is it part of the
    font, like in Windows?

    (In Windows I set an "underlined" attribute and
    all text drawn in that font is underlined for me).


    --
    <\___/>
    / O O \
    \_____/ FTB. For email, remove my socks.

    In science it often happens that scientists say, 'You know
    that's a really good argument; my position is mistaken,'
    and then they actually change their minds and you never
    hear that old view from them again. They really do it.
    It doesn't happen as often as it should, because scientists
    are human and change is sometimes painful. But it happens
    every day. I cannot recall the last time something like
    that happened in politics or religion.

    - Carl Sagan, 1987 CSICOP keynote address


  2. Re: Underlined text in X

    fungus wrote:
    >
    > How do I underline text in X? Is it part of the
    > font, like in Windows?
    >
    > (In Windows I set an "underlined" attribute and
    > all text drawn in that font is underlined for me).


    Xlib font handling is very primitive and doesn't give
    you any access to a lot of the font file information.

    You'll have to render the glyphs yourself on the client
    side, or use XDrawLine().

  3. Re: Underlined text in X

    Russell Shaw wrote:
    >
    > You'll have to render the glyphs yourself on the client
    > side, or use XDrawLine().


    :-(

    Not really the answer I wanted to hear.


    --
    <\___/>
    / O O \
    \_____/ FTB. For email, remove my socks.

    In science it often happens that scientists say, 'You know
    that's a really good argument; my position is mistaken,'
    and then they actually change their minds and you never
    hear that old view from them again. They really do it.
    It doesn't happen as often as it should, because scientists
    are human and change is sometimes painful. But it happens
    every day. I cannot recall the last time something like
    that happened in politics or religion.

    - Carl Sagan, 1987 CSICOP keynote address


  4. Re: Underlined text in X


    "fungus" wrote in message
    news:GotCg.9727$MA3.1459@news.ono.com...
    >
    > How do I underline text in X? Is it part of the
    > font, like in Windows?
    >
    > (In Windows I set an "underlined" attribute and
    > all text drawn in that font is underlined for me).


    It depends on what type of widget you are using. In a Label
    (or any widget that uses XmStrings), you can use RenderTables to
    specify what should be underlined.

    If you are drawing the text yourself (like in a DrawingArea), you
    can use XmStringDrawUnderline().

    --
    Fred L. Kleinschmidt
    Boeing Associate Technical Fellow
    Technical Architect, Software Reuse Project



  5. Re: Underlined text in X

    fungus wrote:
    > Russell Shaw wrote:
    >
    >> You'll have to render the glyphs yourself on the client
    >> side, or use XDrawLine().

    >
    > :-(
    >
    > Not really the answer I wanted to hear.


    STSF (http://stsf.sourceforge.net/about.html) has been unmaintained for a couple
    of years, but is being resurrected with a recent patch or two. It does server-side
    rendering and unicode. It might do what you want.

    http://developers.sun.com/dev/gadc/t...iuc22-stsf.pdf

  6. Re: Underlined text in X

    Russell Shaw wrote:
    > fungus wrote:
    >> Russell Shaw wrote:
    >>
    >>> You'll have to render the glyphs yourself on the client
    >>> side, or use XDrawLine().

    >>
    >> :-(
    >>

    >


    I think I can manage with XDrawLine. I found a pdf
    which says there are a couple of Atoms in the
    XFontStruct which tell me the thickness/offset of
    the line to draw. I didn't try it yet but it can't
    be too difficult...


    --
    <\___/>
    / O O \
    \_____/ FTB. For email, remove my socks.

    In science it often happens that scientists say, 'You know
    that's a really good argument; my position is mistaken,'
    and then they actually change their minds and you never
    hear that old view from them again. They really do it.
    It doesn't happen as often as it should, because scientists
    are human and change is sometimes painful. But it happens
    every day. I cannot recall the last time something like
    that happened in politics or religion.

    - Carl Sagan, 1987 CSICOP keynote address


+ Reply to Thread