Font changes in deployed applications

When launched on the phone directly after deployment from the SDK (and when started from the terminal), an application has correct font, same as in the SDK emulator. But when launched from the application icon in launcher the font in the application is much smaller (actually: thinner) and very ugly (not antialiased, almost illegible on the device). Checked with multiple applications, always the same issue.

Furthermore, when the font is ugly (app launched from icon) text formatting/alignment (e.g. Text.AlignJustify) works correctly. But when the font is good looking (app launched from terminal) text alignment does NOT work.

Screenshots:

Good looking font (same as in the SDK emulator) with AlignJustify NOT working - when an application gets launched from the terminal:

Ugly font (thinner, narrower) but correctly working AlignJustify - when launched from an icon:

edit retag close delete

1

This sounds really starange, could you post screenshots of app having correct and wrong fonts. Would be good to see how they look ;)

( 2013-12-26 09:20:49 +0300 )edit

I've added some screenshots to the original post above. Even the button font changes to a thinner one, and so does the font in e.g. Pulley menu.

( 2013-12-26 18:27:02 +0300 )edit

Wow that looks really bad. Have you experienced this with other apps that you deploy to.device, or is it only this one?

( 2013-12-26 20:55:10 +0300 )edit

Yes, all applications are affected with the same issue. I've got nine applications fully ported to Sailfish OS and it happens with all of them.

( 2013-12-26 23:12:46 +0300 )edit

Ok, I have also the SDK in use and have been able to deploy a simple app to the device and checked that it works (I didn't pay attention to font rendering at the time). Do you have your source-code in GitHub and open-sourced, so I could try this with my own QtCreator and device?

( 2013-12-26 23:22:06 +0300 )edit

Sort by » oldest newest most voted

After debugging this with code send to me by @my-jolla, I found out that it is the Silica components that render texts and fonts differently. Starting the app directly from QtCreator (after deploying it as RPM-package) in the device does not make the type of application to "silica-qt5", but just "qt5", and fonts render more clearly and brightly. The fonts are also of different letterspacing, and alignment (e.g. justification) works differently, so text takes different amount of space (as suggested by @my-jolla)

Now, after app is installed in device the .desktop file includes a line

X-Nemo-Application-Type=silica-qt5


which makes the application to be invoked with:

invoker --type=silica-qt5 --single-instance /usr/bin/Biorhythms


command, so that it uses Silica components, and these seem to render fonts differently (they look more blury as described by OP).

A workaround in this case, to make fonts render more clearly, is to change in the .desktop files this line to read:

X-Nemo-Application-Type=qt5


which should make the app to be started with command

invoker --type=qt5 --single-instance /usr/bin/Biorhythms


Application can also started in device with the above command line in terminal to see the difference.

In these cases, of course, the app is not probably using Silica QML-components at alll (cause the type is not "silica-qt5") so this does not solve the root cause, which seems to be some font rendering issue in Silica QML/Qt5 components.

more

Please note that it's not just that fonts render "more clearly and brightly". They're also of different letterspacing, and alignment (e.g. justification) works differently, so text takes different amount of space.

( 2013-12-27 17:59:31 +0300 )edit

Ok, I added that to the answer. And, in regards what to do next to get this acknowledge; well we should get more votes for this question ;) and of courese, you could post this issue to SailfishOS Devel mailing list, or bring up this topic in #sailfishos freenode chat.

( 2013-12-29 04:36:58 +0300 )edit
2

Selecting qt5 as booster type will increase startup time and time for transitions between pages if Silica components are used. The thinner font looks like the intended system font, easy to see if you compare it to system apps. If the developer prefers different font, he should explicitly choose one.

( 2014-01-17 10:49:37 +0300 )edit

@veskuh Yes, using qt5 as booster was just a hackihs way to invoke the app so that the fonts rendered differently (thicker and better suggested by the OP). I didn't intend it to be an actual work-around, cause I wasn'tt sure what was the intended font for silica-boosted apps. Maybe it would help to document somewhere how to choose a specific theme or font for our apps.. ,)

( 2014-01-17 10:56:07 +0300 )edit
1

@jjaone There isn't a custom theme (or app specific theme) support yet in Silica, but you can use normal font formatting properties to all text fields and labels. It unfortunately seems that there aren't public properties available to control the font for other controls, but hacks may work.

( 2014-01-17 11:26:22 +0300 )edit

