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

b.fitText() #112

Open
trych opened this issue Oct 24, 2016 · 1 comment
Open

b.fitText() #112

trych opened this issue Oct 24, 2016 · 1 comment
Assignees

Comments

@trych
Copy link
Contributor

trych commented Oct 24, 2016

As discussed in #108, a b.fitText() method would be nice, to fit an existing text to its textFrame (and I can confirm @ffd8 impression, that request/demand comes up all the time).

It could work like this b.fitText(textContainer, [textProperty]), where textProperty is an optional property, if the user would like to use another property instead of point size. Only properties that change the horizontal width of text should be allowed though.

@ffd8, in the other issue you stated

It could be connected to the b.typo function to accept any of those attributes which are number based and regularly check for overflow

What exactly do you mean by «it could be connected to b.typo»? That it should be used together with it? Or that the syntax works in the same way?

There was a nice algorithm by jongware for filling text frames (based on point size only) that I used in my bachelor's project as well, I will try to find the original link.

Edit: Here it is. Although I have to admit that my final implementation was quite a bit more complicated, as there were a lot of pitfalls to look out for. Then again, I was somewhat in a hurry, so when done properly this could probably be implemented quite nicely.

@b-g
Copy link
Member

b-g commented Oct 25, 2016

+1, yes this pops up very often!

@trych trych self-assigned this Nov 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants