Skip to content

Text width calculation #40

@demensky

Description

@demensky

Problem

Having text in SVG is never easy. I found a few problems with text width calculation:

diagram (3)
diagram (5)
diagram (6)

Possible Solution

There is an opentype.js library. It allows you to parse font files and do various manipulations with them. One of them is the calculation of the width of the text.

I propose to calculate the size of the text using this library and adjust the size of the elements.

Also! This may help to remove the <foreignObject /> hack.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions