URL: <https://savannah.gnu.org/bugs/?67952>
Summary: Proposed: x command to set font directory
Group: GNU roff
Submitter: None
Submitted: Sat 24 Jan 2026 03:50:49 PM UTC
Category: Driver - others/general
Severity: 3 - Normal
Item Group: Feature change
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Unlocked
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Sat 24 Jan 2026 03:50:49 PM UTC By: Anonymous
Please Cc onf disroot org.
After brief discussion with Branden, I am submitting a proposal to add a type
of 'x' intermediate output command that sets the font directory to use
(currently inferred from GROFF_FONT_PATH or flag -F if it differs from the
default settings). The idea is the same as for device name, which is also
passed by troff to the driver. The change should be fairly trivial to
implement (at least it was for neatroff) and would save users from having to
specify -F for troff and the driver separately when they use non-default font
path and need to construct their own pipeline. That's arguably a corner case;
its value is more obvious for troffs that don't have a front-end like
groff(1). I am proposing it for groff because I believe it would be useful to
standardize this behavior.
It remains to be decided whether -F for drivers is retained or not. The
argument to drop it is slightly reduced complexity; the arguments to not drop
it are 1) backwards compatibility, 2) keeping the drivers compatible with
non-groff troffs, 3) the ability to use intermediate output generated on one
system on a different system with different font path (arguably a very niche
use case). If -F is retained, its value should serve only as a fallback in
case the intermediate output either doesn't contain the font path or it cannot
be opened.
Ideally the font path specified by the command would be absolute to ensure it
remains valid even if PWD changes between running troff and the driver (e.g.
when the intermediate output is saved to a file and then passed to the driver
from the file).
The most natural semantics (imo) for this x command are
x F path\n
or, taking groff's use of search paths in mind,
x F path1:path2...\n
The use of search paths would obviously complicate the fallback logic
described above somewhat as it is not clear what "font path cannot be opened"
means if there are multiple of them. One of them cannot be opened? All of them
cannot be opened? IMO search paths shouldn't have made their way into groff in
the first place as it creates needless complexity and doesn't seem to really
solve anything.
However, the semantics proposed above conflict with groff's use of x F for
diagnostic purposes in grohtml:
xF name⟨line-break⟩
(Filename control command)
Use name as the intended name for the current file in error
reports. This is useful for remembering the original file name
when groff uses an internal piping mechanism. The input file is
not changed by this command. This command is a groff extension.
So either we would need to use a different name than F (D?) or the current x F
would need to be renamed. Given that this command seems to be used only
internally and only for diagnostics, I believe renaming it would be the best
course of action as it shouldn't break anything and using F for the proposed x
command would make its semantics obvious at a glance.
If this proposal is not adopted, I propose to at least rename the current x F
command in groff to something else so that x F can be used by other troffs for
this purpose without clashing with groff's intermediate output extensions. As
noted above, renaming it shouldn't break anything.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?67952>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
