Sketch plugin to automatically add typographical French conventions and give a nice touch to UIs.
Install
Download the latest release and open the file. You can also use package managers like Sketch Runner or Sketchpacks.
Feedbacks and bug reports are welcome.
What it does
It replaces some characters with their proper equivalents when you deselect a text layer.
Interaction with Mac OS – It works whether you enable smart substitutions at the system level (System preferences > Keyboard > Text tab) or not. It does more than Mac OS, which uses non-breakable spaces only for quotes.
A word of caution about narrow non-breakables spaces – Using this character (\u202F) is the convention, but it’s disabled by default because of a bug in Safari which renders it as a zero-width space. For instance if you copy & paste the text into Safari or use Craft and the Inspect feature in Invision, you will end up with invisible spaces. Also, some typefaces don’t support this space (some only in Sketch, some everywhere). That’s why there’s a setting to choose between normal or narrow spaces. Toggling it will also set the correct space for existing text layers in the current document.
French outside France – The plugin may work in some francophone contexts, with various limits. For instance Canadian French seems closer to english punctuation.
Character substitutions
Symbol | Status |
---|---|
From ” to « | ✔️ |
From double dash (–) to en-dash (–) | ✔️ |
Some fractions (½, ⅓, ¼ ) | ✔️ |
Ordinal suffixes: from 2e to 2ᵉ | ✔️ |
Ellipsis… | ✔️ |
From n° to № | ✔️ |
Insertion of non-breaking spaces
Symbol | Status |
---|---|
: | ✔️ |
« | ✔️ |
» | ✔️ |
! | ✔️ |
? | ✔️ |
; | ✔️ |
% | ✔️ |
En-dash (tiret demi-quadratin) | ✔️ |
Currency: $ € | ✔️ |
Hundreds, thousands, etc. |
What it doesn’t do
- Inserting non-breaking spaces in complex cases (eg. latitudes), listed here or there.
- Accents on capital letters. There’s no way to automatically tell SALE and SALÉ apart.
- Things that would be better handled with dedicated markup. For instance, support and rendering of fractions and exposants in Unicode is really spotty.
- Typos like double spaces.
Boring stuff
Build from source
Follow instructions for SKPM, the Sketch plugin toolchain : here and there
Tests
To check for errors in regex, in the plugin folder run:
npm test
It’s a shorcut for : build && run testRegex
Debuging
There’s a little debug mode, enabled by placed a file named “debug” in the assets folder. It results in logs in the console and in Sketch, when using the plugin.