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

Attributed Text Support #39

Open
freshking opened this issue Jul 23, 2015 · 10 comments
Open

Attributed Text Support #39

freshking opened this issue Jul 23, 2015 · 10 comments

Comments

@freshking
Copy link

I believe the current version doesn't support morphing for attributed text. Will this be a feature in the near future?

@lexrus
Copy link
Owner

lexrus commented Jul 23, 2015

It requires tons of tweaks. I hope I have enough time to do it.

@lexrus
Copy link
Owner

lexrus commented Jul 23, 2015

Here is the concept.

┌─────────────────────────────────────────────────────────────┐
│        self.attributedString = ...SOME_NEW_STRING...        │
└─────────────────────────────────────────────────────────────┘
                               │                               
               ┌───────────────┘                               
               ▼                   ┌──────────────────────────┐
┌─────────────────────────────┐ ┌─▶│ enumerate each character │
│ draw the string off screen  │─┘  └──────────────────────────┘
└─────────────────────────────┘                  │             
                               ┌─────────────────┘             
                               ▼                               
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃     return ([rectOfChar], [colorOfChar], [fontOfChar])      ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
                               │                               
                               ▼                               
┌─────────────────────────────────────────────────────────────┐
│     calculate the new tuple by current morphingProgress     │
└─────────────────────────────────────────────────────────────┘
                               │                               
                               ▼                               
┌─────────────────────────────────────────────────────────────┐
│    draw each character on screen between display blinks     │
└─────────────────────────────────────────────────────────────┘

@jkritikos
Copy link

+100 for the effort! I tried approaching this but could not get it to work…

On Jul 23, 2015, at 4:27 PM, Lex Tang notifications@github.com wrote:

It requires tons of tweaks. I hope I have enough time to do it.


Reply to this email directly or view it on GitHub.

@LivioGama
Copy link

Oh :( I needed this feature too because I use attributed string :(

@sentiasa
Copy link

sentiasa commented May 6, 2016

Brilliant library!! That would be amazing if it supported Attributed String. @lexrus you wrote your last comment a year ago; is there any news for attributed string enhancement? In my case, the only reason I wanted to use attributed string is to be able to give 'character spacing'

@36bydesign
Copy link

+1

@rakeshtookan
Copy link

Any update on NSAttributedString or character spacing support?

@elfanek
Copy link

elfanek commented May 5, 2018

This is definitely more of a work around than a solution, but if you're trying to set character spacing you can play around with these whitespace characters and insert one between every character in your label when setting the text. I've found that thin space and punctuation space look nice, but you'll have to play around with a few to find one that fits your style guide best.

Not ideal, but it works ¯_(ツ)_/¯

@tkirby
Copy link

tkirby commented Nov 23, 2018

+1

@holla-lishuangcheng
Copy link

i want to

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

10 participants