We did update Freetype, which resolved text layout issues with certain fonts. Any chance this was broken before, and is fixed now? Are they SWF text or created dynamically?
āAny chance this was broken before, and is fixed now?ā - I do now exactly know what you mean.
The font is rendered OK in Adobe Animate and was rendered before OK in OpenFL/our game. Now its broken. Hmm.
These textfields are generated by XFL definitions.
I did lots of tests and came to the following conclusion.
There seems to be some offset of the font on Y on Android only, no matter what I have tried.
In HTML5 it works! In Flash it works! In Android not.
Cant test MacOS target as compiling seems to be broken on Mojave.
Andreass-Air:pirates_hp_code_hx andreas$ openfl test macos
Creating /Users/andreas/Development/pixelracoons/pirates_hp_code_hx/Export/macos/obj/obj/darwin64/__pch/haxe/hxcpp.h.gch...
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
/usr/local/lib/haxe/lib/hxcpp/3,4,188/include/hxcpp.h:19:13: fatal error: 'typeinfo' file not found
#include <typeinfo>
^~~~~~~~~~
1 warning and 1 error generated.
Error: Could not create PCH
Could not test Neko as it also gives an error:
Andreass-Air:pirates_hp_code_hx andreas$ openfl test neko
Called from ? line 1
Called from ApplicationMain.hx line 30
Called from ApplicationMain.hx line 145
Called from lime/utils/Preloader.hx line 204
Called from lime/utils/Preloader.hx line 350
Called from lime/utils/Preloader.hx line 247
Called from lime/_internal/macros/EventMacro.hx line 101
Called from ApplicationMain.hx line 128
Called from openfl/display/Preloader.hx line 54
Called from openfl/display/DisplayObject.hx line 940
Called from openfl/display/DisplayObject.hx line 1333
Called from openfl/display/DisplayObject.hx line 1262
Called from a C function
Called from openfl/events/EventDispatcher.hx line 443
Called from openfl/display/Preloader.hx line 301
Called from openfl/display/Preloader.hx line 248
Called from openfl/display/DisplayObject.hx line 940
Called from openfl/display/DisplayObject.hx line 1333
Called from openfl/display/DisplayObject.hx line 1262
Called from a C function
Called from openfl/events/EventDispatcher.hx line 443
Called from openfl/display/Preloader.hx line 117
Called from lime/_internal/macros/EventMacro.hx line 101
Called from ApplicationMain.hx line 131
Called from ApplicationMain.hx line 179
Called from openfl/display/Stage.hx line 1836
Called from ApplicationMain.hx line 230
Called from ApplicationMain.hx line 303
Called from a C function
Called from ApplicationMain.hx line 326
Called from a C function
Called from HomePage.hx line 56
Called from openfl/containers/ScrollPane.hx line 10
Called from a C function
Called from openfl/containers/ScrollPane.hx line 17
Called from a C function
Called from openfl/containers/BaseScrollPane.hx line 38
Called from a C function
Called from openfl/core/UIComponent.hx line 28
Called from a C function
Called from openfl/display/XFLSprite.hx line 32
Called from a C function
Called from xfl/symbol/Sprite.hx line 24
Called from xfl/symbol/Shared.hx line 213
Called from xfl/symbol/Symbols.hx line 182
Called from xfl/symbol/Symbols.hx line 290
Called from a C function
Called from openfl/controls/ScrollBar.hx line 19
Called from a C function
Called from openfl/controls/ScrollBar.hx line 58
Called from openfl/core/UIComponent.hx line 126
Called from openfl/controls/ScrollBar.hx line 240
Uncaught exception - Invalid operation (-)
I currently have no idea instead of digging the OpenFL/Android source for rendering text.
@andreasdr Perhaps a newer HXCPP release version would compile properly for macOS? Otherwise, you could try the Neko target, but itās a bit tricky, it does NOT initialize integer/float values with 0, instead they are null. Thus you get errors like Invalid operation (-) because it is doing something like 200 - null and doesnāt know what to do (and does not resolve as if it were 0, like JavaScript)
Is this only specific to one font? Does it occur with just a basic TextField?
Try doing openfl create project TextFieldTest, adding in a font and add a basic TextField, and see if the positioning on that seems wrong compared to other targets. If so, that would make a really easy test for us to look at. If not, then perhaps itās something trickier
So what is wrong with my first approach? I guess when only including āAssets/fontsā the font is ignored or processed differently or maybe the MacOSX default is taken. I have no idea.
I double checked. So I have made a build that is not working in terms of font rendering(including āAssets/fontsā instead of complete asset path) and a second one, that works, including everything. Please see attached a build diff.
One can see some differences that maybe make the difference. Maybe someone can look into this issue as I can not include the whole asset path in our game.
I donāt know how this happens (Iād appreciate if someone does find why) but somehow in OpenFL fonts, thereās a case where you can get an OpenFL font with a src property (which holds the native font reference) without any of the font measurements. The only places I can see src assigned in Lime call __initializeSource right away, which sets all these values. Otherwise thereās an internal __copyFrom.
just tested it. Means I applied your commit to openfl master branch and rebuild my test app.
The fonts are working properly this way. Hope this fix finds its way into next openfl release.
I have a new issue popping up. DisplayObjects(Containers) will disappear on mouse over if ColorMatrixFilter is applied.
I can make videos if you want it.
It sounds a bit strange. I thought I might have an error in my code, but actually it does nothing relevant at all. It also happens If I do not register MOUSE_OVER events on those objects. And I have this issue on multiple different code places.
I tried to reproduce this with a simple sample (object with filter, MouseEvent.MOUSE_OVER added) but it seems to work fine, does anything happen in the MOUSE_OVER events that changes the objects or the hierarchy in some way?