[Webkit-unassigned] [Bug 136337] New: Webkit using Harfbuzz does not display Arabic script correctly

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 28 03:47:01 PDT 2014


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

           Summary: Webkit using Harfbuzz does not display Arabic script
                    correctly
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Other
               URL: http://www.aljazeera.net/portal
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore Misc.
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: doron_wloschowsky at scee.net


None of the text for http://www.aljazeera.net/portal displays correctly.

Platform PowerPC big-endian architecture.

After debugging, I found that this issue is due to an endian issue. This can be fixed with the following:

diff a/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp b/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp
index ecaafc1..2c643b3 100644
--- a/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp
+++ b/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp
@@ -111,7 +111,8 @@ static hb_bool_t harfBuzzGetGlyph(hb_font_t*, void* fontData, hb_codepoint_t uni
     if (result.isNewEntry) {
         cairo_glyph_t* glyphs = 0;
         int numGlyphs = 0;
-        CString utf8Codepoint = UTF8Encoding().encode(reinterpret_cast<UChar*>(&unicode), 1, QuestionMarksForUnencodables);
+        UChar ch = unicode;
+        CString utf8Codepoint = UTF8Encoding().encode(&ch, 1, QuestionMarksForUnencodables);
         if (cairo_scaled_font_text_to_glyphs(scaledFont, 0, 0, utf8Codepoint.data(), utf8Codepoint.length(), &glyphs, &numGlyphs, 0, 0, 0) != CAIRO_STATUS_SUCCESS)
             return false;
         if (!numGlyphs)

The unfixed code works fine on little endian architectures since reinterpret casting int32_t* to an int16_t* gets the two least significant bytes but on big endian architectures the downsizing will always return zeros (for small integer values). 

This then has the knock-on effect that no glyphs get returned.

-- 
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