Edit in GitHubLog an issue

ParagraphStyle

存储与Photoshop用户界面中的段落面板有关的属性的类。

Properties

名称类型访问默认范围最低版本描述
featuresTypeInterfaceFeaturesR WTypeInterfaceFeatures.DEFAULT-24.1要显示的段落UI特征。
firstLineIndentnumberR W--1296..129624.1在72ppi的文件中,缩进第一行段落的空间,单位是像素。
hyphenationbooleanR Wfalse-24.1真,以便在换词中使用连字符。使用hyphenationFeatures来实现最大的控制。
hyphenationFeaturesHyphenationPropertiesR W--24.1The hyphenation features as they're displayed in the dialog found in the Paragraph's flyout menu "Hyphenation...". They're expressed with an option object with the following properties (numbers are in pixels): ```javascript { // The minimum number of letters a word must have in order for hyphenation // in word wrap to be allowed. In the range [2, 25], default 5. wordsLongerThan: number, // The minimum number of letters after which hyphenation // in word wrap is allowed. In the range [1, 15], default 2. afterFirst: number, // The minimum number of letters before which hyphenation // in word wrap is allowed. In the range [1, 15], default 2. beforeLast: number, // The maximum number of consecutive lines that can end with a hyphenated word. // In the range [2, 25], default 2. limit: number, // The distance in pixels at the end of a line that will cause a word // to break in unjustified type. In the range of [0, 8640] pixels for a 72PPI document. // If the document resolution is different, the max. value is scaled accordingly. // Default: 36px (72PPI) zone: number, // True to allow hyphenation in word wrap of capitalized words. Default true. capitalWords: boolean } ``` The hyphenationFeatures getter returns an object with all the features: ```javascript const textItem = app.activeDocument.activeLayers[0].textItem; textItem.paragraphStyle.hyphenationFeatures; // { // wordsLongerThan: 5, // afterFirst: 2, // beforeLast: 2, // limit: 2, // zone: 36, // capitalWords: true // } ``` 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. ```javascript textItem.paragraphStyle.hyphenationFeatures = { wordsLongerThan: 10, afterFirst: 3 }; // { // wordsLongerThan: 10, // afterFirst: 3, // beforeLast: 2, // limit: 2, // zone: 36, // capitalWords: true // } ```
justificationJustificationR WJustification.LEFT-24.1The paragraph justification.
justificationFeaturesJustificationPropertiesR W--24.1The justification features as they're displayed in the dialog found in the Paragraph's flyout menu "Justification...". They're expressed with an option object with the following properties (all percentage numbers): ```javascript { // Minimum, Desired and Maximum percentage of normal word spacing wordSpacingMinimum: number, wordSpacingDesired: number, wordSpacingMaximum: number, // Minimum, Desired and Maximum percentage of normal letter spacing letterSpacingMinimum: number, letterSpacingDesired: number, letterSpacingMaximum: number, // Minimum, Desired and Maximum percentage of normal glyph scaling glyphScalingMinimum: number, glyphScalingDesired: number, glyphScalingMaximum: number // Percentage of type size to use for auto leading autoLeadingAmount: number } ``` Unless it's been set, the justificationFeatures value is `null`. The setter allows you to set individual properties: the missing ones will be either filled with the default values or left untouched. Properties' ranges are as follows: WordSpacing: 0 <= Minimum <= Maximum Minimum <= Desired <= Maximum Minimum <= Maximum <= 1000 LetterSpacing: -100 <= Minimum <= Maximum Minimum <= Desired <= Maximum Minimum <= Maximum <= 500 GlyphScaling: 50 <= Minimum <= Maximum Minimum <= Desired <= Maximum Minimum <= Maximum <= 200 AutoLeading: 0 <= AutoLeading <= 500
kashidaWidthKashidaWidthTypeR WKashidaWidthType.MEDIUM-24.1卡西达(TATWEEL)字符的宽度
kinsokuKinsokuR WKinsoku.NONE-24.1日语文本的断行规则(Kinsoku Shori)。
layoutModeParagraphLayoutR WParagraphLayout.WORLD-24.1段落布局模式。
leftIndentnumberR W--1296..129624.1在72ppi的文件中,从左边缩进文本的空间,单位是像素。
mojikumiMojikumiR WMojikumi.NONE-24.1日语文本中标点、符号、数字和其他字符类别之间的间距。
rightIndentnumberR W--1296..129624.1在72ppi的文件中,从右边缩进文本的空间,单位是像素。
spaceAfternumberR W--1296..129624.1在72ppi的文件中,每段后面要使用的空间,单位是像素。
spaceBeforenumberR W--1296..129624.1在72ppi的文件中,每个段落前要使用的空间,单位是像素。

Methods

reset

24.1

async : Promise<void>

将段落样式重置为其默认值。

Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2023 Adobe. All rights reserved.