Text rendering configuration

文字渲染配置

构造函数

属性

atlasGridW: number = 16

Cell size of AtlasGrid

AtlasGrid的单元格大小

atlasWidth: number = 1024

Width and height of each text atlas. A new atlas will be created when it is full.

每张文字图集的宽度和高度。如果满了会创建新的图集。

fontScale: number = 1

Global font scaling factor. If scaleFontWithCtx is set, this value will be automatically set according to the stage scale.

设定字体全局缩放,如果设置了scaleFontWithCtx,则这个值会根据舞台比例自动设置。

forceSplitRender: boolean = false

Force single character rendering mode.

强制使用单字渲染模式。

forceWholeRender: boolean = false

强制整句渲染模式。

Force whole sentence rendering mode.

maxCanvasWidth: number = 4096

Maximum canvas size

canvas的最大值

maxFontScale: number = 3

Maximum allowed scaling factor when scaleFontWithCtx is true

当scaleFontWithCtx为true时,最大允许放大的倍数

noAtlas: boolean = false

If set to true, text will not use atlas and all texts will use independent textures. (Single character rendering mode excepted)

设置为true则强制不使用图集,所有文本都用独立贴图。(单字渲染模式除外)

scaleFontWithCtx: boolean = true

如果舞台有缩放,则修改渲染大小,以保证清晰度

If the stage is scaled, modify the rendering size to ensure clarity

standardFontSize: number = 32

Standard font size used for measurement

测量时使用的标准字体大小

useTextureArray: boolean = true

Whether to use texture array for text rendering

是否使用纹理数组进行文字渲染