# How can I get width of point text?

**URL:** <https://forums.creativeclouddeveloper.com/t/how-can-i-get-width-of-point-text/432>\
**Category:** UXP Plugin API\
**Tags:** javascript\
**Created:** [November 21, 2018, 5:56pm UTC](https://forums.creativeclouddeveloper.com/t/how-can-i-get-width-of-point-text/432 "2018-11-21T17:56:44Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonfontanez](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/jonfontanez/32/126_2.png) [@jonfontanez](https://forums.creativeclouddeveloper.com/u/jonfontanez)\
**Post date:** [November 21, 2018, 5:56pm UTC](https://forums.creativeclouddeveloper.com/t/how-can-i-get-width-of-point-text/432/1 "2018-11-21T17:56:44Z")

</div>

I’m creating a sample plug-in that generates text. It seems by default Text is set to pointText and dynamically resizes based on content but width is only available for AreaText because it’s a statically defined rectangle (maybe?).

Is there a way to get the calculated width of point text from XD (that takes into consideration font styles) ?

---

<div class="post-metadata">

**Author:** ![pklaschka](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pklaschka/32/3162_2.png) [@pklaschka](https://forums.creativeclouddeveloper.com/u/pklaschka)\
**Post date:** [November 21, 2018, 6:16pm UTC](https://forums.creativeclouddeveloper.com/t/how-can-i-get-width-of-point-text/432/2 "2018-11-21T18:16:14Z")

</div>

I think `textNode.localBounds.width` should contain what you’re looking for (I can’t test it right now, but I think I’ve used that before)…

See [https://adobexdplatform.com/plugin-docs/reference/scenegraph.html#SceneNode-localBounds](https://adobexdplatform.com/plugin-docs/reference/scenegraph.html#SceneNode-localBounds)

---

<div class="post-metadata">

**Author:** ![jonfontanez](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/jonfontanez/32/126_2.png) [@jonfontanez](https://forums.creativeclouddeveloper.com/u/jonfontanez)\
**Post date:** [November 21, 2018, 7:04pm UTC](https://forums.creativeclouddeveloper.com/t/how-can-i-get-width-of-point-text/432/3 "2018-11-21T19:04:09Z")

</div>

Awesome! Thanks I’ll give it a try

---

<div class="post-metadata">

**Author:** ![PramUkesh](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pramukesh/32/102_2.png) [@PramUkesh](https://forums.creativeclouddeveloper.com/u/PramUkesh)\
**Post date:** [November 21, 2018, 7:12pm UTC](https://forums.creativeclouddeveloper.com/t/how-can-i-get-width-of-point-text/432/4 "2018-11-21T19:12:12Z")

</div>

@jonfontanez hey are you on mac

---

<div class="post-metadata">

**Author:** ![jonfontanez](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/jonfontanez/32/126_2.png) [@jonfontanez](https://forums.creativeclouddeveloper.com/u/jonfontanez)\
**Post date:** [November 21, 2018, 7:14pm UTC](https://forums.creativeclouddeveloper.com/t/how-can-i-get-width-of-point-text/432/5 "2018-11-21T19:14:46Z")

</div>

I’m using Windows 10 for AdobeXD plug-in development (I have an old MacBook pro I use for testing)

---

<div class="post-metadata">

**Author:** ![PramUkesh](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pramukesh/32/102_2.png) [@PramUkesh](https://forums.creativeclouddeveloper.com/u/PramUkesh)\
**Post date:** [November 21, 2018, 7:15pm UTC](https://forums.creativeclouddeveloper.com/t/how-can-i-get-width-of-point-text/432/6 "2018-11-21T19:15:30Z")

</div>

@jonfontanez could you do me a favour on mac

---

<div class="post-metadata">

**Author:** ![jonfontanez](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/jonfontanez/32/126_2.png) [@jonfontanez](https://forums.creativeclouddeveloper.com/u/jonfontanez)\
**Post date:** [November 21, 2018, 7:17pm UTC](https://forums.creativeclouddeveloper.com/t/how-can-i-get-width-of-point-text/432/7 "2018-11-21T19:17:34Z")

</div>

Yeah sure, do you want to direct message me?

---

<div class="post-metadata">

**Author:** ![PramUkesh](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pramukesh/32/102_2.png) [@PramUkesh](https://forums.creativeclouddeveloper.com/u/PramUkesh)\
**Post date:** [November 21, 2018, 7:17pm UTC](https://forums.creativeclouddeveloper.com/t/how-can-i-get-width-of-point-text/432/8 "2018-11-21T19:17:43Z")

</div>

You just want to test my plugin because i got mail from adobe that some feature is not working i think it fails on mac because i test it on windows its working

---

<div class="post-metadata">

**Author:** ![jonfontanez](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/jonfontanez/32/126_2.png) [@jonfontanez](https://forums.creativeclouddeveloper.com/u/jonfontanez)\
**Post date:** [November 21, 2018, 7:18pm UTC](https://forums.creativeclouddeveloper.com/t/how-can-i-get-width-of-point-text/432/9 "2018-11-21T19:18:17Z")

</div>

No problem, send me a link to install it and I’ll give a try now

---

<div class="post-metadata">

**Author:** ![PramUkesh](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pramukesh/32/102_2.png) [@PramUkesh](https://forums.creativeclouddeveloper.com/u/PramUkesh)\
**Post date:** [November 21, 2018, 7:20pm UTC](https://forums.creativeclouddeveloper.com/t/how-can-i-get-width-of-point-text/432/10 "2018-11-21T19:20:10Z")

</div>

its on Plugin Repo name is Material Coḻor Pallets

---

<div class="post-metadata">

**Author:** ![PramUkesh](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pramukesh/32/102_2.png) [@PramUkesh](https://forums.creativeclouddeveloper.com/u/PramUkesh)\
**Post date:** [November 21, 2018, 7:21pm UTC](https://forums.creativeclouddeveloper.com/t/how-can-i-get-width-of-point-text/432/11 "2018-11-21T19:21:32Z")

</div>

what you have to do is install and read details provided while installing and use all shortcuts if shortcuts fails then go to developer console and report the error

---

<div class="post-metadata">

**Author:** ![jonfontanez](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/jonfontanez/32/126_2.png) [@jonfontanez](https://forums.creativeclouddeveloper.com/u/jonfontanez)\
**Post date:** [November 21, 2018, 7:30pm UTC](https://forums.creativeclouddeveloper.com/t/how-can-i-get-width-of-point-text/432/12 "2018-11-21T19:30:46Z")

</div>

Here’s what I found:

- command + space conflicts with finder
- Add color to fav is confusing, wasn’t obvious what a fav is, couldn’t get the hot key to work
- Not quite sure what select current color was for
- Unclear when there is a failure due to no artboard being present (could you present an alert when no artboard is selected?)
- may want to use commands.group for the created color objects to organize colors

Overall though, I did like the palette that it generated

---

<div class="post-metadata">

**Author:** ![PramUkesh](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pramukesh/32/102_2.png) [@PramUkesh](https://forums.creativeclouddeveloper.com/u/PramUkesh)\
**Post date:** [November 21, 2018, 7:34pm UTC](https://forums.creativeclouddeveloper.com/t/how-can-i-get-width-of-point-text/432/13 "2018-11-21T19:34:38Z")

</div>

so on mac cmd + space opens finder right

fav is refer to top most pallets of remaining pallets

select current color puts it on big pallet and shows light and dark version of that color
