Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-10653

Conflicts between 'FontRouter' and Qt on Symbian




      Note: the following observations are still flaky guesses of mine, please feel free to correct me by adding comments.

      Why and what is FontRouter?

      Symbian does not offer a customization of system fonts. There are 3rd party tools to fill that Gap. one of these tools is the popular, opensource FontRouter. With FontRouter installed, the user can 'replace' system font faces (such as "Series 60 Sans") by any user-provided font file. This way, users can install fonts with extended language support (e.g. Chinese fonts on Western phone models). Also nice for cosmetic reasons: a user can for example 'replace' "Series 60 Sans" with "Comic sans".
      Why did I mention 'replace' in quotation marks? Because the font files are not replaced on the file system (!:\resources\fonts), but the system fonts are transparently replaced in-memory to the user fonts at system runtime. The applications that render text believe that for example they use "Series 60 Sans", but all rasterized text will come from the user provided "Comic sans".
      FontRouter runs on all thinkabe Symbian/S60 versions up to Symbian^1.

      How does FontRouter work?

      FontRouter is in the first place a COpenFontRasterizer plugin. This plugin does not rasterize fonts by itself, however. It is a proxy rasterizer, and it lets the original system rasterizer do the actual rasterizing.
      Now comes the interesting part: For various reasons, FontRouter accesses the CFontStore instance of the running FBServ.exe! It does that by scanning the heap memory for a CFontStore object signature. The autor of FontRouter created his THeapSearch to achieve that. Apparently, that heap searching technique is still documented in the Symbian^3 documentation (any old school Symbian developer here, who can tell me if that is still state-of-the-art?).
      The reason why this works is that FontRouter is a rasterizer plugin, and thus in the same process space as FBServ.exe.

      FontRouter vs. Symbian^3

      It seems to me that FontRouter would simply misfunction on Symbian^3, unrelated to Qt. I installed FontRouter on an N8 and got an N8 in a reboot loop, which was only fixable by a hard reset. Google has a few hits on 'n8 fontrouter bricked'.

      FontRouter vs. Qt

      Qt will stop working on systems where FontRouter is active. In the ideal case Qt programs just show garbled text. But usually the the phone reboots as soon as Qt tries to show any text. Qt uses the Symbian font API in a much more extensive way than common Symbian applications do. Apparently, the modifications that FontRouter performs in the FBServ.exe and thus the bahavior of Symbians font API are not compatible with what Qt does.
      TODO: try to reproduce Qt's usage of the font API (in a non-Qt app) in a way that it reboots the phone.

      (Unlikely) fixes which would make everybody happy

      First, it needs to be found out where exactly the problems are and where it crashes. Then, one of these things can be done:

      • Provide an updated FontRouter: Unlekely, because: The FontRouter project is inactive since 2007, and neither Nokia nor I as private person can support a tool that interferes in that way with the system internals. (Nor do I have the know-how to do that)
      • Provide an optional FontRouter aware code path in Qt: Unlikely, because this will certainly work against the way Qt does text handling, and the run-time performance and code maintainability of Qt will suffer.
      • Hope that the new font table API will fix that (for Symbian^3, if the reboot loop is fixed, there): Symbian^3 will in one of its next updates get a font table API (see QTBUG-15515). It could be that if Qt uses the API to access font tables, the issues go away. Of course, the former Symbian version would still remain with that crash.
      • Implement a dedicated font server for Qt: The ultimate solution! Qt should not use FBServ and fight against its API but rather come with its own server. See QTBUG-14743.

      Pragmatic fixes

      • Disable Qt, when FontRouter is installed: QApplications constructor could somehow check if FontRouter is installed. In that case it could gve an error message (without Qt UI) and post an application shutdown.
      • Disable FontRouter, when Qt is installed: FontRouter has a 'startup protection' mechanism which disables FontRouter if there is a file named Disable.frt on any drive root. The Qt installer could generate that file and even write a text into it which links to this bug report. However, doing this is not gentlemanlike!


        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.



              portale Alessandro Portale
              portale Alessandro Portale
              5 Vote for this issue
              8 Start watching this issue



                Gerrit Reviews

                  There are no open Gerrit changes