@univerjs/engine-render v0.5.0-beta.1 • Docs


Class: FontCache

Constructors

new FontCache()

new FontCache(): FontCache

Returns

FontCache

Accessors

globalFontMeasureCache

Get Signature

get static globalFontMeasureCache(): Map<string, Map<string, IMeasureTextCache>>
Returns

Map<string, Map<string, IMeasureTextCache>>

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:69

Methods

autoCleanFontMeasureCache()

static autoCleanFontMeasureCache(cacheLimit): boolean

Parameters

ParameterTypeDefault value
cacheLimitnumber1000000

Returns

boolean

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:104


clearFontMeasureCache()

static clearFontMeasureCache(path): boolean

Parameters

ParameterType
pathstring

Returns

boolean

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:84


getBaselineOffsetInfo()

static getBaselineOffsetInfo(fontFamily, fontSize): {
  sbo: fontSize;
  sbr: 0.6;
  spo: fontSize;
  spr: 0.6;
}

Parameters

ParameterType
fontFamilystring
fontSizenumber

Returns

{
  sbo: fontSize;
  sbr: 0.6;
  spo: fontSize;
  spr: 0.6;
}
NameTypeDefault valueDefined in
sbonumberfontSizepackages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:34
sbrnumber0.6packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:33
sponumberfontSizepackages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:36
sprnumber0.6packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:35

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:140


getBBoxFromGlyphInfo()

static getBBoxFromGlyphInfo(glyphInfo, fontStyle): {
  aba: number;
  abd: number;
  ba: number;
  bd: number;
  sbo: number;
  sbr: 0.6;
  sp: number;
  spo: number;
  spr: 0.6;
  width: number;
}

Parameters

ParameterType
glyphInfoIOpenTypeGlyphInfo
fontStyleIDocumentSkeletonFontStyle

Returns

{
  aba: number;
  abd: number;
  ba: number;
  bd: number;
  sbo: number;
  sbr: 0.6;
  sp: number;
  spo: number;
  spr: 0.6;
  width: number;
}
NameTypeDefault valueDefined in
abanumber-packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:370
abdnumber-packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:371
banumber-packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:368
bdnumber-packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:369
sbonumber-packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:376
sbrnumber0.6packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:373
spnumber-packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:372
sponumber-packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:377
sprnumber0.6packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:374
widthnumber-packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:367

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:204


getFontMeasureCache()

static getFontMeasureCache(fontStyle, content): Nullable<IMeasureTextCache>

Parameters

ParameterType
fontStylestring
contentstring

Returns

Nullable<IMeasureTextCache>

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:99


getMeasureText()

static getMeasureText(content, fontString): IMeasureTextCache

Parameters

ParameterType
contentstring
fontStringstring

Returns

IMeasureTextCache

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:223


getTextSize()

static getTextSize(content, fontStyle): IDocumentSkeletonBoundingBox

Parameters

ParameterType
contentstring
fontStyleIDocumentSkeletonFontStyle

Returns

IDocumentSkeletonBoundingBox

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:188


getTextSizeByDom()

static getTextSizeByDom(text, fontStyle): {
  height: number;
  width: number;
}

Parameters

ParameterType
textstring
fontStylestring

Returns

{
  height: number;
  width: number;
}
NameTypeDefined in
heightnumberpackages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:61
widthnumberpackages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:61

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:166


setFontMeasureCache()

static setFontMeasureCache(
   fontStyle, 
   content, 
   tm): void

Parameters

ParameterType
fontStylestring
contentstring
tmIMeasureTextCache

Returns

void

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:73