Worker
Worker

Reputation: 2409

Why FeathersUI Label cuts letters

I develop my app with AIR, Starling and FeatherUI for iOS.

I use Label with TextBlockTextRenderer (flash.text.engine.TextBlock).

I faced the following problem: http://monosnap.com/image/1chKMEoG2fDufCMJIdrgcX3dcTbLMa

In short: Some parts of letters are being cut. (this issue affect languages that has high glyphs, like Norway, German, Arabic etc...)

I already did ask the question about possible fix for this issue: http://forum.starling-framework.org/topic/why-does-label-cuts-letters but suggested workarounds are only good for certain cases. They do not solve the whole problem.

What I know so far:

  1. baselineZero property doesn't work for me. See description here: http://forum.starling-framework.org/topic/why-does-label-cuts-letters#post-61471

  2. Settings baselineFontDescription works but cannot be used as proper workaround - you have to manually measure baselineFontSize all the time. See description here: http://forum.starling-framework.org/topic/why-does-label-cuts-letters#post-61471

Any ideas how to fix this issue?

Upvotes: 1

Views: 127

Answers (1)

Alexander Mokretsov
Alexander Mokretsov

Reputation: 48

The workaround i am currently using is to add transparent shadow filter. You may ned to increase radius depending on your font.

This is by no means a good solution, just a dirty temporary fix.

 public static function defaultTextRendererFactory():ITextRenderer
 {
    // Transparent shadow helps to avoid clipping on some fonts
    var clipFix:DropShadowFilter = new DropShadowFilter(0.0, 0.0, 0x000000, 0.0, 2.0, 2.0, 0.0);
    var textRenderer:TextBlockTextRenderer = new TextBlockTextRenderer();
    textRenderer.nativeFilters = [clipFix];
    return textRenderer;
 }

Upvotes: 0

Related Questions