Font

更新时间:
复制 MD 格式

This topic describes the API operations that are related to the Font object of table documents.

Font

Range.Font

Queries the Font object.

  • Syntax

    expression.Range.Font

    expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Query a range object.
      const range = await app.Range('A1');
    
      // Query a font object.
      const font = range.Font;
    }

Properties

Range.Font.Size

Sets and queries the font size by using the Size property.

  • Syntax

    expression.Range.Font.Size

    expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Query a range object.
      const range = await app.Range('A1');
    
      // Query a font object.
      const font = range.Font;
    
      // Set the font size
      font.Size = 30;
    
      // Query the font size.
      const size = await font.Size;
      console.log(size);
    }