Styling of PEPs

I regret bringing up typography!

True, although a poor man’s proxy is matching x-heights – e.g. through Test page for estimating the relative x-height (aspect ratio) of a font, using JavaScript

From this list of python sites (including pythondotorg)

body text

  • Source Sans: www
  • Arial: bugs, buildbot, docs, packaging, speed, wiki
  • Segoe UI: devguide, mail
  • proxima-nova: status

monospaced

  • Consolas: www, buildbot, devguide, mail, status
  • monospace: bugs, docs, packaging
  • Inconsolata: speed (doesn’t include the font as a stylesheet, so falls back to monspace)
  • Courier: wiki

system font stack (or similar)

  • devguide (through furo)
  • mail

The point here is that there is no real consistency – and the style is already a break from pythondotorg, so I don’t think we should be constrained by that – although it should be a consideration. At one point in this thread I argued that pythondotorg should probably be more of an advertising site for the project/language/charity, and peps.python.org should be purely focussed on hosting PEPs. This might lead to different typographic choices between the two sites. I also think now is the perfect time to switch the typefaces (if we choose to), as no-one is really used to the new design, and so there will be fewer complaints.

Not actually possible in reST without significant hacks :wink: (Docutils doesn’t allow nested markup, that’s on my to do list to look at)

The full list of characters used in the PEPs repo is below in a details block. I was surprised by how large the list was, to be honest. A large number are in PEP 672 (unicode security), PEP 536 (there’s a zalgo block on line 171), PEP 538 (coercing the C locale to UTF-8).

Characters in PEPs and verification script (click to expand)
from pathlib import Path

characters = set()
for path in Path(".").glob("pep-????.*"):
    print(path)
    characters.update(*path.read_text(encoding="utf-8"))

assert characters == frozenset({
    # ASCII / C0 Controls and Basic Latin
    "\t", "\n", "\f",
    " ", "!", '"', "#", "$", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/",
    "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", "=", ">", "?",
    "@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O",
    "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "\\", "]", "^", "_",
    "`", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o",
    "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "{", "|", "}", "~",
    # Latin-1 Punctuation and Symbols
    "\xa0", "¢", "§", "®",
    "°", "±", "µ", "½",
    "Å", "É",
    "×", "Ø", "ß",
    "à", "á", "ä", "å", "ç", "è", "é", "í", "ï",
    "ñ", "ó", "ö", "ø", "ú", "ü",
    # Latin Extended-A
    "č", "ğ", "Ł", "ň", "š", "ż",
    # Latin Extended-B
    "ƛ", "ƴ",
    # Spacing Modifier Letters
    "ʻ",
    # Combining Diacritical Marks
    "̀", "̂", "̃", "̄", "̆", "̇", "̉", "̊", "̍", "̏", "̒", "̓", "̔", "̗", "̘", "̙",
    "̛", "̜", "̝", "̞", "̟", "̡", "̣", "̤", "̦", "̧", "̨", "̩", "̪", "̫", "̬", "̭",
    "̮", "̯", "̲", "̴", "̷", "̹", "̺", "̻", "̼", "̽", "̾", "̿", "ͅ", "͆", "͇",
    "͈", "͉", "͍", "͎", "͏", "͐", "͑", "͒", "͓", "͔", "͗", "͙", "͚", "͜", "͠",
    "͡", "͢", "ͤ", "ͥ", "ͧ", "ͨ", "ͩ", "ͮ", "ͯ",
    # Greek and Coptic
    "Β", "ά", "α", "β", "γ", "ε", "ο", "π", "τ",
    # Cyrillic
    "В", "Д", "Н", "С", "а", "б", "в", "е", "и", "к", "л", "м", "н", "о", "р", "с",
    "т", "у", "ц", "я", "ѕ",
    # Hebrew
    "א", "ך", "ע", "ר",
    # Arabic
    "ة", "ق", "م", "ي", "٥",
    # N'Ko
    "߅",
    # Bengali
    "৪",
    # Oriya
    "୨",
    # Tamil
    "௫",
    # Latin Extended Additional
    "Ḛ", "Ṯ",
    # Greek Extended
    "ἤ",
    # General Punctuation
    "\u200b", "\u200f", "–", "—", "‘", "’", "“", "”", "…",
    # Superscripts and Subscripts
    "ⁿ",
    # Letterlike Symbols
    "ℂ", "ℌ", "ℕ", "ℙ", "℮",
    # Arrows
    "→",
    # Mathematical operators
    "∀", "∃", "∅", "⊗", "⋅",
    # Miscellaneous Technical
    "⌁", "⌚",
    # Enclosed Alphanumerics
    "⒯",
    # Box Drawing
    "─", "└",
    # Miscellaneous Symbols
    "☂", "☃", "☺", "♨", "⚛",
    # Dingbats
    "✎", "✒", "✓",
    # Miscellaneous Mathematical Symbols B
    "⧟",
    # Miscellaneous Symbols And Arrows
    "⬛",
    # Katakana
    "ス", "パ", "ム",
    # CJK Unified Ideographs
    "十", "大", "学", "屆", "年", "日", "曜", "月", "槀", "櫰", "波", "激", "火", "筑", "粹", "羔", "鈩",
    # Alphabetic Presentation Forms
    "fi",
    # Halfwidth And Fullwidth Forms
    ">",
    # Fullwidth Latin
    "n",
    # Halfwidth And Fullwidth Forms
    "¥",
    # Specials
    "�",
    # Mathematical Alphanumeric Symbols
    "𝐧",
    # Mathematical Alphanumeric Symbols
    "𝘯",
    # Miscellaneous Symbols And Pictographs
    "🐱"
})

I agree. Equally though, macOS/OS X fundamentally look and feel different to Windows or Linux, and the cognative dissonance might be greater in an unfamiliar typeface than in different typefaces cross-platform.


I do have a personal preference for system fonts, partially due to the extra simplicitly of using built-in tools, extra familiarity, and not having to make a choice over font display. The reason I am hesitant though is that especially for PEPs, we should really make sure that a single line of literal/code display holds at least 80 characters, and I don’t know how we can guarantee that in the best way. (We could increase the margins of course, but there will always be someone with a really esoteric setup.)

I appreciate this is a lot of fence sitting! I’ll wait a day or two to allow anyone who wants to to voice an opinion, but otherwise I’ll have a look and propose a concrete suggestion as a PR to the peps repo.

A

1 Like