Skip to content

Cannot use textwrapping function #10

@paul097958

Description

@paul097958
function renderWrappedText(ctx, value, width, x, y, fontSize, lineHeight) {
    ctx.font = "600 " + fontSize + "px sans-serif";

    let lines = split(ctx, value, fontSize + "px sans-serif", width, true);

    for (const line of lines) {
        ctx.fillText(line, x, y);
        y += lineHeight;
    }
}

I use this code to make my project, and if I don't setctx.font = "600 " + fontSize + "px sans-serif";the font will be very small. But that can make the wrapping function work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions