bitwiseworks / qtwebengine-chromium-os2

Port of Chromium and related tools to OS/2
9 stars 2 forks source link

Crash when using font manager based on SkFontConfigInterface #18

Closed dmik closed 4 years ago

dmik commented 4 years ago

Currently, Skia in Chromium uses a font manager based on SkFontConfigInterface on OS/2. This leads to a crash when visiting e.g. http://html5test.com in simplebrowser (https://github.com/bitwiseworks/qtwebengine-os2/issues/6):

[55641:12:0825/235854.995000:ERROR:SkFontMgr_FontConfigInterface.cpp(221)] ../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/skia/src/ports/SkFontMgr_FontConfigInterface.cpp:221: fatal error: "Not implemented."

This is because some methods of SkFontMgr are not implemented by a SkFontConfigInterface based implementation (returned by SkFontMgr_New_FCI).

We use Linux code here and I don't know why Linux does that by default and how this can work there. Perhaps, there are some overloads and extensions of this default font manager somewhere deep in the other parts of Linux code.

Skia also provides a fontconfig-based SkFontMgr implementation and that one implements the above methods so it should suit OS/2 as well because we fully support fonctonfig.

dmik commented 4 years ago

Note that SkFontConfigInterface is virtual, there is its only implementation called SkFontConfigInterfaceDirect which uses FontConfig but in a different way than the FontConfig-based SkFontMgr implementation (returned by SkFontMgr_New_FontConfig). I have no idea why Linux uses the former as the default given that it lacks some method implementations. Perhaps, this is somehow extended (or handled in some other way) deep in the Linux code.

For now I will just use the FontConfig-based SkFontMgr implementation on OS/2 as it doesn't seem to cause these assertions.