Hyphens


Automatic hyphenation configuration.

Hyphenation is a dash-like punctuation mark used to join two-words into one or separate syl-lab-les of a word.

Automatic hyphenation is added between syllables at appropriate hyphenation points, following language rules.

However, user can override automatic break point selection, suggesting line break opportunities (see Suggesting line break opportunities below).

Suggesting line break opportunities:

  • \u2010 ("hard" hyphen) Indicates a visible line break opportunity. Even if the line is not actually broken at that point, the hyphen is still rendered.

  • \u00AD ("soft" hyphen) This character is not rendered visibly; instead, it marks a place where the word can be broken if hyphenation is necessary.

The default configuration for Hyphens = Hyphens.None

Summary

Public companion functions

Hyphens
valueOf(value: Int)

Creates a Hyphens from the given integer value.

Cmn

Public companion properties

Hyphens

The words will be automatically broken at appropriate hyphenation points.

Cmn
Hyphens

Lines will break with no hyphenation.

Cmn
Hyphens

This represents an unset value, a usual replacement for "null" when a primitive value is desired.

Cmn

Public functions

open String
Cmn

Public properties

Int

The integer representation of the Hyphens.

Cmn

Extension functions

inline Hyphens
Hyphens.takeOrElse(block: () -> Hyphens)

If isSpecified is true then this is returned, otherwise block is executed and its result is returned.

Cmn

Extension properties

Boolean

Returns true if it is not Hyphens.Unspecified.

Cmn

Public companion functions

valueOf

fun valueOf(value: Int): Hyphens

Creates a Hyphens from the given integer value. This can be useful if you need to serialize/deserialize Hyphens values.

Parameters
value: Int

The integer representation of the Hyphens.

Throws
kotlin.IllegalArgumentException

if the given value is not recognized.

See also
value

Public companion properties

Auto

val AutoHyphens

The words will be automatically broken at appropriate hyphenation points.

However, suggested line break opportunities (see Suggesting line break opportunities above) will override automatic break point selection when present.

+---------+
| Experi- |
| mental  |
+---------+

None

val NoneHyphens

Lines will break with no hyphenation.

"Hard" hyphens will still be respected. However, no automatic hyphenation will be attempted. If a word must be broken due to being longer than a line, it will break at any character and will not attempt to break at a syllable boundary.

+---------+
| Experim |
| ental   |
+---------+

Unspecified

val UnspecifiedHyphens

This represents an unset value, a usual replacement for "null" when a primitive value is desired.

Public functions

toString

open fun toString(): String

Public properties

value

val valueInt

The integer representation of the Hyphens.

Extension functions

takeOrElse

inline fun Hyphens.takeOrElse(block: () -> Hyphens): Hyphens

If isSpecified is true then this is returned, otherwise block is executed and its result is returned.

Extension properties

isSpecified

val Hyphens.isSpecifiedBoolean

Returns true if it is not Hyphens.Unspecified.

See also
Unspecified