FontSize Object Members in SuiteScript Reference
The FontSize object in SuiteScript enables precise control over font styling in workbooks, including size and unit specifications.
The FontSize object provides developers with properties to manage font sizes in workbook scripts effectively. This object enables precise specification of font dimensions, which is essential for creating well-formatted documents and reports.
What is the FontSize Object?
The FontSize object is utilized within the workbook.createStyle(options) method. It allows developers to define font specifications for workbook styles dynamically.
Available Members of the FontSize Object
The members of the FontSize object include:
| Member Name | Type | Description | Supported Script Types |
|---|---|---|---|
| FontSize.size | number | Numeric size of the font | Server scripts |
| FontSize.unit | string | Unit of the font size | Server scripts |
How to Use the FontSize Object
Developers can create a FontSize object using the following syntax:
var myFontSize = workbook.createFontSize({ // myFontSize is a workbook.FontSize size: 12, unit: workbook.UNIT.PX});This example initializes the font size as 12 pixels, allowing for flexibility in document design. Ensure that the size is a number to avoid the WRONG_PARAMETER_TYPE error.
Additional Code Example
Here’s how to use the FontSize object in conjunction with other style properties:
var mySecondStyle = workbook.createStyle({ fontSize: workbook.FontSize.LARGE, fontStyle: workbook.FontStyle.ITALIC, fontWeight: workbook.FontWeight.BOLD});Best Practices
Important: Always ensure the numeric values are valid to prevent runtime errors. Also, review the expected units when defining font sizes as dealing with different units can impact document rendering.
Conclusion
By utilizing the FontSize object, users can enhance their workbook styling capabilities effectively, allowing for greater control over how information is presented visually.
Source: This article is based on Oracle's official NetSuite documentation.
Key Takeaways
- The FontSize object allows for customizable font properties in SuiteScript.
- Key members include size and unit, both of which are essential for precise styling.
- Use the workbook.createFontSize() function to create FontSize objects efficiently.
Frequently Asked Questions (4)
How do I initialize a FontSize object in SuiteScript?
What script types support the FontSize object's members?
What error might occur if I use an incorrect data type for the size property in FontSize?
Can the FontSize object be used with other style properties in a workbook?
Was this article helpful?
More in General
- Payment Date Prediction Feature in NetSuite
Payment Date Prediction in NetSuite utilizes machine learning to enhance financial planning by predicting invoice payment dates.
- NetSuite Ship Central Enhancements for Packing & Shipping
NetSuite Ship Central features enhance packing and shipping operations for improved efficiency and accuracy.
- New Role Setup for NetSuite AI Connector Service in 2026.1
The 2026.1 release adds a new role requirement for the NetSuite AI Connector Service, streamlining custom tool development.
- Generative AI Features in NetSuite 2026.1
Discover new generative AI features in NetSuite 2026.1, enhancing reporting, search, predictions, and development productivity.
Advertising
Reach General Professionals
Put your product in front of NetSuite experts who work with General every day.
Sponsor This Category