[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Collapse]Rich Text Editor
   [Expand]Product Information
    Product Class Structure
    Supported Formats
   [Expand]Getting Started
   [Expand]RichEditControl Document
   [Expand]Fields
    Text Formatting
    Import and Export
   [Expand]Page Layout
    Printing
    Hyphenation
    Spell Checking
    AutoCorrect Feature
    Track Changes
    Mail Merge
    Restrictions and Protection
   [Expand]Visual Elements
    Services
    Events
    Commands
    Keyboard Shortcuts
    HTML Tag Support
   [Expand]Examples
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Hyphenation

The RichEditControl (see RichEditControl) can enable or suppress word hyphenation at line breaks.

When you load a document, the following scenarios are possible:

  • If the document contains soft hyphens, RichEditControl preserves them.
  • If the document has automatic hyphenation enabled, the RichEditControl uses the currently linked hyphenation dictionaries to hyphenate the text. Note that the document layout may change.

Expanded Add a Hyphenation Dictionary

Link a dictionary that specifies hyphenation rules. The RichEditControl.HyphenationDictionaries property provides access to the dictionary collection. You can use two dictionary types:

  1. OpenOfficeHyphenationDictionary (see OpenOfficeHyphenationDictionary)

    The OpenOffice hyphenation dictionary is a .dic file containing hyphenation patterns with specific encoding.

    The file can contain the following information:

    • LEFTHYPHENMIN - The minimum number of characters that must appear before the first hyphen.
    • RIGHTHYPHENMIN - The minimum number of characters that must appear after the last hyphen.

    Use the OpenOfficeHyphenationDictionary.LeftHyphenMin and OpenOfficeHyphenationDictionary.RightHyphenMin properties to change these parameters.

    You can download dictionaries from the OpenOffice Extensions Page. Note that the OpenOffice license cannot be used for commercial projects.

  2. CustomHyphenationDictionary (see CustomHyphenationDictionary)

    A file with hyphenation patterns. It can contain a list of words divided into syllables (e.g., hy-phe-na-tion).

    The code sample below shows how to add hyphenation dictionaries:

    Note

    A complete code sample project is available at the How to Link Hyphenation Dictionaries repository on GitHub.

Dictionary Culture

The RichEditControl uses dictionaries that match the document's culture. You can specify the dictionary's culture in the object constructor. If the culture is not specified, the dictionary's culture is set to the machine's current culture.

Expanded Hyphenate Text

Use the following properties to hyphenate document text:

Property Description
Document.Hyphenation Specifies whether to hyphenate text automatically. If dictionaries are not provided, the property has no effect.
Document.HyphenateCaps Gets or sets whether to hyphenate words in CAPS.
Paragraph.SuppressHyphenation Specifies whether to limit hyphenation to a specific paragraph.

The code sample below shows how to enable hyphenation and export a document to the PDF format.

Expanded Hyphenation in the User Interface

End user can press Ctrl+- to insert soft hyphens where necessary. Use the Hyphenation drop-down list on the Page Layout ribbon tab to enable or suppress automatic hyphenation, and specify additional hyphenation options. If dictionaries are not provided, the list is disabled.

The Hyphenation Dialog allows you to enable automatic hyphenation and specify whether to hyphenate words in CAPS.

Use the Paragraph Dialog to suppress hyphenation for a specific paragraph. On the Line and Page Breaks tab, check the Don't Hyphenate item.

Is this topic helpful?​​​​​​​