BlockSuite API Documentation / @blocksuite/affine-block-surface / TextUtils
Variable: TextUtils
constTextUtils:object
Type declaration
getCursorByCoord()
getCursorByCoord: (
model,coord) =>number
Parameters
model
coord
x
number
y
number
Returns
number
getFontFaces()
getFontFaces: () =>
FontFace[]
Returns
FontFace[]
getFontFacesByFontFamily()
getFontFacesByFontFamily: (
fontFamily) =>FontFace[]
Parameters
fontFamily
string
Returns
FontFace[]
getLineHeight()
getLineHeight: (
fontFamily,fontSize,fontWeight) =>number
Parameters
fontFamily
string
fontSize
number
fontWeight
string
Returns
number
isFontStyleSupported()
isFontStyleSupported: (
fontFamily,style) =>boolean
Parameters
fontFamily
string
style
Returns
boolean
isFontWeightSupported()
isFontWeightSupported: (
fontFamily,weight) =>boolean
Parameters
fontFamily
string
weight
Returns
boolean
isSameFontFamily()
isSameFontFamily: (
fontFamily) => (fontFace) =>boolean
Parameters
fontFamily
string
Returns
Function
Parameters
fontFace
FontFace
Returns
boolean
normalizeTextBound()
normalizeTextBound: (
__namedParameters,bound,dragging) =>Bound
Parameters
__namedParameters
fontFamily
fontSize
number
fontStyle
fontWeight
hasMaxWidth
boolean
maxWidth
number
yText
YText
bound
Bound
dragging
boolean = false
Returns
Bound
splitIntoLines()
splitIntoLines: (
text) =>string[]
Parameters
text
string
Returns
string[]
wrapFontFamily()
wrapFontFamily: (
fontFamily) =>string
Parameters
fontFamily
string
Returns
string
Defined in
packages/affine/block-surface/src/index.ts:108