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

support for different fonts (family, trait & size) in highlighter #92

Closed
NeomMob opened this issue May 1, 2016 · 4 comments
Closed

Comments

@NeomMob
Copy link

NeomMob commented May 1, 2016

I didn't found how to set up differents fonts in the highlighter. Is it supported and if not, do you have any direction for the implementation?

@shysaur
Copy link
Owner

shysaur commented May 2, 2016

Currently, highlighting by changing anything but color is unsupported because, all highlighting is done by setting temporary attributes on the layout manager. Temporary attributes can't affect layout; this means that trying to set the font with temporary attributes won't have any effect.

The only way to do this would be to change the attributes in the text storage, but since a text view's text storage can be modified by other parts of the application in unexpected ways, this is not really feasible. Some trickery would be needed to hide Fragaria's attributes from the rest of the application. But, even if we do that, it might interact in some unexpected way with the text view, because Fragaria sets isRichText to YES.

To sum it up, it's probably doable, but not in an easy way.

@shysaur
Copy link
Owner

shysaur commented May 2, 2016

BTW, this is a duplicate of #70.

@NeomMob
Copy link
Author

NeomMob commented May 2, 2016

Thanks for the explanation. I tried to modify if (mode from temporary attributes to directly setting attribute in the text storage) but performance is really impacted (+ the potential side effects you described)

@shysaur
Copy link
Owner

shysaur commented Apr 28, 2019

Fixed in 6b16cef (see issue #70).

@shysaur shysaur closed this as completed Apr 28, 2019
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