Edit in GitHubLog an issue

HyphenationProperties

These property values are used to apply hyphenation to paragraph text.

These hyphenation features can be seen in the dialog in the Paragraph panel's flyout menu item labeled "Hyphenation...". They are expressed with an object literal with the following properties (values are in pixels):

Copied to your clipboard
1{
2 // The minimum number of letters a word must have in order for hyphenation
3 // in word wrap to be allowed. In the range [2, 25], default 5.
4 wordsLongerThan: number,
5 // The minimum number of letters after which hyphenation
6 // in word wrap is allowed. In the range [1, 15], default 2.
7 afterFirst: number,
8 // The minimum number of letters before which hyphenation
9 // in word wrap is allowed. In the range [1, 15], default 2.
10 beforeLast: number,
11 // The maximum number of consecutive lines that can end with a hyphenated word.
12 // In the range [2, 25], default 2.
13 limit: number,
14 // The distance in pixels at the end of a line that will cause a word
15 // to break in unjustified type. In the range of [0, 8640] pixels for a 72PPI document.
16 // If the document resolution is different, the max. value is scaled accordingly.
17 // Default: 36px (72PPI)
18 zone: number,
19 // True to allow hyphenation in word wrap of capitalized words. Default true.
20 capitalWords: boolean
21}

The hyphenationFeatures getter returns an object with all the features:

Copied to your clipboard
1const textItem = app.activeDocument.activeLayers[0].textItem;
2textItem.paragraphStyle.hyphenationFeatures;
3// {
4// wordsLongerThan: 5,
5// afterFirst: 2,
6// beforeLast: 2,
7// limit: 2,
8// zone: 36,
9// capitalWords: true
10// }

In the object that is passed to the setter, all the properties are optional; the ones that are not specified will be assigned the default values.

Copied to your clipboard
1textItem.paragraphStyle.hyphenationFeatures = { wordsLongerThan: 10, afterFirst: 3 };
2// {
3// wordsLongerThan: 10,
4// afterFirst: 3,
5// beforeLast: 2,
6// limit: 2,
7// zone: 36,
8// capitalWords: true
9// }
NameTypeDefaultRangeMin VersionDescription
afterFirst
number
2
1..15
24.1
The minimum number of letters after which hyphenation in word wrap is allowed.
beforeLast
number
2
1..15
24.1
The minimum number of letters before which hyphenation in word wrap is allowed.
capitalWords
boolean
true
-
24.1
True to allow hyphenation in word wrap of capitalized words.
limit
number
2
2..25
24.1
The maximum number of consecutive lines that can end with a hyphenated word.
wordsLongerThan
number
5
2..25
24.1
The minimum number of letters a word must have in order for hyphenation in word wrap to be allowed.
zone
number
36
0..8640 for a 72PPI document
24.1
The distance in pixels at the end of a line that will cause a word to break in unjustified type.
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.