[Webkit-unassigned] [Bug 29570] New: [Qt] External font loading in Qt Webkit

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 21 08:32:50 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=29570

           Summary: [Qt] External font loading in Qt Webkit
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Other
        OS/Version: Mac OS X 10.5
            Status: NEW
          Keywords: Qt
          Severity: Normal
          Priority: P2
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: vestbo at webkit.org


This bug report originated from Nokia internal issue QT-1762


--- Comments ---

Product
Qt

Function
webkit

Version
4.5.2

Platform
Windows Vista

Platform details
The bug appears on Vista x64 and Ubuntu 9.04. Probably on other platforms too.

Compilers
MSVC

Compiler details
Tested with Visual Studio 2008 and GCC 4.3.3.

Subject
External font loading in Qt Webkit

Steps to reproduce / test case
[This has been posted to the qt-interest mailing list on 19. July 2009 18:13]

I believe I have found a bug in Qt. It pertains to external font loading
with the “@font-face” CSS property.

Two issues are present:

1.  If we load both the regular and the italic versions of a font face from
different font files and then specify that an HTML element should use that
font face, the regular version of the font is displayed, but not the italic.

Example CSS code:

@font-face { font-family: "Fontin"; src: url(Fontin-Regular.ttf); }
@font-face { font-family: "Fontin"; font-style: italic; src:
url(Fontin-Italic.ttf); }
body { font-family: "Fontin" }

The regular style is displayed correctly, the italic isn’t. Same thing
happens for bold versions and different font families/font files. Needless
to say, this works in Firefox 3.5 and Safari 4.0.2.

2. My application uses the “contentEditable” property to enable editing of
the loaded HTML file. If the user tries to make some regular text italic
with “CTRL + I” (or invokes the command in some other way), the text isn’t
displayed italic (because of issue #1, naturally). But if he then closes the
application, it crashes with a segfault.

I have also tried loading the fonts by hand with
“QFontDatabase::addApplicationFont(const QString & fileName)” and it made
no
difference for either issue.

I am providing a small test application that demonstrates issue #1. But for
reasons that are beyond my comprehension, I am unable to replicate issue #2
in a test application, although it is very easy to replicate in my program.

Make sure that the font files are in the same folder as your executable, and
that they are not installed in the system.

I do have the next best thing for issue #2: start the “Browser” demo
application that comes with Qt and open the “test.xhtml” file that comes
with my test app for issue #1. Even without setting “contentEditable” to
true and making some text italic by hand, it will crash on exit with a
segfault. It will also display issue #1, that is, it won’t display italic
text as italic. I have analyzed the stack trace for the crash in the
“Browser” application and in my own, and they are practically identical: it’s
the same bug, although it’s invoked in slightly different ways. I have
included the stack trace for my application for reference.

This has all been tested on Vista x64 and Ubuntu 9.04. The Qt versions used
were 4.5.2 and 4.5.0, respectively.

Sincerely,

[On the mailing list it's been pointed out that I should use CSS styling for
the italic text. My
application uses them exclusively. The example uses "<i>Italic
text.</i>" for the sake of brevity. The bug doesn't care. Feel free
to set the text italic with a CSS style and see the application crash in the
absolutely same way.]

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list