# Text
The text method is for changing the content and / or format of text and fitting texts to text frames or text frames to text.
Unlike Illustrator's native text variable where you can only change the entire contents of a text frame, with Darty-Ai you can change both the contents and format of either entire or parts of text frames.
# Targeting Text
To change the text of an entire text frame use the top row of the table or the tagSearch property and specify the tag of the text frame to be changed.
To change the text of specific words use the find property and specify the words to be changed.
By default only words surrounded by double {{curly}} or ((round)) parenthesis will be targeted.
Use the mode property to change this behavior.
To target specific words in a specified text frames, set both the tagSearch (or top row of the table) and the find properties.
tagSearch: animals find: cat will target the instances of cat but only the ones found in text frames tagged animals.
If you want to target a single instance of a {{template}}, give it a unique name đ
In the below sample text, if you use find: consectetuer adipiscing elit the fist two instances of the find text will be targeted, the third will not, because it is not surrounded by double parenthesis. When the text is changed the parenthesis will be removed.
If you want to target all instances of a set of words including ones not surrounded by parenthesis, use mode: all, that will target all instances, parenthesis will be not be removed.
Lorem ipsum dolor sit amet, ((consectetuer adipiscing elit)), sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat, consectetuer adipiscing elit.
# Modes
In most cases you do not need to set mode, by default if the find property is used, words surrounded by double {{curly}} and ((round)) parenthesis will be targeted.
If a tagSearch is set and the find property is not set and the entire contents of the tagged frame will be targeted.
| Mode | Description |
|---|---|
| all | All instances of the find string will be targeted, parenthesis will not be removed |
| { | Instances of the find string which are surrounded by double {{curly}} parenthesis will be targeted, parenthesis will be removed |
| ( | Instances of the find string which are surrounded by double {{round}} parenthesis will be targeted, parenthesis will be removed |
{(Â [DEFAULT] | Instances of the find string which are surrounded by double {{curly}} or ((round)) parenthesis will be targeted, parenthesis will be removed |
| @ | Will target the entire text of a text frame, this rarely needs setting as it will be the default behavior for when a tagSearch but not a find is set. |
# Advanced RegEx Targeting with grep
Use the grep text parameter to leverage modern ECMAScript-style regex, including the new v (Unicode sets) flag, for ultra-specific targeting of characters â even diacritics and emojis.
| Regex | Matches |
|---|---|
[\u0600-\u06FF] | All Arabic characters including diacritics |
/\p{Script=Arabic}\|\p{M}/ | All Arabic characters, including diacritics |
/[[\u0600-\u06FF]--\p{M}]/v | Arabic excluding diacritics |
/[[\u0600-\u06FF]&&\p{M}]/v | Only Arabic diacritics |
/\p{Emoji}/ | All emoji characters |
/[\p{Emoji}--\p{ASCII}]/v | Emojis without ASCII overlap |
These regexes allow you to:
- đ¨ Color or format only diacritics, emojis, or specific script characters.
- đ§š Remove unwanted characters like diacritics or control marks.
- âď¸ Apply fonts or text direction based on Unicode ranges.
# GREP Flags
The grep parameter can be used along with the flags parameter to set regex flags.
Valid Options for the flags property are:
| Flag | Description |
|---|---|
n | no flags |
i | icase (case insensitive) |
m | multiline (multiline matching) |
s | dotall (Allows . (dot) to match line terminators) |
v | vmode (https://github.com/tc39/proposal-regexp-v-flag (opens new window)) |
Darty-Ai includes the u and g flags by default. Other flags (like i, m, or v) can be added manually after the closing /.
You can also use patterns like \p{Emoji} without slashes, if no extra flags are needed.
# Replacing and Removing Text
replace is used to change the contents of the text.
There is no need to quote find or replace strings, replace: Darty Ai is the same as replace: "Darty Ai".
To remove the find words, set replace to "", '' or ``, leaving replace blank will not work.
You can however set the default value to "" by entering replace: "" in the property cell, bank cells will then cause the template string to be removed.
To replace a text frame with the contents of a file use the Place method.
# Text Attributes
The following text attributes can be set, See the Text Properties for details.
baselineOption / position, baselineShift, charStyle, characterDirection / charDirection, color, composer, everyLineComposer,
firstLineIndent, fillSwatch, fittingMethod, fitTopLines, flags, fontSize, grep, justification, kerningType, language,
leading, lines, leftToRight, minFontSize, maxFontSize, overprintFill, overprintStroke, paraStyle,
paragraphDirection / paraDirection, rotation, strikeThrough, storyDirection, strokeColor, strokeSwatch,
strokeJoin, strokeWidth, swatch, tracking, underline
# Styles and Overrides
You can apply paragraph and character styles Using the paraStyle and charStyle properties.
By default overrides will not be removed.
Use the clearCharacterOverrides and clearParagraphOverrides properties to clear the paragraph and character styles overrides of the text being targeted.
Use the clearOverridesOfWholeParagraph property to clear both the paragraph and character styles overrides of the entire paragraph.
# Sample Spreadsheet and Screenshots
| image | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| details | * | image | ||||||||||||||||||
| text | text | text | text | text | text | place | ||||||||||||||
| fontName | find: name | replace | fontSize | color | find: # | replace | find: birth | replace | find: death | replace | find: term | replace | underline | find: party | mode: all | replace | color | position | fit: fill | path: ~/Desktop/place/files_to_place/Presidents/ |
fill | ||||||||||||||||||||
| Adobe Caslon Pro | name | George Washington | 18 | #999 | # | 1 | birth | 1732 | death | 1799 | term | 1789 - 1797 | TRUE | party | all | Unaffiliated | #999 | fill | 1_George_Washington.jpg | |
| Adobe Clean Bold SemiCondensed Italic | name | Thomas Jefferson | 18 | #EA9978 | # | 2 | birth | 1735 | death | 1826 | term | 1797 â 1801 | party | all | Federalist | #EA9978 | fill | 2_Thomas_Jefferson.jpg | ||
| Adobe Garamond Pro | name | John Adams | 24 | #008000 | # | 3 | birth | 1743 | death | 1826 | term | 1801 â 1809 | party | all | Democratic-Republican | #008000 | fill | 3_John_Adams.jpg | ||
| Adobe Garamond Pro Bold | name | James Madison | 18 | #008000 | # | 4 | birth | 1751 | death | 1836 | term | 1809 â 1817 | party | all | Democratic-Republican | #008000 | fill | 4_James_Madison.jpg | ||
| Courier | name | James Monroe | 18 | #008000 | # | 5 | birth | 1758 | death | 1831 | term | 1817 â 1825 | party | all | Democratic-Republican | #008000 | super | fill | 5_James_Monroe.jpg |
Compare each row in the spreadsheet below with its associated screenshot below. The text frame is tagged 'details' The font has been applied to the entire text frame, the other properties have been set to the individual finds, note the * in the top tagSearch row
Original Template

Row - 1

Row - 2

Row - 3

Row - 4

Row - 5
# Fitting Methods
The fittingMethod property changes the font size or the text frames height to fit a frame's contents.
With it you can automatically:
- Decrease the font size to make sure that text does not overflow.
- Increase the frame height to make sure that text does not overflow.
- As much as possible, fill the frame with it's contents by increasing or decreasing the font sizes.
- Make a paragraph fill the text frame width.
The following values can be used: shrinkText, fitFrame, fitText and none.
You can specify specific frames to fit by using a tagSearch, otherwise set the tagSearch to * and all frames will be processed.
If you use the find property then only the paragraph containing the search string will be fitted unless you set the allText property to true.
fittingMethod works on text on paths (other than the fitFrame option) and in area text frames that have not been set to auto size, it does not work on point frames or area frame that have been set to auto size.
shrinkTextshrinks the font sizes of overflowing frames so that they no longer overflow.fitFramewill increase or decrease the height of the text frame so that the frames entire contents fits in it.fitTextresizes the fonts to, as much as possible, fill the entire frame with it's contents.
If you use thefindproperty to specify specific text then by default the paragraph containing that text will be fitted to the width of the text frame.
If you set theallTextproperty to true, the entire contents of the frame will be fitted to the frame in the same way it does when using thetagSearchproperty.
Note: You can an "Overset Text Fitting" option on the export tab to apply shrinkText and fitFrame to all texts in the document
# Font Min and Max
You can set minimum and maximum font sizes when using fitText or shrinkText by using the minFontSize and maxFontSize properties.
minFontSize
The purpose of the minimum font size is to prevent text from becoming too small per design/regulatory requirements,
if the shrunk font size would be smaller than the specified minimum font size.
In such a case that text would overflow on applying minimum font size, font size will not be changed and an error will be logged.
maxFontSize
The purpose of the maximum font size is to prevent text from becoming too large during fitText or shrinkText operations per design/regulatory requirements.
If the increased font size after a fitText is larger than the specified maximum font size, the size will not be changed.
This also can be used with shrinkText, for when it is necessary to fit the text within a frame, but ensure that the text does not become larger
than a specified maximum font size.
| * | |
| text | |
| find | fittingMethod |
none | |
fitText | |
shrinkText | |
fitFrame | |
| brown | don't seem to make no difference what goes here! |
Compare each row in the spreadsheet below with its associated screenshot below. The text frame is tagged 'details' The font has been applied to the entire text frame, the other properties have been set to the individual finds, note the * in the top tagSearch row

Original Template - Row - 1

Row - 2
fittingMethod: fitText

Row - 3
fittingMethod: shrinkText

Row - 4
fittingMethod: fitFrame
Note: the size of the type on path frame is not changed and the text still overflows the path

Row - 5
# Text-Direction & Composer Features
Darty-Ai provides fine-grained control over text direction,
essential for accurate typesetting in Arabic, Hebrew, and similar right-to-left (RTL) languages.
Middle Eastern, Chinese, Japanese, and other language-specific typographic features can also be
applied using paragraph and/or character styles â allowing full control over font behavior, punctuation, alignment, and more.
Composer
Governs how the layout engine handles character flow, line breaks, and justification in this direction (rtl/ltr) using a particular composer.Story Direction
Sets the base writing direction for the whole story (the entire continuous text flow). This is the âdefaultâ direction that new paragraphs and characters will inherit from.Paragraph Direction
Overrides the story direction for that one paragraph. Useful if you have an RTL story but need an LTR heading in the middle, or vice versa.Character Direction
Overrides paragraph direction for specific characters or spans. The default option here usually means âfollow the paragraph/story direction.â
# Language
The language property can be used to set the language of text.
This will tell the spell-checker to check the text in the correct language.
The valid values are:
- The values you see in Adobe's (English UI's) character panel, for example
English: UK,English: US*,Norwegian: Bokmal,German: 2006 Reform,French. - The values without the specific locale, will use the more commonly used locale, for example
Englishwill setEnglish: US(Even in the UK),Germanwill setGerman: 2006 Reformbecause that is currently more commonly used. - The ISO 639-1, 2 digit language code (opens new window) , for example
en,fr,de - The ISO 639-1, 2 digit language code (opens new window) combined with the ISO 3166-1 alpha-2 Country codes (opens new window), casing, spacing, and use of
_or-are flexible, for exampleen-US,en_US,frfr,frca - The The ISO 639-2, 3 digit language code (opens new window)
Note: Different fonts support different sets of languages. Some languages could be unavailable because they aren't supported by a particular font.
| UI Name 1 | ISO 639-1 (2-digit) 2 | ISO 639-1 + ISO 3166-1 3 | ISO 639-2 (3-digit) | Alternative 1 |
|---|---|---|---|---|
Albanian | sq | sq-AL | sqi | |
Arabic | ar | ar-SA | ara | |
Belarusian | be | be-BY | bel | |
Bengali | bn | bn-IN | ben | |
Bulgarian | bg | bg-BG | bul | |
Burmese | my | my-MM | mya | |
Catalan | ca | ca-ES | cat | |
Chinese | zh | zh-CN | zho | |
Croatian | hr | hr-HR | hrv | |
Czech | cs | cs-CZ | ces | |
Danish | da | da-DK | dan | |
Dutch: 2005 Reform | nl | nl-NL | nld | Dutch, Dutch 2005 |
Dutch: Old Rules | No 2 Digit Code | nl-BE | nlold 4 | |
English: Canadian | No 2 Digit Code | en-CA | No 3 Digit Code | Canadian English |
English: UK | No 2 Digit Code | en-GB | No 3 Digit Code | |
English: US | en | en-US | eng | English |
Estonian | et | et-EE | est | |
Farsi | fa | fa-IR | fas | |
Finnish | fi | fi-FI | fin | |
French: Canadian | fr | fr-CA | No 3 Digit Code | |
French | fr | fr-FR | fra | |
German: 1996 Reform | No 2 Digit Code | No Code | No 3 Digit Code | German 1996 |
German: 2006 Reform | de | de-DE | deu | German German 2006 |
German: Old Rules | No 2 Digit Code | No Code | deold | |
German: Swiss 2006 Reform | No 2 Digit Code | No Code | swiss 4 | Swiss Swiss 2006 |
German: Swiss Old Rules | No 2 Digit Code | No Code | dechold 4 | |
Greek | el | el-GR | ell | |
Gujarati | gu | gu-IN | guj | |
Hebrew | he | he-IL | heb | |
Hindi | hi | hi-IN | hin | |
Hungarian | hu | hu-HU | hun | |
Icelandic | is | is-IS | isl | |
Indonesian | id | id-ID | ind | |
Italian | it | it-IT | ita | |
Japanese | ja | ja-JP | jpn | |
Kannada | kn | kn-IN | kan | |
Khmer | km | km-KH | khm | |
Lao | lo | lo-LA | lao | |
Latvian | lv | lv-LV | lav | |
Lithuanian | lt | lt-LT | lit | |
Malayalam | ml | ml-IN | mal | |
Marathi | mr | mr-IN | mar | |
Norwegian: Bokmal | nb | nb-NO | nob | Norwegian, Bokmal |
Norwegian: Nynorsk | nn | nn-NO | nno | Nynorsk |
Oriya | or | or-IN | ori | |
Polish | pl | pl-PL | pol | |
Portuguese: Brazillian | No 2 Digit Code | pt-BR | No 3 Digit Code | Brazillian |
Portuguese | pt | pt-PT | por | |
Punjabi | pa | pa-IN | pan | |
Romanian | ro | ro-RO | ron | |
Russian | ru | ru-RU | rus | |
Serbian | sr | sr-RS | srp | |
Sinhalese | si | si-LK | sin | |
Slovak | sk | sk-SK | slk | |
Slovenian | sl | sl-SI | slv | |
Spanish | es | es-ES | spa | |
Swedish | sv | sv-SE | swe | |
Tamil | ta | ta-IN | tam | |
Telugu | te | te-IN | tel | |
Thai | th | th-TH | tha | |
Turkish | tr | tr-TR | tur | |
Ukrainian | uk | uk-UA | ukr | |
Vietnamese | vi | vi-VN | vie |
1 Casing, spacing, and use of : are flexible.
2 Casing is flexible.
3 casing, spacing, and use of _ or - are flexible
4 Alterative code
* We will allow for English: USA as well as English: US in our next release đ.
We will add languages as per demand and funding đ°.
# Text Properties
| Mode | Description |
|---|---|
*Â | Set to false if you want the method to be skipped in a particular row. Valid Values: true or false |
allText | When using font-size fittingMethod operations, the allText parameter can be used to control whether the font-size changes affect a specific range, or the entire text-frame. If true, affects entire text-frame. Valid Values: true or false. If the targeted item is a text-frame, this setting is set to true by default, and if the target is a range, then it is false. |
autoLeading | Sets the auto-leading character attributes property. |
baselineOption / position | The position (and size) of the text in relation to the baseline Valid Values: normal, superscript super, subscript sub |
baselineshift | The baseline shift amount, in points. |
charStyle / characterStyle | The case sensitive name of the character style to apply, be default overrides will not be cleared, to clear them use the clear overrides properties Sample Values: My Char Style, Character Style 1 |
charDirection / characterDirection | Text-direction of a character. Values are: ltr, rtl or default |
composer | The text composer to use Valid Values: Adobe, ltr, latin or cjk [Default] for Latin and CJK middleEastern, middleEast, worldReady, rtl, Hebrew, Arabic or complex for complex scripts like Hebrew, Arabic, Thai, Vietnamese, and Indic languages adornment is a third composer, we don't know what it is used for!Add singleLine or multiLine to the composer to set both the composer and the single or multiline properties: adobeSingleLine, middleEasternSingleLine, meSingleLine, adobeMultiLine, middleEasternMultiLine, meMultiLine |
color / fillColor | The fill color of the text Sample Values: orange (CSS Orange), 0 40 100 0 (CMYK orange), 255 128 0 or #ff8000 or ff8000 (RGB Orange) lab 66 44 74 Orange (Create / Change a Swatch "Orange" with Lab values), /Orange (use an existing swatch called Orange), none See Swatch Methods for a description of swatch and color descriptions |
clearCharacterOverrides | Whether or not to clear all the character style overrides in the text being targeted. Valid Values: false[Default] ortrue |
clearParagraphOverrides | Whether or not to clear all the paragraph and character style overrides of the text being targeted. Valid Values: false[Default] ortrue |
clearOverridesOfWholeParagraph | Whether or not to clear the paragraph and character style overrides in the entire paragraphs containing the targeted text. Valid Values: false[Default] ortrue |
everyLineComposer | Whether the every-line or single-line version of the text composer should be used Valid Values: true or false [Default] |
fillSwatch / swatch | The swatch name of a swatch-color to be applied to the character fills of text See Swatch Methods for a description of swatch and color descriptions |
firstLineIndent | The fist line indent of the paragraph Sample Values: 12.7, 3mm, .5", 0p6 |
fittingMethod | The fitting operation to apply to text. Valid Values: shrinkText, fitFrame, fitText |
fitTopLines | Fits the first line of a text paragraph to take up full space of the text-line. Use for headline-fitting. |
flags | Used along with the grep text sub-method, the flags parameter is used to specify GREP regular-expression flags for it. Valid Values: n, i, m, s, v |
fontSize | The font size to use Sample Values: 12, 12px, .5", 1cm |
font / fontFamily | The case insensitive name of the font family to use, if given the the style should be set using the fontStyle property Sample Values: myriad Pro, Arial Black ("Black" is part of the name and not the style), Adobe éťä˝ Std R |
fontStyle | The case insensitive name of the font style to use, can be used together with font / fontFamily but not fontName If the style does not exist then the style will not be changed Sample Values: Bold, Italic, Condensed, semibold |
fontName | The name of the font including the font style Sample Values: Myriad Pro Condensed, Arial Black Regular |
grep | Replace text using modern ECMAScript-style regex |
justification | The justification of the paragraph Valid Values: left, right, center, fullLeft, fullRight, fullCenter, fullLeft, fullRight, fullCenter, full |
kerningType | The kerning type of the text Valid Values: noKerning, metric, optical, metricRomanOnly |
language | The language of the text, used for hyphenation and spell checking See Language for a list of rules and values. Sample Values: English: US, Finnish, French, French: Canadian, German: 1996 Reform, German: Old Rules, etc. Note: Different fonts support different sets of languages. Some languages could be unavailable because they aren't supported by a particular font. |
leading | The leading to use Sample Values: 12, 12px, .5", 1cm |
leftToRight | Whether or not to apply a left to right character direction Valid Values: true [Default] or false suitable for right to left languages like Hebrew and Arabic |
lines | When fitting text using fittingMethod operations with fitText or shrinkText options, the lines parameter can be used ensure the paragraph ends up with a specified amount of text-lines. |
minFontSize | When fitting text using fittingMethod operations with fitText or shrinkText options, the minFontSize parameter ensures the text is not shrunk down if the result were to be below this specified number (in points). |
maxFontSize | When fitting text using fittingMethod operations with fitText or shrinkText options, the maxFontSize parameter ensures the text does not end up with a font-size over this specified number (in points). |
mode | The type of text / template to target Valid Values: all (targets text as is, no template parenthesis use), {( (templates must be surrounded with either double curly or round parentheses) [Default], {{ (templates must be surrounded with double curly parentheses), (( (templates must be surrounded with double round parentheses) See Modes |
overprintFill | Whether or not to overprint the fill Valid Values: false or true |
overprintStroke | Whether or not to overprint the stroke Valid Values: false or true |
paraStyle / paragraphStyle | The case sensitive name of the paragraph style to apply, by default overrides will not be cleared, to clear them use the clear overrides properties Sample Values: My Para Style, Paragraph Style 1 |
paraDirection / paragraphDirection | Specifies the right-to-left or left-to-right text-direction of a Paragraph. Valid Values: ltr or rtl. |
strikeThrough | Whether or not strike through the text Valid Values: false or true |
storyDirection | Text-direction of a Story. All contained paragraphs would now inherit this text-direction. Values are: ltr or rtl. |
strokeColor | The stroke color of the text Sample Values: orange (CSS Orange), 0 40 100 0 (CMYK orange), 255 128 0 or #ff8000 or ff8000 (RGB Orange) lab 66 44 74 Orange (Create / Change a Swatch "Orange" with Lab values), /Orange (use an existing swatch called Orange), none See Swatch Methods for a description of swatch and color descriptions |
strokeSwatch | The name of the swatch to apply to the stroke color of the text See Swatch Methods for a description of swatch and color descriptions |
strokeJoin | The shape to apply to the stroke's join Valid Values: miter, round, bevel |
strokeWidth | The width of the stroke to apply Sample Values: .5, 1pt, .5mm |
underline | Whether or not to underline the text Valid Values: false or true |
replace | The replacement text value to populate the text-frame or range with. See Replacing and Removing Text |
rotation | Rotation of characters, in degrees (0-360) |
skip | Set to true is you want the method to be skipped in a particular row. See * and Skip for details. Valid Values: true or false |
tracking | Set the tracking (space between characters) value for the text (in points). |
find | The text / template you want changed (Case sensitive), specify a tagSearch if you want to limit the text changed to specific text frames. Use mode to specify what type of template to target. Sample Values: name, address |
tagSearch | Specify a tagSearch if you want to limit the text changed to specific text frames. If no find is provided, the entire text frame will be changed. Sample Values: cats, cats | dogs, animals & !dogs |
â Tags Methods Transform Methods â