Skip to content
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

typo() return value #258

Open
trych opened this issue Mar 10, 2018 · 3 comments
Open

typo() return value #258

trych opened this issue Mar 10, 2018 · 3 comments

Comments

@trych
Copy link
Contributor

trych commented Mar 10, 2018

Working on adding text placement for shapes, I just realized that I find the return functionality of the typo() function really odd.

If I use it as a getter and try to get the point size of a text frame's text for example, it returns an array of the point size of each paragraph in the text frame.

I find it really random that a paragraph is the unit that gets checked. I wonder how this is helpful to anyone (unless you specifically want to find out point size of each paragraph) and I wonder, if it would make sense to return just the point size that is considered the point size of the text frame's text:

textFrame.texts[0].pointSize

So as to always just have one value returned.

Opinions?

@ff6347
Copy link
Member

ff6347 commented Mar 10, 2018

And what happens when there is a textFrame with mixed sizes? Shouldn't it just work for characters?

@trych
Copy link
Contributor Author

trych commented Mar 10, 2018

Well, in the current version, what happens if there are paragraphs with mixed text sizes? That's just as incorrect.

Shouldn't it just work for characters?

What do you mean? That it only returns something for characters?

@trych
Copy link
Contributor Author

trych commented Mar 16, 2018

Decision was made now, that we only return the value that InDesign would return as well (which is the value of the first insertion point, I suppose). That scenario works for many use cases (getting values of words retrieved by words() etc.), improves other scenarios (getting values of a story does not return a somewhat meaningless array of values) and should considerably improve performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants