Skip to content

Width of heading separators too great, causing wrapping in RStudio #320

@torfason

Description

@torfason

The width of the character, when printed in RStudio console, is greater than the standard single width, causing the message to be wrapped, and thus not very neat. This applies at least to cli_h1() and cli_rule() on a Mac. Below are two representations of some output.

  • First a screenshot, this shows the wrapping clearly:

Screenshot 2021-08-01 at 10 49 01

  • Then the actual text that got printed out, wrapped in code fences, compared to the same number of regular dashes. This seems to result in correct width when I view it in the browser:
── x ───────────────────────────────────────────────────────────────────────────
-- x ---------------------------------------------------------------------------

This is probably affected by the font that is in use, but I've tested it with Consolas, Inconsolata and Courier, and I always get this issue, making me thing that the glyph that is being used is not guaranteed to be standard-width even in fixed width fonts (although I found that it does work in some other fonts, such as Menlo). The issue seems closely related to #91.

I'm not sure what the most appropriate fix is. In the readme I don't see any emphasis on which typeface to use with cli, making me think that the intention is to be relatively agnostic about the typeface, but in this case it is quite sensitive to the font. If a better glyph is not available, should there be a prominent notice discussing which fonts have been tested and are supported?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions