Class TextStyleBuilder
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
टेक्स्टस्टाइलबिल्डर
टेक्स्ट स्टाइल के लिए बिल्डर.
ज़्यादा जानकारी वाला दस्तावेज़
build()
इस बिल्डर से टेक्स्ट स्टाइल बनाता है.
वापसी का टिकट
TextStyle
— इस बिल्डर से बनाई गई टेक्स्ट स्टाइल.
setBold(bold)
इससे यह तय होता है कि टेक्स्ट बोल्ड है या नहीं.
पैरामीटर
नाम | टाइप | ब्यौरा |
bold | Boolean | टेक्स्ट बोल्ड है या नहीं. |
वापसी का टिकट
TextStyleBuilder
— चेन बनाने के लिए बिल्डर.
setFontFamily(fontFamily)
टेक्स्ट फ़ॉन्ट फ़ैमिली सेट करता है, जैसे कि "Arial".
पैरामीटर
नाम | टाइप | ब्यौरा |
fontFamily | String | अपनी पसंद की फ़ॉन्ट फ़ैमिली. |
वापसी का टिकट
TextStyleBuilder
— चेन बनाने के लिए बिल्डर.
setFontSize(fontSize)
टेक्स्ट के फ़ॉन्ट का साइज़, पॉइंट में सेट करता है.
पैरामीटर
नाम | टाइप | ब्यौरा |
fontSize | Integer | फ़ॉन्ट का मनमुताबिक साइज़. |
वापसी का टिकट
TextStyleBuilder
— चेन बनाने के लिए बिल्डर.
setForegroundColor(cssString)
टेक्स्ट के फ़ॉन्ट का रंग सेट करता है.
पैरामीटर
नाम | टाइप | ब्यौरा |
cssString | String | सीएसएस नोटेशन में फ़ॉन्ट का पसंदीदा रंग (जैसे, '#ffffff' या 'white' ). |
वापसी का टिकट
TextStyleBuilder
— चेन बनाने के लिए बिल्डर.
setForegroundColorObject(color)
टेक्स्ट के फ़ॉन्ट का रंग सेट करता है.
पैरामीटर
नाम | टाइप | ब्यौरा |
color | Color | फ़ॉन्ट का पसंदीदा रंग. |
वापसी का टिकट
TextStyleBuilder
— चेन बनाने के लिए बिल्डर.
setItalic(italic)
इससे यह तय होता है कि टेक्स्ट इटैलिक है या नहीं.
पैरामीटर
नाम | टाइप | ब्यौरा |
italic | Boolean | टेक्स्ट इटैलिक है या नहीं. |
वापसी का टिकट
TextStyleBuilder
— चेन बनाने के लिए बिल्डर.
setStrikethrough(strikethrough)
इससे यह तय होता है कि टेक्स्ट पर स्ट्राइकथ्रू है या नहीं.
पैरामीटर
नाम | टाइप | ब्यौरा |
strikethrough | Boolean | टेक्स्ट पर स्ट्राइकथ्रू किया गया है या नहीं. |
वापसी का टिकट
TextStyleBuilder
— चेन बनाने के लिए बिल्डर.
setUnderline(underline)
इससे यह तय होता है कि टेक्स्ट को अंडरलाइन किया जाए या नहीं.
पैरामीटर
नाम | टाइप | ब्यौरा |
underline | Boolean | टेक्स्ट को अंडरलाइन किया गया है या नहीं. |
वापसी का टिकट
TextStyleBuilder
— चेन बनाने के लिए बिल्डर.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[[["\u003cp\u003e\u003ccode\u003eTextStyleBuilder\u003c/code\u003e helps create custom text styles with various formatting options.\u003c/p\u003e\n"],["\u003cp\u003eYou can specify font family, size, color, and styles like bold, italic, underline, and strikethrough.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods like \u003ccode\u003esetBold\u003c/code\u003e, \u003ccode\u003esetFontFamily\u003c/code\u003e, \u003ccode\u003esetFontSize\u003c/code\u003e, and others to define text attributes.\u003c/p\u003e\n"],["\u003cp\u003eUse the \u003ccode\u003ebuild()\u003c/code\u003e method to create a \u003ccode\u003eTextStyle\u003c/code\u003e object with your defined formatting.\u003c/p\u003e\n"],["\u003cp\u003eThis builder enables flexible and detailed control over text presentation in Google Apps Script.\u003c/p\u003e\n"]]],[],null,["# Class TextStyleBuilder\n\nTextStyleBuilder\n\nA builder for text styles. \n\n### Methods\n\n| Method | Return type | Brief description |\n|---------------------------------------------------------------------|------------------------------------------------------------|-------------------------------------------------|\n| [build()](#build()) | [TextStyle](/apps-script/reference/spreadsheet/text-style) | Creates a text style from this builder. |\n| [setBold(bold)](#setBold(Boolean)) | [TextStyleBuilder](#) | Sets whether or not the text is bold. |\n| [setFontFamily(fontFamily)](#setFontFamily(String)) | [TextStyleBuilder](#) | Sets the text font family, such as \"Arial\". |\n| [setFontSize(fontSize)](#setFontSize(Integer)) | [TextStyleBuilder](#) | Sets the text font size in points. |\n| [setForegroundColor(cssString)](#setForegroundColor(String)) | [TextStyleBuilder](#) | Sets the text font color. |\n| [setForegroundColorObject(color)](#setForegroundColorObject(Color)) | [TextStyleBuilder](#) | Sets the text font color. |\n| [setItalic(italic)](#setItalic(Boolean)) | [TextStyleBuilder](#) | Sets whether or not the text is italic. |\n| [setStrikethrough(strikethrough)](#setStrikethrough(Boolean)) | [TextStyleBuilder](#) | Sets whether or not the text has strikethrough. |\n| [setUnderline(underline)](#setUnderline(Boolean)) | [TextStyleBuilder](#) | Sets whether or not the text is underlined. |\n\nDetailed documentation\n----------------------\n\n### `build()`\n\nCreates a text style from this builder.\n\n#### Return\n\n\n[TextStyle](/apps-script/reference/spreadsheet/text-style) --- A text style created from this builder.\n\n*** ** * ** ***\n\n### `set``Bold(bold)`\n\nSets whether or not the text is bold.\n\n#### Parameters\n\n| Name | Type | Description |\n|--------|-----------|----------------------------------|\n| `bold` | `Boolean` | Whether or not the text is bold. |\n\n#### Return\n\n\n[TextStyleBuilder](#) --- The builder for chaining.\n\n*** ** * ** ***\n\n### `set``Font``Family(fontFamily)`\n\nSets the text font family, such as \"Arial\".\n\n#### Parameters\n\n| Name | Type | Description |\n|----------------|----------|--------------------------|\n| `font``Family` | `String` | The desired font family. |\n\n#### Return\n\n\n[TextStyleBuilder](#) --- The builder for chaining.\n\n*** ** * ** ***\n\n### `set``Font``Size(fontSize)`\n\nSets the text font size in points.\n\n#### Parameters\n\n| Name | Type | Description |\n|--------------|-----------|------------------------|\n| `font``Size` | `Integer` | The desired font size. |\n\n#### Return\n\n\n[TextStyleBuilder](#) --- The builder for chaining.\n\n*** ** * ** ***\n\n### `set``Foreground``Color(cssString)`\n\nSets the text font color.\n\n#### Parameters\n\n| Name | Type | Description |\n|---------------|----------|----------------------------------------------------------------------------|\n| `css``String` | `String` | The desired font color in CSS notation (such as `'#ffffff'` or `'white'`). |\n\n#### Return\n\n\n[TextStyleBuilder](#) --- The builder for chaining.\n\n*** ** * ** ***\n\n### `set``Foreground``Color``Object(color)`\n\nSets the text font color.\n\n#### Parameters\n\n| Name | Type | Description |\n|---------|---------------------------------------------------|-------------------------|\n| `color` | [Color](/apps-script/reference/spreadsheet/color) | The desired font color. |\n\n#### Return\n\n\n[TextStyleBuilder](#) --- The builder for chaining.\n\n*** ** * ** ***\n\n### `set``Italic(italic)`\n\nSets whether or not the text is italic.\n\n#### Parameters\n\n| Name | Type | Description |\n|----------|-----------|------------------------------------|\n| `italic` | `Boolean` | Whether or not the text is italic. |\n\n#### Return\n\n\n[TextStyleBuilder](#) --- The builder for chaining.\n\n*** ** * ** ***\n\n### `set``Strikethrough(strikethrough)`\n\nSets whether or not the text has strikethrough.\n\n#### Parameters\n\n| Name | Type | Description |\n|-----------------|-----------|--------------------------------------------|\n| `strikethrough` | `Boolean` | Whether or not the text has strikethrough. |\n\n#### Return\n\n\n[TextStyleBuilder](#) --- The builder for chaining.\n\n*** ** * ** ***\n\n### `set``Underline(underline)`\n\nSets whether or not the text is underlined.\n\n#### Parameters\n\n| Name | Type | Description |\n|-------------|-----------|----------------------------------------|\n| `underline` | `Boolean` | Whether or not the text is underlined. |\n\n#### Return\n\n\n[TextStyleBuilder](#) --- The builder for chaining."]]