Skip to content

Instantly share code, notes, and snippets.

@vancura
Last active May 26, 2021 17:46
Show Gist options
  • Save vancura/27fad9793840ceabae14 to your computer and use it in GitHub Desktop.
Save vancura/27fad9793840ceabae14 to your computer and use it in GitHub Desktop.

Source Code Typography

Presentation: http://www.slideshare.net/vancura/source-code-typography

Quotes

Dumb quotes (also known as straight quotes) are straight and vertical. Proper typography never uses straight quotes. They are left over from the age of typewriters, and their only modern use is for coding.

Smart quotes (also known as curly quotes, typographer’s quotes or proper quotation marks) are either curved or sloped.

In American English, single quotes are used for quotes inside of quotes. In British English, this is usually reversed.

(Opening Single Quote)
  • Mac: option ]
  • Windows: alt + 0 1 4 5
  • \u2018
(Closing Single Quote & Apostrophe)
  • Mac: option shift + ]
  • Windows: alt + 0 1 4 6
  • \u2019
“ (Opening Double Quote)
  • Mac: option [
  • Windows: alt + 0 1 4 7
  • \u201C
” (Closing Double Quote)
  • Mac: option shift [
  • Windows: alt + 0 1 4 8
  • \u201D
Examples

“For once, maybe someone will call me ‘sir’ without adding, ‘you’re making a scene.’”

“You’re smart!”


Dashes

– (En Dash)
  • Mac: option -
  • Windows: alt + 0 1 5 0
  • \u2013
When should I use an en dash?

An unspaced en dash can be used in place of the word “through” when indicating a range of values, such as numbers, times and dates. For example, July 5th–9th.

It’s also used to show relationships between two things, such as a Boston–London flight.

Examples

May 28–June 4

It takes 2 to lie – one to lie and one to listen.

Useful Typographic Characters

… (Ellipsis)
  • Mac: option ;
  • Windows: alt + 0 1 3 3
  • \u2026
• (Bullet)
  • Mac: option 8
  • Windows: alt + 0 1 4 9
  • \u2022
← (Left arrow)
  • \u2190
→ (Right arrow)
  • \u2192
↔ (Left-Right Arrow)
  • \u2194
© (Copyright)
  • Mac: option g
  • Windows: alt + 0 1 6 9
  • \u00A9
™ (Trademark)
  • Mac: option 2
  • Windows: alt + 0 1 5 3
  • \u2122
° (Degree)
  • Mac: option shift 8
  • Windows: alt + 0 1 7 6
  • \u00B0
½ (One Half)
  • \u00BD
¼ (One Quarter)
  • \u00BC
⅓ (One Third)
  • \u2153
± (Plus/Minus Sign)
  • Mac: option shift =
  • Windows: alt + 0 1 7 7
  • \u00B1
× (Multiplication Sign)
  • \u00D7

Links

@vancura
Copy link
Author

vancura commented Jun 22, 2018

@kaishin: Thanks! That was an error. Fixed. And sorry, I haven't seen your comment before (yay for GitHub notifications).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment