@univerjs/engine-render v0.5.4
Class: FontCache
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:60
Constructors
new FontCache()
new FontCache(): FontCache
Returns
Accessors
globalFontMeasureCache
Get Signature
get static globalFontMeasureCache(): 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
Returns
Map
<string
, Map
<string
, IMeasureTextCache
>>
Methods
autoCleanFontMeasureCache()
static autoCleanFontMeasureCache(cacheLimit): boolean
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:104
Parameters
Parameter | Type | Default value |
---|---|---|
cacheLimit | number | 1000000 |
Returns
boolean
clearFontMeasureCache()
static clearFontMeasureCache(path): boolean
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:84
Parameters
Parameter | Type |
---|---|
path | string |
Returns
boolean
getBaselineOffsetInfo()
static getBaselineOffsetInfo(fontFamily, fontSize): {
sbo: number;
sbr: number;
spo: number;
spr: number;
}
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:140
Parameters
Parameter | Type |
---|---|
fontFamily | string |
fontSize | number |
Returns
{
sbo: number;
sbr: number;
spo: number;
spr: number;
}
getBBoxFromGlyphInfo()
static getBBoxFromGlyphInfo(glyphInfo, fontStyle): {
aba: number;
abd: number;
ba: number;
bd: number;
sbo: number;
sbr: number;
sp: number;
spo: number;
spr: number;
width: number;
}
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:204
Parameters
Parameter | Type |
---|---|
glyphInfo | IOpenTypeGlyphInfo |
fontStyle | IDocumentSkeletonFontStyle |
Returns
{
aba: number;
abd: number;
ba: number;
bd: number;
sbo: number;
sbr: number;
sp: number;
spo: number;
spr: number;
width: number;
}
getFontMeasureCache()
static getFontMeasureCache(fontStyle, content): Nullable<IMeasureTextCache>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:99
Parameters
Parameter | Type |
---|---|
fontStyle | string |
content | string |
Returns
getMeasureText()
static getMeasureText(content, fontString): IMeasureTextCache
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:223
Parameters
Parameter | Type |
---|---|
content | string |
fontString | string |
Returns
getTextSize()
static getTextSize(content, fontStyle): IDocumentSkeletonBoundingBox
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:188
Parameters
Parameter | Type |
---|---|
content | string |
fontStyle | IDocumentSkeletonFontStyle |
Returns
getTextSizeByDom()
static getTextSizeByDom(text, fontStyle): {
height: number;
width: number;
}
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:166
Parameters
Parameter | Type |
---|---|
text | string |
fontStyle | string |
Returns
{
height: number;
width: number;
}
setFontMeasureCache()
static setFontMeasureCache(
fontStyle,
content,
tm): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/layout/shaping-engine/font-cache.ts:73
Parameters
Parameter | Type |
---|---|
fontStyle | string |
content | string |
tm | IMeasureTextCache |
Returns
void