GithubHelp home page GithubHelp logo

Non-portable font C about lowdown HOT 7 CLOSED

paravoid avatar paravoid commented on July 28, 2024
Non-portable font C

from lowdown.

Comments (7)

paravoid avatar paravoid commented on July 28, 2024

Debian bug #1043256 has even more context.

from lowdown.

kristapsdz avatar kristapsdz commented on July 28, 2024

Hi faidon. This is a tricky one... can you keep an eye on these commits and see if they work for you?

pandoc uses an .ie clause in the header and uses a custom V font, which doesn't play well with mandoc. My solution is to use B (bold font) for -tman and C (constant-width) for -tms by default. The user can override this with --nroff-code-font, which I've not yet finalised upon or documented. (Later commits wihle I ruminate.)

This, I think, sets some useful defaults while letting the user override the output, playing reasonably well with groff and mandoc.

from lowdown.

g-branden-robinson avatar g-branden-robinson commented on July 28, 2024

Thomas Dickey recently merged changes from me to his ncurses man pages that look like this.

.ie n .ds CW R
.el   \{
.ie \n(.g .ds CW CR
.el       .ds CW CW
.\}
.ft \*(CW

This defines a roff string named "CW". Translated to English, this means...

  • If formatting for a terminal (that is, "in nroff mode"), define the string as "R" (the roman style--always available).
  • Otherwise, we are formatting for a typesetter.
    • If the formatter claims groff compatibility, use the font name "CR" ("Courier roman").
    • Otherwise, use the font name "CW" ("constant-width", from Unix System III troff and later).
  • There has not been such a thing as BSD troff since before Networking Release/2 (1991), before the CSRG disbanded. (When there was, it was descended from Seventh Edition Unix (1979) troff--in other words, before Kernighan's changes for device independence, and it too did not support the "CW" font name.) In Net/2, BSD adopted groff.

This should cover all the bases.

  • Any version of groff will do the right thing.
  • mandoc will do the right thing because it always claims to be in nroff mode, and it understands the ds, ft, ie, and el requests, and string interpolation escape sequence syntax, well enough to cope.
  • AT&T troff, nowadays seen only in Documenter's Workbench (DWB) 3.3 troff (which I think only roff developers like me ever use) and proprietary Unices like Solaris and HP-UX (and sometimes not even those due to adoption of groff, as in Solaris 11) will do the right thing because that troff doesn't define the .g register, (by convention) claiming groff compatibility. The font name "CW" may not work on all AT&T troff output devices, but all of the ones supported by DWB 3.3 troff do support one, and the program issues a diagnostic if a font is unavailable.
  • Heirloom Doctools troff will emulate either groff or AT&T troff, as configured by the user.

The only aspect of this solution that I (and, I would guess, mandoc maintainer @ischwarze) don't like is the resort to conditional requests and string definitions, because as a general rule, employment of formatter requests in man pages makes them less portable. But there's really no way around this if one wants portability for this specific problem--the referenced pandoc issue explains why--without giving up the use of monospaced fonts altogether when typesetting man(7) pages, which people are generally not willing to do.

groff man(7)'s macros EX and EE are an alternative--if one is willing to embrace a Ninth Edition Unix (1986) extension--but are not fully suitable if one wants to use a monospaced font in a tbl(1) table, or "inline" amid proportional type. Details available on request.

from lowdown.

g-branden-robinson avatar g-branden-robinson commented on July 28, 2024

pandoc uses an .ie clause in the header and uses a custom V font, which doesn't play well with mandoc.

pandoc doesn't do this anymore.

from lowdown.

kristapsdz avatar kristapsdz commented on July 28, 2024

If pandoc's going to make a stand on using CR, I'll do the same as a default. However, I'll keep the option available for people to override (e.g., with bold for terminals).

from lowdown.

kristapsdz avatar kristapsdz commented on July 28, 2024

If the new support looks good to you, please close out this issue. Thanks!

from lowdown.

paravoid avatar paravoid commented on July 28, 2024

LGTM! @g-branden-robinson may have more thoughts as the expert, but I'll stay optimistic and close the issue.

from lowdown.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.