Skip to content

Commit 1088302

Browse files
authored
This closes #1535, add documentation for the fields for style alignment
1 parent 49234fb commit 1088302

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

styles.go

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,11 @@ func parseFormatStyleSet(style *Style) (*Style, error) {
162162
return style, err
163163
}
164164

165-
// NewStyle provides a function to create the style for cells by given style
166-
// options. This function is concurrency safe. Note that the 'Font.Color' field
167-
// uses an RGB color represented in 'RRGGBB' hexadecimal notation.
165+
// NewStyle provides a function to create the style for cells by a given style
166+
// options, and returns style index. The same style index can not be used
167+
// across different workbook. This function is concurrency safe. Note that
168+
// the 'Font.Color' field uses an RGB color represented in 'RRGGBB' hexadecimal
169+
// notation.
168170
//
169171
// The following table shows the border types used in 'Border.Type' supported by
170172
// excelize:
@@ -236,6 +238,18 @@ func parseFormatStyleSet(style *Style) (*Style, error) {
236238
// 8 | darkUp | 18 | gray0625
237239
// 9 | darkGrid | |
238240
//
241+
// The 'Alignment.Indent' is an integer value, where an increment of 1
242+
// represents 3 spaces. Indicates the number of spaces (of the normal style
243+
// font) of indentation for text in a cell. The number of spaces to indent is
244+
// calculated as following:
245+
//
246+
// Number of spaces to indent = indent value * 3
247+
//
248+
// For example, an indent value of 1 means that the text begins 3 space widths
249+
// (of the normal style font) from the edge of the cell. Note: The width of one
250+
// space character is defined by the font. Only left, right, and distributed
251+
// horizontal alignments are supported.
252+
//
239253
// The following table shows the type of cells' horizontal alignment used
240254
// in 'Alignment.Horizontal':
241255
//
@@ -259,6 +273,24 @@ func parseFormatStyleSet(style *Style) (*Style, error) {
259273
// justify
260274
// distributed
261275
//
276+
// The 'Alignment.ReadingOrder' is an uint64 value indicating whether the
277+
// reading order of the cell is left-to-right, right-to-left, or context
278+
// dependent. the valid value of this field was:
279+
//
280+
// Value | Description
281+
// -------+----------------------------------------------------
282+
// 0 | Context Dependent - reading order is determined by scanning the
283+
// | text for the first non-whitespace character: if it is a strong
284+
// | right-to-left character, the reading order is right-to-left;
285+
// | otherwise, the reading order left-to-right.
286+
// 1 | Left-to-Right: reading order is left-to-right in the cell, as in
287+
// | English.
288+
// 2 | Right-to-Left: reading order is right-to-left in the cell, as in
289+
// | Hebrew.
290+
//
291+
// The 'Alignment.RelativeIndent' is an integer value to indicate the additional
292+
// number of spaces of indentation to adjust for text in a cell.
293+
//
262294
// The following table shows the type of font underline style used in
263295
// 'Font.Underline':
264296
//

0 commit comments

Comments
 (0)