An open API service indexing awesome lists of open source software.

https://github.com/aloglu/smart-typography

Smart Typography is a Firefox extension that helps turn punctuation marks into proper ones
https://github.com/aloglu/smart-typography

browser-extension firefox firefox-addon firefox-extension typography

Last synced: 25 days ago
JSON representation

Smart Typography is a Firefox extension that helps turn punctuation marks into proper ones

Awesome Lists containing this project

README

          

# Smart Typography

Smart Typography is a Firefox extension that quietly upgrades every text field with professional punctuation. It turns straight quotes into curly ones as you type, swaps ASCII shortcuts (like `->` or `...`) for their typographic counterparts, and even formats fractions with true glyphs or stacked numerators/denominators. A toolbar popup lets you pause the extension globally or toggle it per-site in one click.

## Features
- Replaces straight quotation marks with smart single (`‘ ’`) and double (`“ ”`) quotes in real time, including nested contexts.
- Converts common punctuation shortcuts into typographically correct characters without touching existing text.
- Detects typed fractions (e.g., `3/4`, `11/16`) and replaces them with dedicated Unicode glyphs or a superscript/subscript stack.
- Provides a popup UI with global and per-site switches plus live status labels for the active tab.
- Offers an escape hatch: prefix a quote with `\` to insert the literal straight character.
- Draws a colored line on the extension icon so you can see whether Smart Typography is active on the current tab.

## Automatic replacements

| Typed sequence | Replacement | Notes |
| --- | --- | --- |
| `'` | `‘` or `’` | Chooses opening/closing form based on context. |
| `"` | `“` or `”` | Tracks nested double quotes to decide when to close. |
| `...` | `…` | Ellipsis, inserted after you finish typing the dots. |
| `--` | `—` | Em dash. |
| `<-` | `←` | Left arrow. |
| `->` | `→` | Right arrow. |
| `<=` | `≤` | Less-than or equal. |
| `>=` | `≥` | Greater-than or equal. |
| `/=` | `≠` | Not equal. |
| `<<` | `«` | Left angle quotes / guillemets. |
| `>>` | `»` | Right angle quotes / guillemets. |

## Fraction support

The content script watches for `number/number` patterns immediately before the caret:

- Built-in glyphs: `1/2 → ½`, `1/3 → ⅓`, `2/3 → ⅔`, `1/4 → ¼`, `3/4 → ¾`, `1/5 → ⅕`, `2/5 → ⅖`, `3/5 → ⅗`, `4/5 → ⅘`, `1/6 → ⅙`, `5/6 → ⅚`, `1/7 → ⅐`, `1/8 → ⅛`, `3/8 → ⅜`, `5/8 → ⅝`, `7/8 → ⅞`, `1/9 → ⅑`, `1/10 → ⅒`.
- All other fractions fall back to stacked numerators and denominators using superscripts and subscripts, such as `11/16 → ¹¹⁄₁₆`.

## Usage

### Installation
You can install it like a regular Firefox extension by clicking [here](https://github.com/aloglu/smart-typography/releases/latest/download/Smart.Typography.xpi). The file is signed by Mozilla and should work in any modern version of Firefox without additional effort.

### Popup controls
- **Global switch** toggles Smart Typography everywhere and updates the badge/label immediately.
- **Site switch** overrides just the active origin (handy for CMS editors or online IDEs).
- Status text shows whether the current site is on, forced on, or disabled.

## License

Released under the [MIT License](https://github.com/aloglu/smart-typography/blob/main/LICENSE).