* Initialize canvas state * 初始化画布状态
()
| 206 | * 初始化画布状态 |
| 207 | */ |
| 208 | private initCanvas(): void { |
| 209 | const ctx = this._ctx; |
| 210 | |
| 211 | // Clear to transparent |
| 212 | ctx.clearRect(0, 0, this._atlasWidth, this._atlasHeight); |
| 213 | |
| 214 | // Set font |
| 215 | ctx.font = `${this._fontSize}px "${this._fontFamily}"`; |
| 216 | ctx.textBaseline = 'top'; |
| 217 | ctx.fillStyle = 'white'; |
| 218 | } |
| 219 | |
| 220 | /** |
| 221 | * Measure font metrics |
no outgoing calls
no test coverage detected