Stay organized with collections Save and categorize content based on your preferences.
TextStyleThe rendered style of text in a cell.
Text styles can have a corresponding RichTextValue
. If the RichTextValue
spans multiple text runs that have different values for a given text style read method, the method returns null
. To avoid this, query for text styles using the Rich Text values returned by the RichTextValue.getRuns()
method.
copy()
Creates a text style builder initialized with the values of this text style.
ReturnTextStyleBuilder
— A builder from this text style.
getFontFamily()
Gets the font family of the text. Returns null
if the font family isn't set or the corresponding RichTextValue
has multiple runs with different font families.
String
— The font family of the text (for example, "Arial") or null
.
getFontSize()
Gets the font size of the text in points. Returns null
if the font size isn't set or the corresponding RichTextValue
has multiple runs with different font sizes.
Integer
— The font size of the text or null
.
getForegroundColorObject()
Gets the font color of the text. Returns null
if the font color isn't set or the corresponding RichTextValue
has multiple runs with different font colors.
Color
— The font color of the text or null
.
isBold()
Gets whether or not the text is bold. Returns null
if bold isn't set or the corresponding RichTextValue
has multiple runs with different bold settings.
Boolean
— Whether or not the cell is bold, or null
.
isItalic()
Gets whether or not the cell is italic. Returns null
if italic isn't set or the corresponding RichTextValue
has multiple runs with different italic settings.
Boolean
— Whether or not the cell is italic, or null
.
isStrikethrough()
Gets whether or not the cell has strikethrough. Returns null
if strikethrough isn't set or the corresponding RichTextValue
has multiple runs with different strikethrough settings.
Boolean
— Whether or not the cell has strikethrough, or null
.
isUnderline()
Gets whether or not the cell is underlined. Returns null
if underline isn't set or the corresponding RichTextValue
has multiple runs with different underline settings.
Boolean
— Whether or not the cell is underlined, or null
.
getForegroundColor()
Deprecated. Replaced by getForegroundColorObject()
Gets the font color of the text. Returns null
if the font color isn't set or the corresponding RichTextValue
has multiple runs with different font colors.
String
— The font color of the text as a hex CSS value (for example, "#ff0000") or null
.
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-03 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-03 UTC."],[[["`TextStyle` defines the rendered style of text within a cell in Google Sheets, encompassing attributes like font family, size, color, and formatting."],["It can be linked to a `RichTextValue` for more complex formatting but may return `null` for style properties if the `RichTextValue` has multiple runs with differing styles."],["Developers can use methods like `getFontFamily()`, `getFontSize()`, `isBold()`, etc., to retrieve specific style attributes of the text."],["A `TextStyleBuilder` can be created using the `copy()` method to facilitate the construction of new text styles based on existing ones."],["The `getForegroundColor()` method is deprecated and should be replaced with `getForegroundColorObject()` to retrieve the font color as a `Color` object."]]],["TextStyle defines the visual styling of text within a cell. It interacts with RichTextValue, which handles text segments with varied styles. Core actions include: `copy()` which creates a new TextStyleBuilder with the current style, and getter methods such as `getFontFamily()`, `getFontSize()`, `getForegroundColorObject()`, `isBold()`, `isItalic()`, `isStrikethrough()`, and `isUnderline()`, that each retrieve a specific text style property. Most getter methods may return `null` if the property is not set or varies within a RichTextValue.\n"]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4