Font selection dialog in Motif - Motif

This is a discussion on Font selection dialog in Motif - Motif ; I'm writing a motif app. The user must be able to select fonts for extrusion. Is there a font selection dialog in Motif? I'm currently using "XmFileSelectionBoxWidgetClass" and let the user to select the font files directly, which is not ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Font selection dialog in Motif

  1. Font selection dialog in Motif

    I'm writing a motif app. The user must be able to select fonts for
    extrusion. Is there a font selection dialog in Motif? I'm currently
    using "XmFileSelectionBoxWidgetClass" and let the user to select the
    font files directly, which is not very elegant solution.


  2. Re: Font selection dialog in Motif

    jupe wrote:
    > I'm writing a motif app. The user must be able to select fonts for
    > extrusion. Is there a font selection dialog in Motif? I'm currently
    > using "XmFileSelectionBoxWidgetClass" and let the user to select the
    > font files directly, which is not very elegant solution.
    >

    I have not found a dialog for this, but have written an application that
    you may find useful as a base to build your own. The source can be found
    at http://www.wideopenwest.com/~tgmeer/showfonts.c. The Makefile is
    stored as http://www.wideopenwest.com/~tgmeer/Makefile, and you will
    also need
    http://www.wideopenwest.com/~tgmeer/fallback.h for the complete program.
    A color selection application can be found at
    http://www.wideopenwest.com/~tgmeer/showcolors.c, using the same
    fallback.h and a slightly modified Makefile. Hope that this helps.
    --
    Gary Meerschaert
    Madison Heights, MI

    Don't give up on your dreams.
    Wait a bit and they'll give up on you
    and you can start again without all of that guilt.

    Gary.meerschaert@gmail.com

  3. Re: Font selection dialog in Motif


    Gary Meerschaert wrote:

    > I have not found a dialog for this, but have written an application that
    > you may find useful as a base to build your own.
    > [snip]


    Thanks Gary, for the source code! It would have taken me quite some
    time to get this implemented from scratch.


  4. Re: Font selection dialog in Motif


    "jupe" wrote in message
    news:1166949469.003227.74570@73g2000cwn.googlegrou ps.com...
    > I'm writing a motif app. The user must be able to select fonts for
    > extrusion. Is there a font selection dialog in Motif? I'm currently
    > using "XmFileSelectionBoxWidgetClass" and let the user to select the
    > font files directly, which is not very elegant solution.
    >

    If you are using Motif 2.2, there is an XmFontSelector widget,
    similar to the ICS XiFontSelectionBox.

    See FontS.h and FontSP.h
    --
    Fred L. Kleinschmidt
    Boeing Associate Technical Fellow
    Technical Architect, Software Reuse Project



  5. Re: Font selection dialog in Motif

    Gary Meerschaert wrote:
    >
    > I have not found a dialog for this, but have written an application that
    > you may find useful as a base to build your own.
    >


    That's a bit harsh hardcoding the path to xfd:

    "/usr/openwin/bin/xfd -fn '%s' &",

    If you change the line to:

    "xfd -fn '%s' &",

    it will use the PATH that the program inherits from the user's
    environment.

    (That's line 939 by the way).

    Just a thought...

  6. Re: Font selection dialog in Motif

    Chris Sorenson wrote:
    > Gary Meerschaert wrote:
    >> I have not found a dialog for this, but have written an application that
    >> you may find useful as a base to build your own.
    >>

    >
    > That's a bit harsh hardcoding the path to xfd:
    >
    > "/usr/openwin/bin/xfd -fn '%s' &",
    >
    > If you change the line to:
    >
    > "xfd -fn '%s' &",
    >
    > it will use the PATH that the program inherits from the user's
    > environment.
    >
    > (That's line 939 by the way).
    >
    > Just a thought...

    I agree that that would make it a bit more portable, but I have been
    burned by users with odd paths, and so try to always specifically call
    out programs. This also helps to avoid getting burned by Trojan horse
    programs or strange aliases. A pre-processor branch would work to
    specify different paths for different operating systems, like so:

    #ifdef __sun
    "/usr/openwin/bin/xfd -fn '%s' &",
    #else
    "/usr/X11/bin/xfd -fn '%s' &",
    #endif

    --
    Gary Meerschaert
    Madison Heights, MI

    Don't give up on your dreams.
    Wait a bit and they'll give up on you
    and you can start again without all of that guilt.

    Gary.meerschaert@gmail.com

+ Reply to Thread