typography of the apostrophe

Michel Fortin michel.fortin at michelf.com
Wed Oct 19 09:34:17 EDT 2005


John Gruber wrote:


> Some of the common cases like 'tis and 'em could be handled by a

> hard-coded list of special cases (which could be localized for other

> languages). SmartyPants doesn't do this, but it could. Joe Clark

> told me that Matt Mullenweg's quote smartener (built into

> WordPress?) has such a list of English terms.


Indeed, this is from the inside of wptexturize function in WordPress:

// This is a hack, look at this more later. It works pretty well
though.

$cockney = array("'tain't","'twere","'twas","'tis","'twill",
"'til","'bout","'nuff",'round","'cause");

$cockneyreplace = array("’tain’t","’twere",
"’twas","’tis","’twill","’til",
"’bout","’nuff","’round","’cause");

$curl = str_replace($cockney, $cockneyreplace, $curl);


Aristotle Pagaltzis wrote:


> Ah; well, SmartyPants (not Markdown) already deals very badly

> (ie not at all) with non-English typographic conventions like the

> German or French styles.


Be sure to read this [wikipedia article about quotation marks][1]. I
would never have thought there was so much quoting styles around the
world. Do we want SmartyPants to handle all that? and in what way?

[1]: http://en.wikipedia.org/wiki/Quotation_mark

- - -

I'm not sure what you mean when you say it adapts badly to French
typography. In French we quote text « this way » and sometime we use
English-style double quotes. Are you suggesting SmartyPants should
replace "double quotes" with « angle quotes » inside French text? The
French version of Microsoft Word does this and I always hated it.
It's a pain when you want mix languages. Not only that, but English-
style double quotes are often used for inner quotations in French,
pretty hard to do with Word.

I can say that on my Canadian multilingual Apple keyboard it's quite
easy to type angle quotes `«»` using opt-z and opt-x, and I can type
double quotes `"` with shift-period. I don't know much about other
keyboard layouts however.

If SmartyPants was to do something good for the French language, I
think it could replace <<this approximation of french quotes>> with
«something better». (I saw that in the comments on my weblog just
yesterday. People write this when they don't know how to type the
right characters.)

- - -

What could be done for French (and, to some extents, for other
languages) is a smart way to replace spaces with unbreakable spaces
where appropriate. French typography conventions usually include an
unbreakable space before the colon and on the inside of french quotes:

Jean a dit : « Il fait beau aujourd'hui ! »

Some people also put a space before a question marks, an exclamation
marks (as illustrated above), and a semi-colon. The space is also
used as a thousand separator in numerals:

1 436,12 - 1 000 = 436,12

The problem is that many people don't know what is an unbreakable
space and are writing normal, breakable spaces at each of these
places. I see that everywhere on French websites and it gives ugly
text wrapping.

I made a PHP script for the French part of my website that deals with
that. By default it doesn't add any space, it only *replaces* normal
spaces with unbreakable spaces where appropriate. This way it
shouldn't cause any harm to English or (hopefully) other languages.
You can also set it to impose a space or no space before and after
such marks.

The script can also replace spaces at other predefined places, let's
say "p. 12", "10 Kb", etc. Obviously, this list can be useful in any
language, and should be localizable.

I haven't published my script yet, but since we are at it, I'm open
to the idea it could merged with SmartyPants, if there is some
interest and John thinks it is appropriate. Otherwise I'll just
release it as a separate project, as planned initially.


Michel Fortin
michel.fortin at michelf.com
http://www.michelf.com/




More information about the Markdown-Discuss mailing list