Changeset 21408 in webkit


Ignore:
Timestamp:
May 11, 2007 9:25:25 AM (17 years ago)
Author:
bdash
Message:

2007-05-11 Mitz Pettel <mitz@webkit.org>

Reviewed by Darin.

No tests added because standard fonts do not use the character-based shaping
code path.

Added shapeArabic(), a private version of u_shapeArabic() from ICU,
patched to shape Arabic characters used in Persian, Urdu, Sindhi, etc.
(whose contextual forms belong to the Arabic Presentation Forms-A block).

  • WebCore.xcodeproj/project.pbxproj: Added ShapeArabic.{c,h}.
  • platform/mac/FontMac.mm: (WebCore::shapeArabic): Changed to call shapeArabic() instead of u_shapeArabic().
  • platform/mac/ShapeArabic.c: Added. Based on ushape.c from ICU, with additional shaping data and logic for Arabic Presentation Forms-A. Removed many options that are not used in WebKit and code that malloc()ed a temporary buffer and reversed the string. (changeLamAlef): (specialChar): (getLink): (isTashkeelChar): (shapeUnicode): (shapeArabic):
  • platform/mac/ShapeArabic.h: Added.
Location:
trunk/WebCore
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r21405 r21408  
     12007-05-11  Mitz Pettel  <mitz@webkit.org>
     2
     3        Reviewed by Darin.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=13572
     6          Arabic characters are not correctly joined when using Arial
     7
     8        No tests added because standard fonts do not use the character-based shaping
     9        code path.
     10
     11        Added shapeArabic(), a private version of u_shapeArabic() from ICU,
     12        patched to shape Arabic characters used in Persian, Urdu, Sindhi, etc.
     13        (whose contextual forms belong to the Arabic Presentation Forms-A block).
     14
     15        * WebCore.xcodeproj/project.pbxproj: Added ShapeArabic.{c,h}.
     16        * platform/mac/FontMac.mm:
     17        (WebCore::shapeArabic): Changed to call shapeArabic() instead of u_shapeArabic().
     18        * platform/mac/ShapeArabic.c: Added. Based on ushape.c from ICU, with
     19        additional shaping data and logic for Arabic Presentation Forms-A. Removed
     20        many options that are not used in WebKit and code that malloc()ed a temporary
     21        buffer and reversed the string.
     22        (changeLamAlef):
     23        (specialChar):
     24        (getLink):
     25        (isTashkeelChar):
     26        (shapeUnicode):
     27        (shapeArabic):
     28        * platform/mac/ShapeArabic.h: Added.
     29
    1302007-05-11  Darin Adler  <darin@apple.com>
    231
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r21405 r21408  
    273273                2D9066060BE141D400956998 /* LayoutState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D9066040BE141D400956998 /* LayoutState.cpp */; };
    274274                2D9066070BE141D400956998 /* LayoutState.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D9066050BE141D400956998 /* LayoutState.h */; };
     275                37919C190BF375DD00956998 /* ShapeArabic.c in Sources */ = {isa = PBXBuildFile; fileRef = 37919C180BF375DD00956998 /* ShapeArabic.c */; };
     276                37919C1D0BF3762800956998 /* ShapeArabic.h in Headers */ = {isa = PBXBuildFile; fileRef = 37919C1C0BF3762800956998 /* ShapeArabic.h */; };
    275277                37919C230B7D188600A56998 /* PositionIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37919C210B7D188600A56998 /* PositionIterator.cpp */; };
    276278                37919C240B7D188600A56998 /* PositionIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 37919C220B7D188600A56998 /* PositionIterator.h */; settings = {ATTRIBUTES = (); }; };
     
    33913393                2D90660B0665D937006B6F1A /* ClipboardMac.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = ClipboardMac.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
    33923394                2D90660C0665D937006B6F1A /* ClipboardMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ClipboardMac.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
     3395                37919C180BF375DD00956998 /* ShapeArabic.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = ShapeArabic.c; sourceTree = "<group>"; };
     3396                37919C1C0BF3762800956998 /* ShapeArabic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeArabic.h; sourceTree = "<group>"; };
    33933397                37919C210B7D188600A56998 /* PositionIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PositionIterator.cpp; sourceTree = "<group>"; };
    33943398                37919C220B7D188600A56998 /* PositionIterator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PositionIterator.h; sourceTree = "<group>"; };
     
    69386942                                9353676A09AED88B00D35CD6 /* ScrollViewMac.mm */,
    69396943                                AB71709F0B31193B0017123E /* SearchPopupMenuMac.mm */,
     6944                                37919C1C0BF3762800956998 /* ShapeArabic.h */,
     6945                                37919C180BF375DD00956998 /* ShapeArabic.c */,
    69406946                                1A4A95510B4EDCFF002D8C3C /* SharedBufferMac.mm */,
    69416947                                93309E9F099EB78C0056E581 /* SharedTimerMac.cpp */,
     
    1126511271                                14C9A29A0BF04DB600D734A8 /* WebScriptObjectPendingPublic.h in Headers */,
    1126611272                                93799EF90BF2743600D0F230 /* RenderWordBreak.h in Headers */,
     11273                                37919C1D0BF3762800956998 /* ShapeArabic.h in Headers */,
    1126711274                        );
    1126811275                        runOnlyForDeploymentPostprocessing = 0;
     
    1263812645                                AACF144D0BEC1EF000827982 /* TextBreakIteratorInternalICUMac.mm in Sources */,
    1263912646                                93799EF80BF2743600D0F230 /* RenderWordBreak.cpp in Sources */,
     12647                                37919C190BF375DD00956998 /* ShapeArabic.c in Sources */,
    1264012648                        );
    1264112649                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebCore/platform/mac/FontMac.mm

    r20646 r21408  
    3939#import "WebCoreSystemInterface.h"
    4040#import "WebCoreTextRenderer.h"
    41 
    42 #import <unicode/ushape.h>
     41#import "ShapeArabic.h"
    4342
    4443#define SYNTHETIC_OBLIQUE_ANGLE 14
     
    285284
    286285        UErrorCode shapingError = U_ZERO_ERROR;
    287         unsigned charsWritten = u_shapeArabic(source + shapingStart, shapingEnd - shapingStart, dest + shapingStart, shapingEnd - shapingStart, U_SHAPE_LETTERS_SHAPE | U_SHAPE_LENGTH_FIXED_SPACES_NEAR, &shapingError);
     286        unsigned charsWritten = shapeArabic(source + shapingStart, shapingEnd - shapingStart, dest + shapingStart, shapingEnd - shapingStart, U_SHAPE_LETTERS_SHAPE | U_SHAPE_LENGTH_FIXED_SPACES_NEAR, &shapingError);
    288287
    289288        if (U_SUCCESS(shapingError) && charsWritten == shapingEnd - shapingStart) {
Note: See TracChangeset for help on using the changeset viewer.