Questions tagged [monospace]

Monospace or "fixed pitch" fonts have the same width for each character. They are most often used for code and for situations where a fixed line length is required.

A monospaced font, also called a fixed-pitch, fixed-width or non-proportional font, is a font whose letters and characters each occupy the same amount of horizontal space. This contrasts with variable-width fonts, where different characters have different widths.

113 questions
76
votes
2 answers

"font-family: monospace, monospace"

In normalize.css, the monospace font rules contain font-family: monospace, monospace; Is this different to font-family: monospace; ? There must be a reason for using that. Maybe it's a workaround for the behaviour of some browsers?
Artisan72
  • 3,052
  • 3
  • 23
  • 30
48
votes
2 answers

Specify monospace font in `menu`

Language: R. Question: Can I specify fixed width font for the menu(..,graphics=T) function? Explanation: I recently asked this question on how to have a user select a row of a data frame interactively: df <-…
mathematical.coffee
  • 55,977
  • 11
  • 154
  • 194
37
votes
8 answers

How to get monospaced numbers in UILabel on iOS 9

At WWDC 2015, there was a session about the new “San Francisco” system font in iOS 9. It uses proportional number rendering instead of monospaced numbers by default when linked against the iOS 9 SDK. There is a convenient initializer on NSFont…
Samuel
  • 679
  • 1
  • 7
  • 13
18
votes
1 answer

Monospace tabular numbers in Android TextViews

I have a custom font which has variable-width numeric glyphs by default, and I would like to use the font's monospace tabular numbers feature in an Android TextView so that numbers align vertically. That is, change something like this: to something…
laalto
  • 150,114
  • 66
  • 286
  • 303
18
votes
3 answers

How do I get all installed fixed-width fonts?

I'm wondering if there are any simple ways to get a list of all fixed-width (monospaced) fonts installed on a user's system in C#? I'm using .net 3.5 so have access to the WPF System.Windows.Media namespace and LINQ to get font information, but I'm…
Nidonocu
  • 12,476
  • 7
  • 42
  • 43
17
votes
4 answers

UIFont.monospacedDigitSystemFontOfSize() not really monospaced?

I wanted to use SF's monospaced digits font to display an integer number in a text field by changing its font as follows: textField.font = UIFont.monospacedDigitSystemFont(textField.font!.pointSize, weight: UIFont.Weight.semibold) But if I set the…
YourMJK
  • 1,429
  • 1
  • 11
  • 22
16
votes
3 answers

Can you specify tabular lining figures for webfonts?

Since it's possible to specify lining and oldstyle figures I'm hoping there's browser support for tabular numerals with webfonts? Left: default numerals Right: desired tabular numerals (notice monospaced) Font: Brandon Grotesque Related: Is there…
Mark Fox
  • 8,694
  • 9
  • 53
  • 75
15
votes
3 answers

How to display special unicode characters using monospace font in HTML with preserved character width

I'm using pre element to display some text including special unicode characters (⚡ ⚑ ▶ ◀ ⁋). I noticed that browsers render these special characters wider than regular ones, occupying more space horizontally. This can be easily seen here:…
ku1ik
  • 1,848
  • 22
  • 20
15
votes
3 answers

Backticks in git commit message

I did git commit -m "Changed function name `sum` to `sum_list`" My intention with the backticks was that sum and sum_list be typed in a monospace font when someone views the commit message in GitHub or the like. It works like this in other…
NerdOnTour
  • 634
  • 4
  • 15
14
votes
1 answer

How to set a Tkinter widget to a monospaced, platform independent font?

It's said here in the section Standard Fonts: Particularly for more-or-less standard user interface elements, each platform defines specific fonts that should be used. Tk encapsulates many of these into a standard set of fonts that are always…
z33k
  • 3,280
  • 6
  • 24
  • 38
14
votes
2 answers

Monospaced font/symbols for JTextPane

I want to build a console-like output using JTextPane. Therefore I am using a monospaced font: textpane.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12)); This works fine for all kind of alphanum (like a-z, 0-9 etc.) characters, but when it comes…
user28061
  • 354
  • 1
  • 4
  • 14
11
votes
1 answer

What's happened to Monospace in Android Lollipop?

I have a style to use "monospace" in my Android App: