[]
        
(Showing Draft Content)

GC.Spread.Sheets.PDF.PDFFontsManager

Class: PDFFontsManager

Sheets.PDF.PDFFontsManager

Table of contents

Constructors

Methods

Constructors

constructor

new PDFFontsManager()

Represent a pdf fonts manager.

Methods

fallbackFont

Static fallbackFont(font): any

Provide a fallback font for the specific font.

static

example

// import fonts file
var font = {
    normal: fontsObj['customFont2.ttf']
};
GC.Spread.Sheets.PDF.PDFFontsManager.fallbackFont = function (font) {
    var fontInfoArray = font.split(' '), fontName = fontInfoArray[fontInfoArray.length - 1];
    if (fontName === 'Calibri') {
        return fonts.normal;
    }
}

Parameters

Name Type Description
font string the css font string.

Returns

any

The font file in base64 string or ArrayBuffer.


registerFont

Static registerFont(name, font): void

Register a Font for export PDF.

static

example

// import fonts file
var font = {
    normal: fonts['customFont1.ttf']
};
GC.Spread.Sheets.PDF.PDFFontsManager.registerFont('customFont1', font);

Parameters

Name Type Description
name string The font name.
font Object -

Returns

void