Skip to content

[Android] Fonts rendering pixelated and cut off with some devices using <newFontRenderingFromAPI>0</newFontRenderingFromAPI> #4192

@itlancer

Description

@itlancer

Problem Description

Fonts rendering pixelated and cut off with some Android devices using <newFontRenderingFromAPI>0</newFontRenderingFromAPI>.

Tested with latest AIR 51.3.1.3 cause before it cannot be fully used because of #1950 (comment)
Seems issue exists with some old Android versions and/or some devices. And cannot be observed only with some texts (not all). Seems pixels rounding or something.
"Problem" devices at least (maybe problem with "any old Android") :

  • x96mini TV box with Android 7.1.2, armv7
  • x96max TV box with Android 9, armv7
  • H96 Pro TV box with Android 7.1.2, armv7

There is no such issue without <newFontRenderingFromAPI>0</newFontRenderingFromAPI> line in application manifest.
There is no such issues observed using Android 11, 15 devices (physical and emulators).
Also there is no such issues with other platforms.

Related issues:
#1950
#967
#3808
#3757
#867
#3508
#3191
#150
#2574

Steps to Reproduce

Launch application with code below with some "problem" Android 7/9 device.

Application example with sources and screenshots attached.
android_newfontrenderingfromapi_cut_bug.zip

package {
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;
	
	public class AndroidNewFontRenderingFromAPICutBug extends Sprite {
		
		public function AndroidNewFontRenderingFromAPICutBug() {
			addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e:Event):void {
			removeEventListener(Event.ADDED_TO_STAGE, init);
			
			var text:TextField = new TextField();;
			text.autoSize = TextFieldAutoSize.LEFT;
			const textTormat:TextFormat = new TextFormat("_sans", 50);
			text.defaultTextFormat = textTormat;

			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.stageFocusRect = false;
			
			text.text = "Stat units accumulatedrr";
			addChild(text);
		}
	}
}

Actual Result:
Text looks pixelated and last symbol cut off:
Image

Expected Result:
Text not pixelated and last symbol not cut off:
Image

Known Workarounds

Do not use <newFontRenderingFromAPI>0</newFontRenderingFromAPI> but in this case emoji cannot be displayed on old Android versions and also you will get this issue #967

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions