-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TextMetrics Properties Do Not Get Set #11
Comments
Hello @schwarmau, thanks for the report. I'll investigate the issue as soon as I get home.
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. |
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. |
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! |
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. |
Issue
TextMetrics properties are not set after a call to MeasureText()
Code
lengthTextMetrics.Width always reports 0. I tried the equivalent of this in javascript directly and it reports 282.84.
Even in javascript, though, the other properties appear undefined. This seems to be because they are not supported by all browsers yet. Perhaps this is related to the reason Width will not work as well.
The text was updated successfully, but these errors were encountered: