Skip to content

Fixes #111: Update CLM to handle fonts and resources better.

Raymond Toy requested to merge issue-111-fixes-for-motifd-clm into master

Patch 1: Add support for fallback resources in RUN-MOTIF-APPLICATION

At the public API level, it's a new keyword to RUN-MOTIF-APPLICATION. At the protocol level, this is one extra object during the greeting.

Internally, this modifies message_read_string_table so that the resulting StringTable has a NULL-terminated list of strings. This seemed simpler than adding a whole new data transmission type for this purpose.

Patch 2: Expunge all FontList usage, replace with CompoundString tags.

20 or so Widget constructor calls included a :FONT-LIST initarg, which had the effect of superseding Xt-based configuration mechanisms (e.g., X resource files). This turns out to have been unnecessary, since Motif's 1XmString` type includes tags whose purpose is to direct text styling.

This commit simply rips out all Font Lists while ensuring that every place a FontList was used instead uses a CompoundString with an appropriate tag, one of "header" or "italic".

Given those tags, it becomes possible to achieve all the previous styling effects just using Xt/Motif machinery, e.g. by putting something like one or the other of the below examples into the user's ~/.Xdefaults or an app-defaults file named "Lisp".

(A subseqent commit will arrange for these defaults to get set as fallback resources when the GUI starts up, so that no external resources file will be needed, and so that users who prefer to configure things from within Lisp can do so.)

Sample .Xdefaults content; use one or the other, not both.

!! Core X11 Fonts
!!
!! First, setup the defaults for the RenderTable.
!!
Lisp*renderTable.fontName: -adobe-helvetica-medium-r-normal--*-120-75-*
Lisp*renderTable.fontType: FONT_IS_FONT
!!
!! Define a rendition called "header", and specify its font.
!!
Lisp*header.fontName:  -adobe-helvetica-bold-r-normal--*-120-75-*
Lisp*header.fontType: FONT_IS_FONT
!!
!! Define a rendition called "italic", and specify its font.
!!
Lisp*italic.fontName: -adobe-helvetica-medium-o-normal--*-120-75-*
Lisp*italic.fontType: FONT_IS_FONT
!!
!! Add these renditions to the RenderTable
!!
!Lisp*renderTable:  header italic
!! EOF

Patch 3: Unify naming of Core X11 and Xft2 fonts in CLM, use in INTERFACE

The substance of this commit is the new file, src/motif/lisp/fonts.lisp. This file contains a couple of trivial models of Core X11 and fontconfig names, heuristics for telling them apart, a convention for deciding the ambiguous cases, and a utility that uses that convention to generate corresponding resource strings for OpenMotif. For the moment the only exported interfaces are GENERATE-HEURISTICATED-FONT-RESOURCES and a user-customizable *AMBIGUOUS-FONT-DISPOSITION*, exported in 1src/motif/lisp/initial.lisp. src/tools/clmcom.lispis adjusted to includefonts.lisp`.

src/interface/interface.lisp take advantage of the new font naming functionality, by calling GENERATE-HEURISTICATED-FONT-RESOURCES with some tag names and new user-customizable font name variables to create fallback resources. src/interface/initial.lisp exports those font name variables.

Merge request reports