Open itlancer opened 5 years ago
FYI one of the guys has investigated this, we get text metrics back from Android or whichever platform it is, and these don't appear to take account of italic text like this: https://stackoverflow.com/questions/6745047/android-measuretext-on-paint-object-for-italic-rendered-fonts
So it's a bit of a workaround but if we detect the character is italic, we can add some additional width for the field based on the height of the text and the italic slant (Android apparently has 0.25; Flash uses 0.21 for embedded rendering)...
Hi, @ajwfrost
It's not Android specific. The same problem with AIR on all platforms: Windows, Android, macOS, iOS if you use non-embedded fonts.
Embedded fonts with TextField::embedFonts=true
displays correctly in such cases.
So described problem only with device (system installed) fonts or default _sans
etc.
Yes, it seems pretty prevalent across all platforms - e.g. here's some folk trying to work around the same problem on Windows: https://www.codeproject.com/Articles/14915/Width-of-Text-in-Italic-Font
We're trying to ensure the changes we're making will help both when using autoSize and, and also just when measuring textWidth (so e.g. textField.width = textField.textWidth; has the same issue currently..)
Thank you! Waiting for a new release.
Fixed and looks great with AIR 33.0.2.315 for Android! But issue still exists for other platforms.
With AIR 33.0.2.338 also fixed for Windows. Great job! Waiting fixes for macOS and iOS.
With AIR 33.1.0.16 it fixed for macOS and iOS too. Waiting same fix for tvOS and would like to see it in production release.
Problem Description
Italic TextField (italic property of TextFormat is true) cuts off last symbol when autoSize property used. No matter font and size. It's very old bug described even there in 2009: http://stackoverflow.com/questions/1516391/textfield-autosizeitalics-cuts-of-last-character It has been tested with many different Flash Player, AIR versions and devices and its architectures even with latests AIR 32.0.0.144 beta and AIR 33.0.1.220. Always the same problem.
Tracker link: https://tracker.adobe.com/#/view/AIR-3810978
Steps to Reproduce
Create TextField with italic formatting and set autoSize property to TextFieldAutoSize.LEFT, for example. Launch code below.
Actual Result: Last symbol cuts off. See attached screenshot.![screenshot](https://user-images.githubusercontent.com/10899066/63338090-d597c380-c34a-11e9-9ba5-ef29ca8a5f4e.png)
Expected Result: Autosized TextField field with correct displaying all symbols.
Known Workarounds
Manually control size of TextField field like here http://stackoverflow.com/questions/1516391/textfield-autosizeitalics-cuts-of-last-character