@univerjs/engine-render v0.5.0-beta.1 • Docs
Class: FontCache
Constructors
new FontCache()
new FontCache(): FontCache
Returns
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
Parameter | Type | Default value |
---|---|---|
cacheLimit | number | 1000000 |
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
Parameter | Type |
---|---|
path | string |
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
Parameter | Type |
---|---|
fontFamily | string |
fontSize | number |
Returns
{
sbo: fontSize;
sbr: 0.6;
spo: fontSize;
spr: 0.6;
}
Name | Type | Default value | Defined in |
---|---|---|---|
sbo | number | fontSize | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:34 |
sbr | number | 0.6 | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:33 |
spo | number | fontSize | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:36 |
spr | number | 0.6 | packages/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
Parameter | Type |
---|---|
glyphInfo | IOpenTypeGlyphInfo |
fontStyle | IDocumentSkeletonFontStyle |
Returns
{
aba: number;
abd: number;
ba: number;
bd: number;
sbo: number;
sbr: 0.6;
sp: number;
spo: number;
spr: 0.6;
width: number;
}
Name | Type | Default value | Defined in |
---|---|---|---|
aba | number | - | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:370 |
abd | number | - | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:371 |
ba | number | - | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:368 |
bd | number | - | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:369 |
sbo | number | - | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:376 |
sbr | number | 0.6 | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:373 |
sp | number | - | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:372 |
spo | number | - | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:377 |
spr | number | 0.6 | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:374 |
width | number | - | 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
Parameter | Type |
---|---|
fontStyle | string |
content | string |
Returns
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
Parameter | Type |
---|---|
content | string |
fontString | string |
Returns
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
Parameter | Type |
---|---|
content | string |
fontStyle | IDocumentSkeletonFontStyle |
Returns
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
Parameter | Type |
---|---|
text | string |
fontStyle | string |
Returns
{
height: number;
width: number;
}
Name | Type | Defined in |
---|---|---|
height | number | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:61 |
width | number | packages/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
Parameter | Type |
---|---|
fontStyle | string |
content | string |
tm | IMeasureTextCache |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:73