- ai_enabled
- Posts: 231
- Joined:
- Contact:
Setting the text hinting
Hi guys,
I'm curious if there is a way to apply something like WPF TextOptions.TextHintingMode="Animated" to the textblock?
The use case is the credits menu in the game - it's scrolled every frame on some small distance. The text produces some flickering while scrolling - I suppose this is related to the text hinting.
AFAIK, I could avoid this by using a storyboard - as the animated text is automatically should not be hinted - but rewriting the already perfectly implemented code from scroll viewer to something custom is out of the question.
Regards!
I'm curious if there is a way to apply something like WPF TextOptions.TextHintingMode="Animated" to the textblock?
The use case is the credits menu in the game - it's scrolled every frame on some small distance. The text produces some flickering while scrolling - I suppose this is related to the text hinting.
AFAIK, I could avoid this by using a storyboard - as the animated text is automatically should not be hinted - but rewriting the already perfectly implemented code from scroll viewer to something custom is out of the question.
Regards!
AtomicTorch Studio Pte. Ltd. http://atomictorch.com
Re: Setting the text hinting
Hinting is always enabled (for now we only expose a compile time macro to disable it) but I think the problem you are observing is the snapping (moving the quad to the nearest pixel, so if it is in 5.23 we move it to 5.00). Snapping is only applied to static text and only vertically, once the text is animated the snapping is temporarily disabled to allow subpixel positioning and smooth movement.
So If I understand you correctly, this text is only being animated during a few frames, the it stops and then it animates again?
So If I understand you correctly, this text is only being animated during a few frames, the it stops and then it animates again?
- ai_enabled
- Posts: 231
- Joined:
- Contact:
Re: Setting the text hinting
Right, this seems to be related to the text snapping. I've tried to disable SnapsToDevicePixel but can't see any difference.
We're not actually using animation but simply adjusting the vertical scroll offset every frame. This way it's much easier to program the complex behavior we need (so it's possible to scroll using the scroll wheel, press-and-move like with the touch controls, simply scroll every frame on some constant distance, and also the scroll viewer is looped so when it's reaching the end it starts from the beginning).
You can see this in our game which is released in Early Access now! :-) Credits menu.
Regards!
We're not actually using animation but simply adjusting the vertical scroll offset every frame. This way it's much easier to program the complex behavior we need (so it's possible to scroll using the scroll wheel, press-and-move like with the touch controls, simply scroll every frame on some constant distance, and also the scroll viewer is looped so when it's reaching the end it starts from the beginning).
You can see this in our game which is released in Early Access now! :-) Credits menu.
Regards!
AtomicTorch Studio Pte. Ltd. http://atomictorch.com
Re: Setting the text hinting
Yes, I saw it! And I am a bit confused because in my machine the quality is quite good. I can slightly notice the snapping being activated when I stop the scroll by clicking with the mouse. Is that the behavior you want to improve, when the scroll is manually stopped and snapping is enabled? Because, during the scroll the text is moving and no snapping is being applied.
- ai_enabled
- Posts: 231
- Joined:
- Contact:
Re: Setting the text hinting
I definitely can see the text glimmering more than it should when it slowly scrolls up. Especially noticeable on 1920x1080 or lower resolution screen.
And the text is very clear every frame. So I assume the snapping is applied every frame as the text is not actually animated via storyboard, but the scroll value is manipulated vertically.
And the text is very clear every frame. So I assume the snapping is applied every frame as the text is not actually animated via storyboard, but the scroll value is manipulated vertically.
AtomicTorch Studio Pte. Ltd. http://atomictorch.com
Re: Setting the text hinting
Is the scroll chaning per frame? Even if the text movement is caused by moving the scroll we disable the snapping. So I am not sure if you are observing bilinear artifacts instead. Could you please make a small video capture?
Anyway, we should expose a property to indicate that a text shouldn't be snapped...
Anyway, we should expose a property to indicate that a text shouldn't be snapped...
- ai_enabled
- Posts: 231
- Joined:
- Contact:
Re: Setting the text hinting
Thanks for your responses. Yes, the scroll value is changed every frame.
Well, it doesn't look bad, I just wanted to be sure the pixel snapping is disabled :-) Support for TextOptions.TextHintingMode="Animated" would have helped me to ensure this, but if you're 100% certain the snapping is disabled if the scroll value is changed every frame, then I can rest assured that I did my best with it!
Regards!
Well, it doesn't look bad, I just wanted to be sure the pixel snapping is disabled :-) Support for TextOptions.TextHintingMode="Animated" would have helped me to ensure this, but if you're 100% certain the snapping is disabled if the scroll value is changed every frame, then I can rest assured that I did my best with it!
Regards!
AtomicTorch Studio Pte. Ltd. http://atomictorch.com
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 61 guests