> For the complete documentation index, see [llms.txt](https://canvacard.srgobi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://canvacard.srgobi.com/utils/username.utils.md).

# Username

### parseUsername ⇒ `Object`

Function that parses the username to fit the canvas size.

**Kind**: global variable\
**Returns**: `Object` - { username: string, newSize: number, textLength: number }

| Param           | Type          | Default     | Description         |
| --------------- | ------------- | ----------- | ------------------- |
| username        | `string`      |             | User name           |
| ctx             | `Object`      |             | Canvas context      |
| ctx.fillStyle   | `string`      |             | Text color          |
| ctx.textAlign   | `string`      |             | Text alignment      |
| ctx.measureText | `TextMetrics` |             | Text size           |
| \[font]         | `string`      | `"'Arial'"` | Text source         |
| size            | `string`      |             | Text size           |
| maxLength       | `number`      |             | Maximum text length |
