0

I don't know very much about how fonts "work", but I know in some fonts the beginning double quotation marks differ from the ending ones.

How does that work?

What exactly is different in those fonts?

Austin T French
  • 10,505
  • 27
  • 42
laggingreflex
  • 5,035
  • 17
  • 65
  • 96

2 Answers2

2

The font provides the shape of each character, “ , and ” but in general it is up to the editor to assign them correctly.

I would assume the editor keeps a boolean value somewhere for an open quotes, when you type " it checks the boolean and if its false, it does the upside down quote and then marks the boolean true. If true, it uses the regular quotes and then sets the value to false. This is pure speculation as it would provide a fairly low resource approach, but it is a guess.

Also, note that these are called "smart quotes" at least by Microsoft in Microsoft Word.

Austin T French
  • 10,505
  • 27
  • 42
1

The SmartyPants text processing library does "smart quotes", take a look at the SmartQuotes sub on line 267. This is probably a little simpler than how a text editor would do it, since it knows what the entire file looks like and doesn't need to edit it "live".

Roughly it is the same though, it replaces " characters with ’ and ‘ characters.

Douglas
  • 436
  • 1
  • 5
  • 14