0

I have a C application the relies on Motif 2.2 (OpenMotif I believe) for its user interface. Problems are that:

  • the fonts are ugly
  • sometimes (depending on CentOS version) they don't display bold/italic in the default user interface
  • also the list of available fonts in a font selection popup is severely limited with respect to the fonts installed in the OS
  • also the list of available fonts in a font selection popup is different whether the program is running from a remote X session (ssh -X) or locally in a KDE window manager.

I've been reading pages such as https://www.freebsd.org/doc/handbook/x-fonts.html but I can't make heads or tails of this behavior.

In other words, how can I:

  • have the full list of fonts available in my program (both via remote X session and local window manager execution)
  • have consistent bold/italic behavior
  • have better looking font (aliasing maybe), but that's a minor point.
  • The fonts available are different from a remote ssh because the X server you are connecting to is the workstation you are ssh-ing from. – rbanffy Jul 11 '18 at 15:24
  • OK, but why so few fonts available in the popup in either direct or ssh mode, in respect to the total number of fonts available on the system ? – dargaud Jul 12 '18 at 20:23
2

Old versions of Motif do not support XFT (vector fonts), but only bitmap fonts. If bitmap font is missing for certain size or style (italic, bold), it will not be displayed.

If possible, you should switch to Motif 2.3, which supports anti-aliased fonts with XFT.

https://sourceforge.net/projects/motif/

Here are the instructions on how to use XFT fonts in your project. It is really easy and can be done even without modifying the source code, just by resource files.

http://www.motifzone.net/files/documents/Fonts_UTF-8_WhitePaperv6.pdf

https://sourceforge.net/p/cdesktopenv/wiki/FontsWithXFT/

The big plus of XFT font renderer is that it is much more robust in its font choice; if the particular font is not installed, it will try to pick something similar, and will always display a font. The core X font protocol will just flatly fail, if the specified font is not installed in the system.

  • Xft allows Freetype to be used via the Render extension, with all the niceties that brings (anti-aliasing etc.); but scaled fonts were supported before that (e.g. PostScript fonts). (That doesn’t change the main point of your answer though.) – Stephen Kitt Aug 21 '18 at 13:24
  • You are correct about that, thank you for your precision. – user1336365 Aug 22 '18 at 19:39
  • Thanks for answer. But I can't get the examples from the white paper to work as shown. strace shows they don't even try to open .Xresources – dargaud Sep 21 '18 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.