Class TextStyleBuilder
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
TextStyleBuilder
텍스트 스타일 빌더입니다.
자세한 문서
build()
이 빌더에서 텍스트 스타일을 만듭니다.
리턴
TextStyle
: 이 빌더에서 만든 텍스트 스타일입니다.
setBold(bold)
텍스트를 굵게 표시할지 여부를 설정합니다.
매개변수
이름 | 유형 | 설명 |
bold | Boolean | 텍스트가 굵게 표시되는지 여부입니다. |
리턴
TextStyleBuilder
: 연결을 위한 빌더입니다.
setFontFamily(fontFamily)
텍스트 글꼴 모음(예: 'Arial')을 설정합니다.
매개변수
이름 | 유형 | 설명 |
fontFamily | String | 원하는 글꼴 모음입니다. |
리턴
TextStyleBuilder
: 연결을 위한 빌더입니다.
setFontSize(fontSize)
텍스트 글꼴 크기를 포인트로 설정합니다.
매개변수
이름 | 유형 | 설명 |
fontSize | Integer | 원하는 글꼴 크기입니다. |
리턴
TextStyleBuilder
: 연결을 위한 빌더입니다.
setForegroundColor(cssString)
텍스트 글꼴 색상을 설정합니다.
매개변수
이름 | 유형 | 설명 |
cssString | String | CSS 표기법으로 지정된 원하는 글꼴 색상 (예: '#ffffff' 또는 'white' )입니다. |
리턴
TextStyleBuilder
: 연결을 위한 빌더입니다.
setForegroundColorObject(color)
setItalic(italic)
텍스트의 기울임꼴 여부를 설정합니다.
매개변수
이름 | 유형 | 설명 |
italic | Boolean | 텍스트가 기울임꼴인지 여부입니다. |
리턴
TextStyleBuilder
: 연결을 위한 빌더입니다.
setStrikethrough(strikethrough)
텍스트에 취소선이 있는지 여부를 설정합니다.
매개변수
이름 | 유형 | 설명 |
strikethrough | Boolean | 텍스트에 취소선이 있는지 여부입니다. |
리턴
TextStyleBuilder
: 연결을 위한 빌더입니다.
setUnderline(underline)
텍스트에 밑줄을 표시할지 여부를 설정합니다.
매개변수
이름 | 유형 | 설명 |
underline | Boolean | 텍스트에 밑줄이 표시되는지 여부입니다. |
리턴
TextStyleBuilder
: 연결을 위한 빌더입니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 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."]]