Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default fonts in img formatter are backwards #928

Closed
Anteru opened this issue Aug 31, 2019 · 7 comments
Closed

Default fonts in img formatter are backwards #928

Anteru opened this issue Aug 31, 2019 · 7 comments
Assignees
Labels
T-bug type: a bug X-imported imported from Bitbucket

Comments

@Anteru
Copy link
Collaborator

Anteru commented Aug 31, 2019

(Original issue 1221 created by scolby33 on 2016-03-16T02:33:26.073910+00:00)

In the documentation, it is stated that the default font for the img formatter is '“Bitstream Vera Sans Mono” on Windows, Courier New on *nix.'

However, at lines 48-49 of pygments-main/pygments/formatters/img.py we have:

#!python

DEFAULT_FONT_NAME_NIX = 'Bitstream Vera Sans Mono'
DEFAULT_FONT_NAME_WIN = 'Courier New'

Bitstream Vera Sans Mono is not even shipped on OS X.

I think this is a duplicate of issue #868, but that has languished for two years now and, since this is such a simple fix, I figured I would bring it to attention again.

@Anteru Anteru added T-bug type: a bug X-imported imported from Bitbucket trivial labels Aug 31, 2019
@Anteru
Copy link
Collaborator Author

Anteru commented Aug 31, 2019

(Original comment by scolby33 on 2016-03-16T02:44:49.622307+00:00)

See pull request #569 for my suggested solution.

@Anteru
Copy link
Collaborator Author

Anteru commented Aug 31, 2019

(Original comment by birkenfeld on 2016-03-16T06:00:52.322608+00:00)

It is definitely intended that Vera is used on Unix, and Courier New on Windows; the documentation is wrong in this case.

As for Mac OS X, #868 seems to imply that font selection is even more broken, and it needs a more comprehensive fix.

@Anteru
Copy link
Collaborator Author

Anteru commented Aug 31, 2019

(Original comment by scolby33 on 2016-03-16T06:03:12.667295+00:00)

In that case, I believe a third case for font selection should be added, since by default Vera will not work on OS X and the package is broken out of the box.

@Anteru
Copy link
Collaborator Author

Anteru commented Aug 31, 2019

(Original comment by birkenfeld on 2016-03-16T06:17:09.394125+00:00)

Sure. Which font is the best default nowadays? Menlo?

@Anteru
Copy link
Collaborator Author

Anteru commented Aug 31, 2019

(Original comment by birkenfeld on 2016-03-16T06:18:27.042323+00:00)

(Should also change the Unix default to DejaVu Sans Mono since that is what most distributions are shipping now instead of Vera.)

@Anteru
Copy link
Collaborator Author

Anteru commented Aug 31, 2019

(Original comment by scolby33 on 2016-03-16T06:45:49.619696+00:00)

From what I can tell, my default installation came with these monospaced fonts:

  • Andale Mono
  • Courier
  • Courier New
  • Menlo
  • Monaco

Courier lacks italics (it has obliques though). The default font used in Terminal is Menlo, which comes with Regular, Italic, Bold, and Bold Italic.

@anshks anshks mentioned this issue Oct 24, 2019
@Anteru
Copy link
Collaborator Author

Anteru commented Oct 28, 2019

87dc697 changes it to Deja Vu Sans ... now I need to update the docs, and then we can resolve this. For Mac OS, I assume you'd want Menlo?

@Anteru Anteru self-assigned this Oct 28, 2019
@Anteru Anteru closed this as completed in 0db18c8 Nov 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug type: a bug X-imported imported from Bitbucket
Projects
None yet
Development

No branches or pull requests

1 participant