Now that it has been confirmed by others to be an existing issue, is there any hope that it can be dealt with promptly? It breaks the look of all my applications so badly that I cannot release any of them. Should I submit it to somewhere so that it gets noticed? Here it may just go unnoticed among those thousands of other submissions...

more

@my-jolla Did you by any chance already post this question to SailfishOS devel mailing list?

( 2014-01-07 05:01:03 +0300 )edit

Sorry for late response. I haven't posted it there yet. But I've found another strange thing: if in main.qml file I set the initialPage as a Component then always the same (the uglier one) font is used. If I use an object (e.g. FirstPage {} ) then it uses different fonts as described above.

( 2014-01-16 05:54:03 +0300 )edit

(continued) This of course affects the initialPage only, all other pages still have the same problem.

( 2014-01-16 05:55:00 +0300 )edit

The default font shouldn't change depending on the booster type and launching from SDK should produce the same font than launch from icon.

It really looks like the thinner font is the real system font. It is inteded for device use and thus screenshot on desktop environment really doesn't do justice to it. Just to be sure, compare your app to system apps.

Also, you do not define font in the example you gave (test.zip/MainPage.qml) you just use whatever the default happens to be in Text element. If you do not like system font you should define a font you like. If you use Silica Label it should set system font automatically and if you just want to use Text element instead of Label you can get the system font from Theme.fontFamily.

more

1

I did NOT say that the screenshots come from the emulator. They do NOT. All screenshots were taken on the device. Just as I wrote, the thinner font is shown when an application is launched from the Terminal, and the thicker font is used when an application is launched from an icon.

( 2014-01-17 11:25:41 +0300 )edit

(cont.) Indeed, I don't define font and I want to show the default system font. But still, the default font should be the same no matter how one launches an application. THAT'S the problem - so that the font is always the same regardless of an app being started from an icon or from the terminal.

( 2014-01-17 11:30:10 +0300 )edit
1

(cont.) To sum up and clarify, I do not complain about the look of the font, but about it CHANGING depending on how an app is launched. So it's not that "I do not like the system font". I do like it, I just expect it to always BE THE SAME. And I'm sure that IT IS NOT INTENDED that it changes....

( 2014-01-17 11:37:04 +0300 )edit
1

@my-jolla Yes, I just meant that because of higher resolution and subpixel antialising screenshot of font rendering (even from device) does not do justice to it.

The picture from below looks more like system font to me, did you compare that to system apps?

( 2014-01-17 11:39:26 +0300 )edit

@my-jolla And yes, I do agree that there is an issue here. The font should be the same.

( 2014-01-17 11:41:03 +0300 )edit

Just a wild guess, can you check if the environment variables QT_DF_BASE, QT_DF_BASEDEVIATION, QT_DF_RANGE, ... (all the ones starting with QT_DF_) are different between the two invocations that lead to a different display? I've experienced this myself, and I think the thinner font that you call "uglier" is the intended font, but maybe we can improve the readability of this font independent of the fix to this issue (which should make the font appear the same, no matter how you start it up).

more

Yes, for me the thinner is much harder to read (not ugly in itself).. Gottta check those env vars, will report later here.. but it'd great to be able to choose the font/themes and their rendering in 3rd-party apps..

( 2014-01-17 11:02:04 +0300 )edit
2

Hey Thomas, printenv lists the same environment variables in each case: QT_DF_BASE=0.5, QT_DF_RANGE=0.08, QT_DF_SCALEFORMAXDEF=0.37, QT_DF_BASEDEVIATION=0.025, QT_DF_SCALEFORNODEV=0.6. P.S. I'm fine with the thinner font, I just need it to always be the same, regardless of how an app is launched...

( 2014-01-17 11:47:38 +0300 )edit

I think that when invoked in-device with different booster selectors (qt5 or qt5-silica) the envs might be different..

( 2014-01-17 12:04:52 +0300 )edit

I'll further investigate it later today...

( 2014-01-17 12:09:38 +0300 )edit

So..... after THREE MONTHS this remains not fixed...

more

1

.... and judging by the response it won't be anytime soon.... Gosh, I'm really tired of it. I ported some of my apps to Sailfish OS already in March 2013, and after A YEAR I still cannot release any of them due to no support for paid apps, no support for certain Qt modules in Harbor, and bugs like this one that no one wants to even just confirm that they'll be fixed. I don't know how much longer I can wait, probably not too long. This platform apparently doesn't need developers like me.

( 2014-04-01 03:30:01 +0300 )edit