Giter VIP home page Giter VIP logo

Comments (4)

galvesribeiro avatar galvesribeiro commented on May 14, 2024

Hello @schwarmau, thanks for the report.

I'll investigate the issue as soon as I get home.

Perhaps this is related to the reason Width will not work as well.

Idk which width are you referring to but, if that is the width of the component, you need to specify it as there is no default.

Will get back to you asap.

from canvas.

schwarmau avatar schwarmau commented on May 14, 2024

Idk which width are you referring to but, if that is the width of the component, you need to specify it as there is no default.

I think I worded my sentence poorly. I meant to say: Perhaps the lack of support for other properties of TextMetrics (such as actualBoundingBoxLeft, see: https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics) might be affecting the supported property of TextMetrics (width). I haven't done much testing of this, though, so I'm not sure.

from canvas.

galvesribeiro avatar galvesribeiro commented on May 14, 2024

Hello @schwarmau

Yes, some properties are not being set and that affect the precision of TextMetrics.

I'll mark this issue as a bug and will make sure it goes in on the next release.

If you want it faster, please feel free to submit a PR and I'll review/merge it right away.

Thanks!

from canvas.

WilStead avatar WilStead commented on May 14, 2024

I looked into this. TextMetrics.width is not an enumerable property (in the current spec, it has no enumerable properties at all; don't ask me why). As a result, it is always serialized to JSON as an empty object ("{}").

I'll look into writing up a PR that converts the native TextMetrics object to a DTO with a standard, enumerable width property that can be properly serialized.

from canvas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.