Enum TextAlignment

  • TextAlignment is an enumeration used to specify text alignment types.

  • Text alignment enums are accessed via DocumentApp.TextAlignment.

  • Examples include NORMAL, SUPERSCRIPT, and SUBSCRIPT.

TextAlignment

An enumeration of the type of text alignments.

To call an enum, you call its parent class, name, and property. For example, DocumentApp.TextAlignment.NORMAL.

// Make the first character in the first paragraph of the active tab be
// superscript.
constdocumentTab=
DocumentApp.getActiveDocument().getActiveTab().asDocumentTab();
consttext=documentTab.getBody().getParagraphs()[0].editAsText();
text.setTextAlignment(0,0,DocumentApp.TextAlignment.SUPERSCRIPT);

Properties

PropertyTypeDescription
NORMALEnumThe normal text alignment.
SUPERSCRIPTEnumThe superscript text alignment.
SUBSCRIPTEnumThe subscript text alignment.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024年12月02日 UTC.