Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
5.12.7, 5.13.2, 5.14.0
Description
User has requested an update function for Qt application after substituting Fonts.
It could be similar as QQmlEngine::retranslate() but for substituted fonts.
Customer use case example has been attached and explanation:
"
Download the following fonts and unzip them in your "~/.fonts" Linux
folder:
_* https://noto-website-2.storage.googleapis.com/pkgs/NotoSans-hinted.zip_
_* https://noto-website-2.storage.googleapis.com/pkgs/NotoSansCJK-_
Black.ttc.zip
Start the application. You will send 3 texts: first text must change according
to the substitution and the 2 other texts are for reference.
Here what happened:
* in ExposedObject constructor, I create a first font substitution from
"Noto Sans ExtCond Blk" to the japanese variant of the Noto Sans
CJK font: "Noto Sans CJK JP Black"
* when I press a key in qml app, I change the substitution from JP to SC and
I force the refresh of the text with a binding
* if you define QSG_RENDER_LOOP to "threaded" or do not define it,
it works
* if you define QSG_RENDER_LOOP to "basic", it fails applying the
substitution
You can see in function `QFontPrivate::engineForScript(int script)` that the
'engineData' is 'unref' and created again if the fontCacheId do not match the
fontCacheId of the current thread.
With the threaded render loop, when I press on a key, the render loop calls
this function with a engineData with the wrong fontCacheId, so it creates a
new engineData with correct fallback families data.
With the basic render loop, when I press on a key, the engineData has a
correct fontCacheId, so it does not create a new engineData with correct
fallback families data. It keeps the old fallback families data and continues
displaying with the wrong font.
Even if I do not use the basic render loop with my EGLFS application on my
embedded linux target, I have very weird behaviors with the substitution
mechanism which is probably due to the asynchronous work with the threaded
render loop.
"