qax-os/excelize · error

ErrFontLength

ErrFontLength

Error message

the length of the font family name must be less than or equal to %d

What it means

Sentinel error ErrFontLength returned by NewStyle when the font family name in Style.Font.Family exceeds MaxFontFamilyLength characters (measured in UTF-16 code units via countUTF16String). It fires as a validation guard in NewStyle, rejecting the style definition before it is registered, because Excel cannot store font names longer than the limit.

Source

Thrown at errors.go:80

	// exists.
	ErrExistsTableName = errors.New("the same name table already exists")
	// ErrFillType defined the error message on receive an invalid fill type.
	ErrFillType = errors.New("fill type value must be one of 'gradient' or 'pattern'")
	// ErrFillGradientColor defined the error message on receive an invalid fill
	// color for 'gradient' type.
	ErrFillGradientColor = errors.New("fill color value must be an array of two colors for 'gradient' type")
	// ErrFillGradientShading defined the error message on receive an invalid
	// fill shading for 'gradient' type.
	ErrFillGradientShading = errors.New("fill shading value must be between 0 and 16 for 'gradient' type")
	// ErrFillPatternColor defined the error message on receive an invalid fill
	// color for 'pattern' type.
	ErrFillPatternColor = errors.New("fill color value must be empty or an array of one color for 'pattern' type")
	// ErrFillPattern defined the error message on receive an invalid fill
	// pattern.
	ErrFillPattern = errors.New("fill pattern value must be between 0 and 18")
	// ErrFontLength defined the error message on the length of the font
	// family name overflow.
	ErrFontLength = fmt.Errorf("the length of the font family name must be less than or equal to %d", MaxFontFamilyLength)
	// ErrFontSize defined the error message on the size of the font is invalid.
	ErrFontSize = fmt.Errorf("font size must be an integer from %d to %d points", MinFontSize, MaxFontSize)
	// ErrFormControlValue defined the error message for receiving a scroll
	// value exceeds limit.
	ErrFormControlValue = fmt.Errorf("scroll value must be an integer from 0 to %d", MaxFormControlValue)
	// ErrGroupSheets defined the error message on group sheets.
	ErrGroupSheets = errors.New("group worksheet must contain an active worksheet")
	// ErrImgExt defined the error message on receive an unsupported image
	// extension.
	ErrImgExt = errors.New("unsupported image extension")
	// ErrInvalidFormula defined the error message on receive an invalid
	// formula.
	ErrInvalidFormula = errors.New("formula not valid")
	// ErrMaxFilePathLength defined the error message on receive the file path
	// length overflow.
	ErrMaxFilePathLength = fmt.Errorf("file path length exceeds maximum limit %d characters", MaxFilePathLength)
	// ErrMaxRowHeight defined the error message on receive an invalid row
	// height.

View on GitHub (pinned to f2483381fb)

Solutions

  1. Use a shorter font family name
  2. Use a standard font name within the 31-character limit
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at errors.go:80 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of qax-os/excelize@f2483381fb (2026-09-02). Data as JSON: /api/errors/de20b35e72867ab7. Report an issue: GitHub.