Sg 2.9
TextItem
Packages RSS
About
News
Gallery
Scripts
Tutorials
Download
Reference
Forum
Users
License
Twitter

Extends Item
Inherited by PointText, PathText, AreaText

The TextItem type allows you to access and modify the text items in Illustrator documents. Its functionality is inherited by different text item types such as PointText, PathText and AreaText. They each add a layer of functionality that is unique to their type, but share the underlying properties and functions that they inherit from TextItem.

Operators

    Returns:
  • Boolean

Properties

The orientation of the text in the text item.

    Returns:
  • String ('horizontal', 'vertical')

Specifies whether to use optical alignment within the text item. Optical alignment hangs punctuation outside the edges of a text item.

    Returns:
  • Booleantrue if the text item uses optical alignment, false otherwise

Hierarchy

Returns the index of the text item in its story. Read-only.

    Returns:
  • Number
story

Returns the story that the text item belongs to. Read-only.

Returns the next text item in a story of various linked text items. Read-only.

Returns the previous text item in a story of various linked text items. Read-only.

Range Properties

The text contents of the text item.

    Returns:
  • String

Returns a text range for all the characters, even the invisible ones outside the container. Read-only.

In case there's an overflow in the text, this only returns a range over the visible characters, while range returns one over the whole text. Read-only.

Returns the index of the first visible character of the text item. (this is the equivalent of calling TextItem.visibleRange.start) Read-only.

    Returns:
  • Number
end

Returns the index of the last visible character of the text item. (this is the equivalent of calling TextItem.visibleRange.end) Read-only.

    Returns:
  • Number

Sub Ranges

The text ranges of the words contained within the text item. Note that the returned text range includes the trailing whitespace characters of the words.

Sample code:

var text = new PointText(new Point(0,0));
text.content = 'The contents of the point text.';
var word = text.words[1];
print(word.content) // 'contents ' - note the space after 'contents';
Read-only.

The text ranges of the paragraphs contained within the text item. Note that the returned text range includes the trailing paragraph (\r) characters of the paragraphs.

Sample code:

var text = new PointText(new Point(0,0));
// ('\r' is the escaped character that specifies a new paragraph)
text.content = 'First paragraph\rSecond paragraph';
var paragraph = text.paragraphs[1];
print(paragraph.content) //returns 'Second paragraph';
Read-only.

The text ranges of the characters contained within the text item.

Sample code:

var text = new PointText(new Point(0,0));
text.content = 'abc';
var character = text.characters[1];
print(character.content) //returns 'b';
Read-only.

Style Properties

The character style of the text item.

The paragraph style of the text item.

Functions

Converts the text in the text item to outlines. Unlike the Illustrator 'Create Outlines' action, this won't remove the text item.

Text Item Linking

Returns true if the text item is linked, false otherwise

    Returns:
  • Boolean

Unlinks the text item from its current story and breaks up the story into two parts before the text item.

    Returns:
  • Booleantrue if the operation as successful, false otherwise

Unlinks the text item from its current story and breaks up the story into two parts after the text item.

    Returns:
  • Booleantrue if the operation as successful, false otherwise

Inheritance

AltStyle によって変換されたページ (->オリジナル) /