Changing words app3/29/2023 ![]() ![]() Preset patterns of glyphs for lists in text. Paragraphs, then center aligns the first three paragraphs.Ĭonst shape = slide.insertShape(_BOX, 50, 50, 300, 300) The following example creates a text box on the first slide with four Object for styling all the paragraphs that overlap the parent text range. The getParagraphStyle() function in TextRange provides a ParagraphStyle Paragraph styles apply to entire paragraphs, and include things like text alignment and line More details can beįound in the TextStyle reference documentation. There are many other styles that can be applied to text. So the above sample produces the following log statements: Text: Hello Bold: false When reading styles, the function returns null if the range has multiple valuesįor the style. Is bolded, linked to and its color is set The above example first creates a text box on the first slide and sets itsĬontent to "Hello ". ![]() setLinkUrl('.setForegroundColor('#ff0000') Ĭonst helloRange = textRange.getRange(0, 5) Ĭonsole.log('Text: ' + helloRange.asString() + ' Bold: ' + helloRange.getTextStyle().isBold()) Ĭonsole.log('Text: ' + insertedText.asString() + ' Bold: ' +Ĭonsole.log('Text: ' + textRange.asString() + ' Bold: ' + textRange.getTextStyle().isBold()) ![]() The TextStyle object covers the same text as its parent TextRange.Ĭonst insertedText = textRange.appendText('world!') The getTextStyle() function of a text range provides a TextStyle object used for Text style determines the rendering of text characters in your presentation, Text run is a segment of text where all the characters have the same text getRuns(), which provides the text runs that overlap the current text range.getListParagraphs(), which returns the list items in the current text range.Paragraph is a sequence of text which terminates with the newline character, getParagraphs(), which provides all paragraphs which overlap the text range.TextRange provides functions to return useful collections of text entities. ![]() It can be used along with setText() for performing find-and-replace The find() function on TextRange returns the instances of a string within the Use the replaceAllText() function on presentation or page to perform a globalįind and replace across the entire presentation or a specific page. The above example produces theįollowing log statement: Start: 0 End: 14 Content: Hello galaxy! Search and replace Inserts the text "galaxy" at index 6 instead. It then deletes characters 6 through 11 ("world"), and This script creates a text box on the first slide and sets its text content The following script demonstrates the use of these functions:
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |