-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct typographic spaces for French (a few tweaks needed) #36
Comments
Thanks, no need for a PR. Do you have any quotes/references for the specific rules? (Not being French, I've looked around on the net and as you wrote, recommendations and practices seem to vary a bit. I'd like to document the reasons for various choices.) |
@fvsch, do you have any quotes/references for these specific rules? I'd like to document the reason for the choices made in the code. |
Sorry for replying late. From the works of the late Jean-Pierre Lacroux, French typographer (as well as author and cartoonist):
And: http://www.orthotypographie.fr/volume-I/echelle-extrait.html#Espace Apparently Wikipédia mentions the French usage of thin space before most high/double punctuation marks, and full space (“espace-mot”) before the colon: https://fr.wikipedia.org/wiki/Comparatif_des_diff%C3%A9rents_codes_typographiques_francophones
And it notes that the colon is not treated separately in Switzerland (for French):
Also, it notes that in Québec the thin space before punctuation marks might be replaced by no space at all, especially in settings when thin spaces are not available:
(In France, my observation is that if thin spaces are not available, especially online, a full non-breaking space will be used.) |
Thank you! (That's a great site, BTW - I think I'll have to start collecting various online typographic references.) |
This is the setting that's breaking my paragraphs. I have the following extract from the Typeset.js example:
This is adding a non-breaking space before the colon:
Surely this should be off by default as it does not need to happen on the English language? |
@mikerockett The setting is off by default. Please open a separate issue to track your situation and provide some additional information about your environment. |
@mundschenk-at It's on, according to the class: /**
* Enables/disables extra whitespace before certain punction marks, as is the French custom.
*
* @param bool $on Optional. Default true.
*/
function set_french_punctuation_spacing( $on = true ) {
$this->settings->set_french_punctuation_spacing( $on );
} Considering that, is it still worth opening a new issue? |
Yes. It's off by default in wp-Typography. (It looks like you'd like to use php-typography as standalone library. Setting your own defaults is strongly encouraged in such a situation.) |
I see - that makes sense indeed. I didn't look at the WP-defaults. I have started integrating the standalone library as a replacement to the original by Kingdesk. |
Although it’s hard to find precise recommendations for correct spacing around punctuation in French. After reading a lot about “orthotypographie”, I have gathered that the exact rules are:
:
). (Technically this space should not vary when usingtext-align:justify
, but that’s a browser limitation that wp-typography can do nothing about.)»;?!
.«
.The meaning of those rules is that a little bit of space around certain punctuation characters is considered more readable (I’ll note that it’s also used by some English language publishers for
;?!
, though they tend to prefer thin spaces over the narrow space), and that space should not be too big (not a full space), except for the colon because instead of closing a proposition (like the other characters do) it creates a bridge from one proposition to the next (hence the full space). That’s the rationale I’ve read anyway. :)Other punctuation signs don’t have extra space, or use regular breaking spaces, and don't concern wp-typography.
Also some publishers, typographers, graphic designers etc. may tweak these rules a bit or a lot, which is a given in any publishing and graphic design environment. For instance I know a typographer who uses
«»
with hair spaces instead of narrow spaces, and in graphic design many use “English” quotes (“”
) for posters or book covers, though novels tend to keep the«»
with narrow non-breaking spaces.Changes that would be needed in php-typography to enable those rules:
Use
PHP_Typography::chr['noBreakNarrowSpace']
fordoubleGuillemetsFrench
quote style:https://github.com/mundschenk-at/wp-typography/blob/master/php-typography/class-php-typography.php#L301
Separate the spacing for the colon (
:
) fromPHP_Typography::regex['frenchPunctuationSpacing']
:https://github.com/mundschenk-at/wp-typography/blob/master/php-typography/class-php-typography.php#L1091
and https://github.com/mundschenk-at/wp-typography/blob/master/php-typography/class-php-typography.php#L2700
With those changes, if users activate the narrow no-break spaces, they should get perfect French punctuation spacing with supporting browsers and fonts.
PS: the modified code extracts are for illustrating how the rules could be implemented. I haven’t actually tested them or ran this code. I could perhaps make a PR but that would be in 10 days at best.
The text was updated successfully, but these errors were encountered: