Class TextStyleBuilder
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
TextStyleBuilder
כלי ליצירת סגנונות טקסט.
מסמכים מפורטים
build()
יצירת סגנון טקסט מה-builder הזה.
חזרה
TextStyle
— סגנון טקסט שנוצר מהכלי הזה.
setBold(bold)
מגדיר אם הטקסט יהיה מודגש או לא.
פרמטרים
שם | סוג | תיאור |
bold | Boolean | אם הטקסט מודגש או לא. |
חזרה
TextStyleBuilder
– ה-builder לשרשור.
setFontFamily(fontFamily)
הגדרת משפחת הגופנים של הטקסט, למשל 'Arial'.
פרמטרים
שם | סוג | תיאור |
fontFamily | String | משפחת הגופנים הרצויה. |
חזרה
TextStyleBuilder
– ה-builder לשרשור.
setFontSize(fontSize)
הגדרת גודל הגופן של הטקסט בנקודות.
פרמטרים
שם | סוג | תיאור |
fontSize | Integer | גודל הגופן הרצוי. |
חזרה
TextStyleBuilder
– ה-builder לשרשור.
setForegroundColor(cssString)
הגדרת צבע הגופן של הטקסט.
פרמטרים
שם | סוג | תיאור |
cssString | String | צבע הגופן הרצוי בסימון CSS (למשל '#ffffff' או 'white' ). |
חזרה
TextStyleBuilder
– ה-builder לשרשור.
setForegroundColorObject(color)
הגדרת צבע הגופן של הטקסט.
פרמטרים
שם | סוג | תיאור |
color | Color | צבע הגופן הרצוי. |
חזרה
TextStyleBuilder
– ה-builder לשרשור.
setItalic(italic)
מגדיר אם הטקסט יופיע בכתב נטוי או לא.
פרמטרים
שם | סוג | תיאור |
italic | Boolean | האם הטקסט נטוי או לא. |
חזרה
TextStyleBuilder
– ה-builder לשרשור.
setStrikethrough(strikethrough)
קובע אם הטקסט יהיה מקווקו או לא.
פרמטרים
שם | סוג | תיאור |
strikethrough | Boolean | אם יש קו חוצה בטקסט או לא. |
חזרה
TextStyleBuilder
– ה-builder לשרשור.
setUnderline(underline)
קובע אם הטקסט יהיה עם קו תחתון או לא.
פרמטרים
שם | סוג | תיאור |
underline | Boolean | אם הטקסט יהיה עם קו תחתון או לא. |
חזרה
TextStyleBuilder
– ה-builder לשרשור.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 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."]]