🪄
Canvacard
  • 🥳Welcome
  • 🗂️Classes
    • 🎨Welcome / Leave
    • 🎮FortniteShop
    • 🎯Canvacard
    • 🎶Spotify
    • 🏆Rank
    • 🖋️Plugins
  • 🧰Utils
    • 🔧Abbreviate
    • 🖼️Canvas
    • 🕒Discord Time
    • ⚠️Error
    • 🏳️Flags
    • 🔍Format and Validate Hex
    • ⏰Format Time
    • 📏Format Variable
    • 📅Get Date or String
    • 🔍Icon
    • 🔢Is Number
    • 🔤Is String
    • 🖼️Parse Image
    • 📄Parse PNG
    • 📄Parse SVG
    • 🔽Shorten
    • ✂️Truncate Text
    • 👤Username
Powered by GitBook
On this page
  1. Utils

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

PreviousTruncate Text

Last updated 7 months ago

🧰
👤