=== Typography Stylist === Contributors: matthewneilcowan Tags: typography, opentype, fonts, ligatures, glyphs Requires at least: 5.8 Tested up to: 6.9.4 Stable tag: 2.0.1 Requires PHP: 7.4 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Unlock OpenType features like ligatures, swashes, and stylistic sets in the WordPress block editor with a glyphs panel and typography controls. == Description == Typography Stylist provides advanced typography controls for WordPress, including a glyphs panel! This plugin allows you to apply OpenType features directly in the block editor, and access glyphs and ligatures hidden within fonts. Additionally, set properties like letter spacing, line-height, responsive sizing, font-weight, and more in the editor, so you can get exactly the look you want from your typefaces. Manage fonts from the settings page, either by uploading webfont kits or adding Adobe Typekit embeds. Fonts load intelligently only when they are used. With support for ligatures, stylistic sets, swashes, and alternates, you can create elegant headlines and premium typography effects with ease. Accessibility features ensure that your styled text remains readable by screen readers and assistive technologies: breaking up strings of text with the inline span elements necessary to apply complex features can cause screen readers to read words in fragments or skip them entirely. The plugin includes a custom Typography Stylist block that provides a clean, unbroken set of text to maintain screen reader compatibility while allowing for complex typography to be presented visually. When applying features to partial words in standard heading blocks, the plugin detects potential accessibility issues and provides a warning with options to convert to the Typography Stylist block for maximum accessibility, or to apply the features anyway. When the block cannot be converted (e.g., inside a locked pattern), the conversion option is hidden and the warning adjusts accordingly. The warning can be disabled entirely in Settings → Typography Stylist → Accessibility. = Key Features = * **Custom Typography Stylist Block**: Create complex typography with maximum accessibility using the dedicated block. Screen readers can "stumble" over complex inline formatting required to display specific ligatures and alternates. This block preserves the document outline while providing styled text for visual users. * **Inline Text Selection**: Highlight any text within richtext blocks like headings, and apply basic typography features quickly. A warning will pop up if your selection breaks words and causes accessibility issues, with options to convert to the Custom Typography Stylist Block for maximum accessibility or apply anyway. The warning can be disabled in Settings → Accessibility. * **Live Preview**: Preview changes in real-time before applying. * **Rich Feature Support**: Ligatures (liga, dlig, calt), Stylistic Sets (ss01-ss20), Swashes, Alternates, and more. * **Visual Interface**: User-friendly, resizable, moveable popover with organized feature categories. * **Advanced Typography Controls**: Adjust letter spacing, font weight, responsive font sizes, and more. * **Block Editor Native**: Seamlessly integrates with Gutenberg. * **Custom Fonts Management**: Upload webfont kits from MyFonts, Font Squirrel, or other providers, connect Adobe Fonts, or define custom fonts loaded through themes or CDNs. Fonts are loaded intelligently only on the pages you need them for optimum performance. * **Font Fallbacks**: Facing a rebranding and needing to change fonts? No worries. Delete a font previously defined, and use the fallback system to seamlessly replace them. * **Font Preview**: Test OpenType features with any uploaded font in the settings > admin page to find exactly the styles you need. * **Accessibility Features**: Screen reader support with ARIA markup and a heading structure that maintains proper semantics for both screen reader and visual views * **ARIA Label Support**: Optional aria-label attributes for screen reader compatibility for rich text blocks with inline formatting * **Automatic Archive Detection**: Custom fonts load automatically on blog archives, category pages, and tag pages without requiring manual configuration = Supported OpenType Features = **Ligatures:** * Standard Ligatures (liga) * Discretionary Ligatures (dlig) * Contextual Alternates (calt) * Contextual Ligatures (clig) * Historical Ligatures (hlig) **Stylistic Sets:** * ss01 through ss20 **Swashes & Alternates:** * Swashes (swsh) * Contextual Swashes (cswh) * Stylistic Alternates (salt) * Titling (titl) * Historical Forms (hist) **Decorative:** * Ornaments (ornm) **Numerals & Figures:** * Proportional Figures (pnum) * Tabular Figures (tnum) * Lining Figures (lnum) * Oldstyle Figures (onum) * Fractions (frac) * Slashed Zero (zero) **Capitals & Case:** * Small Capitals (smcp) * Capitals to Small Caps (c2sc) * Petite Capitals (pcap) * Case-Sensitive Forms (case) **Positional Forms:** * Initial Forms (init) * Medial Forms (medi) * Terminal Forms (fina) * Isolated Forms (isol) **Superscript & Ordinals:** * Superscript (sups) * Subscript (subs) * Ordinals (ordn) **Other Features:** * Kerning (kern) * Localized Forms (locl) * Randomize (rand) = Perfect For = * Wedding invitations and event designs * Luxury brand websites * Editorial and magazine layouts * Elegant script fonts * Display typography * Premium web fonts = Recommended Fonts = This plugin requires fonts that support OpenType features. Many premium script fonts and professional typefaces include these features. Examples: * Script fonts by Alejandro Paul like Inglesa, Gratitude Script (with the wonderful Kathy Milici) * Bookmania by Mark Simonson * Orpheus, designed by Kevin King, Patrick Griffin, and Walter Tiemann, from Canada Type * Elaina and other fonts by Laura Worthington * Liza from Underware * Memoriam by Patrick Griffin * ITC Avant Garde designed by André Gürtler, Christian Mengelt, Ed Benguiat, Erich Gschwind, Herb Lubalin, and others. From Monotype * Many other typefaces Check the font's documentation or specimen to verify which OpenType features are supported. Not all fonts have alternates or other advanced features. = How It Works For Headings = 1. Create or edit a heading block (H1-H6) 2. Type your headline text 3. Select the text you want to style 4. Click the "Typography Features" button in the toolbar (a swashy "T" icon) 5. Select individual features 6. See the live preview at the bottom of the popover 7. If using partial word selections, you'll see an accessibility warning with options to convert to the Typography Stylist Block for maximum accessibility, or apply the features anyway. If the block cannot be converted (e.g., inside a locked pattern), only the "Apply Anyway" option is shown. This warning can be disabled in Settings → Typography Stylist → Accessibility. 8. Click Apply = How It Works For Custom Blocks = 1. Create or edit a Typography Stylist block 2. Type your text 3. Apply any global block settings in the sidebar 4. Select any text you want to style 5. Click the "Typography Features" button in the toolbar (a swashy "T" icon) 6. Select individual features and see the live preview = Bundled Third-Party Libraries = The Glyphs Panel reads font files in the browser using two open-source libraries, bundled unmodified in `glyphs-panel/assets/js/vendor/`. They are loaded on demand (only when you open the Glyphs Panel) and run entirely client-side; no font data is sent to any server. * **opentype.js** v1.3.4 — parses TTF/OTF/WOFF font files. MIT License. Source: https://github.com/opentypejs/opentype.js * **wawoff2** — decompresses WOFF2 font files (Emscripten/WebAssembly build of Google's woff2). MIT License. Source: https://github.com/fontello/wawoff2 See BUILD.txt for build and source details. == Installation == 1. Upload the plugin files to `/wp-content/plugins/typography-stylist`, or install through the WordPress plugins screen 2. Activate the plugin through the 'Plugins' screen in WordPress 3. Go to Settings → Typography Stylist to view available features and presets 4. Start using the typography features in the block editor! == Frequently Asked Questions == = Do I need special fonts? = For features like stylistic sets, this plugin requires fonts that support OpenType features. Most premium script fonts and many professional typefaces include these features. Free fonts may have limited support. Letter-spacing, line-height, and other non-opentype features will work with any font. = Will this work with any font? = The plugin will work with any font, but you'll only see results for stylistic sets or ligatures if the font includes the OpenType features you're trying to use. Check your font's documentation for supported features. = Does this work with Google Fonts? = Some Google Fonts support OpenType features. Check the individual font's specimen page for feature support. = Can I use this with custom web fonts? = Absolutely! There are three ways to make fonts available in the plugin: 1. **Upload webfont kits** from MyFonts, Font Squirrel, or other providers using the plugin's Custom Fonts tab 2. **Connect Adobe Fonts** (Typekit) by pasting your project's embed code 3. **Define custom fonts** loaded through your theme, plugins, or CDN (like Google Fonts) so they appear in the editor's font dropdown Beyond these, the plugin can apply OpenType features to any font already loaded on your site (for example via @font-face in your theme) even without selecting it from the plugin's dropdown. Previews in the admin settings page only work for fonts uploaded or connected through the plugin. = How do I upload custom fonts? = 1. Go to Settings → Typography Stylist → Custom Fonts tab 2. Enter a name for your font kit 3. Click "Choose ZIP File" and select your webfont kit ZIP 4. Click "Upload Font Kit" The plugin will extract the fonts and make them available in the editor and preview selector. This has been tested with kits from MyFonts and Font Squirrel. = How do I add Adobe Fonts? = 1. Go to Settings → Typography Stylist → Custom Fonts tab 2. Scroll to "Adobe Fonts (Typekit)" section 3. Enter a project name 4. Paste your Adobe Fonts embed code (the