Skip to content

Latest commit

 

History

History
99 lines (70 loc) · 3.54 KB

File metadata and controls

99 lines (70 loc) · 3.54 KB

Advanced Typography plugin

The Advanced Typography plugin, depending on its setting, can replace common typewriter-style characters with their professional typesetter equivalents after the Advanced Typography button is pressed. This action will modify either the entire content for the {productname} document or the specific text selection highlighted by the user.

For example, if English-language typography rules are set, the Advanced Typography plugin can automatically replace an open-hyphen (-) with an em-dash (). And it can automatically replace the teardrop apostrophe (') with opening and closing quote marks ( and ).

Advanced Typography plugin rules

The Advanced Typography plugin rules are sourced from the typograf library.

However, the Advanced Typography plugin only uses a sub-set of all the rules available in this library.

Of the library’s full Rules of typograf list, the Advanced Typography plugin uses the following:

  • common/space/delBeforePunctuation

  • common/space/afterComma

  • common/space/afterColon

  • common/space/delBetweenExclamationMarks

  • common/space/afterExclamationMark

  • common/space/afterQuestionMark

  • common/space/afterSemicolon

  • common/space/beforeBracket

  • common/space/bracket

  • common/space/delBeforeDot

  • common/space/delBeforePercent

  • common/space/squareBracket

  • common/number/mathSigns

  • common/number/times

  • common/number/fraction

  • common/symbols/arrow

  • common/symbols/cf

  • common/symbols/copy

  • common/punctuation/delDoublePunctuation

  • common/punctuation/hellip

  • common/nbsp/afterSectionMark

  • common/punctuation/quote

  • en-US/dash/main

  • common/nbsp/afterParagraphMark

  • common/nbsp/afterShortWord

  • common/nbsp/beforeShortLastNumber

  • common/nbsp/beforeShortLastWord

  • common/nbsp/dpi

  • common/punctuation/apostrophe

No other typograf rules are used and the Advanced Typography plugin cannot be configured to use any typograf rules other than those listed above.

Note
The Advanced Typography plugin affects text only. It does not modify the underlying HTML markup.

Interactive example

liveDemo::typography[]

Basic setup

To add the Advanced Typography plugin to the editor, add typography to the plugins option in the editor configuration.

Note
The Advanced Typography plugin requires a typography_default_lang be configured.

For example:

tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  plugins: 'typography',
  toolbar: 'typography',
  typography_default_lang: [ "en-US" ], // Required to set specific typography language rules.
});

Options

Commands

The Advanced Typography plugin provides the following {productname} commands.