webengine/osswebengine/WebCore/platform/symbian/FontSymbian.cpp
changeset 10 a359256acfc6
parent 5 10e98eab6f85
child 47 e1bea15f9a39
equal deleted inserted replaced
5:10e98eab6f85 10:a359256acfc6
    32 #include "ZoomFactor.h"
    32 #include "ZoomFactor.h"
    33 #include "PlatformFontCache.h"
    33 #include "PlatformFontCache.h"
    34 
    34 
    35 namespace WebCore {
    35 namespace WebCore {
    36 
    36 
       
    37 const UChar UnicodeZeroWidthSpace = 0x200b;
       
    38 
    37 static void notSupported() { __ASSERT_ALWAYS( 0, User::Panic( _L("Font:"), 1 ) ); }
    39 static void notSupported() { __ASSERT_ALWAYS( 0, User::Panic( _L("Font:"), 1 ) ); }
    38 
    40 
    39 void Font::drawGlyphs(GraphicsContext* graphicsContext, const FontData* font, const GlyphBuffer& glyphBuffer,
    41 void Font::drawGlyphs(GraphicsContext* graphicsContext, const FontData* font, const GlyphBuffer& glyphBuffer,
    40                       int from, int numGlyphs, const FloatPoint& point) const
    42                       int from, int numGlyphs, const FloatPoint& point) const
    41 {
    43 {
   109     // letter spacing
   111     // letter spacing
   110     bitgc.SetCharJustification(m_letterSpacing*str.Length(),str.Length());
   112     bitgc.SetCharJustification(m_letterSpacing*str.Length(),str.Length());
   111     // word spacing
   113     // word spacing
   112     bitgc.SetWordJustification(m_wordSpacing*numSpaces + style.padding(), numSpaces);
   114     bitgc.SetWordJustification(m_wordSpacing*numSpaces + style.padding(), numSpaces);
   113 
   115 
       
   116 #if PLATFORM(SYMBIAN)
       
   117     TLanguage uilang = User::Language();
       
   118     if(uilang == ELangKorean)
       
   119     {
       
   120         startPos.iY -= 1;
       
   121     }
       
   122 #endif
   114     // see if we need a temporary buffer
   123     // see if we need a temporary buffer
   115     if( indexOfFirstNonRegularSpace > -1 || isSmallCaps() || style.rtl()){
   124     if( indexOfFirstNonRegularSpace > -1 || isSmallCaps() || style.rtl()){
   116         HBufC* text = 0;
   125         HBufC* text = 0;
   117         text = str.Alloc();
   126         text = str.Alloc();
   118         if (text){
   127         if (text){
   127             // if we have non-regular spaces (nbsp, tab, etc.) we need to make a copy
   136             // if we have non-regular spaces (nbsp, tab, etc.) we need to make a copy
   128             // and replace them with regular spaces. otherwise they show up as boxes.
   137             // and replace them with regular spaces. otherwise they show up as boxes.
   129             if (indexOfFirstNonRegularSpace > -1) {
   138             if (indexOfFirstNonRegularSpace > -1) {
   130                 for(; indexOfFirstNonRegularSpace<strLength; ++indexOfFirstNonRegularSpace ) {
   139                 for(; indexOfFirstNonRegularSpace<strLength; ++indexOfFirstNonRegularSpace ) {
   131                     if( TChar(newStr[indexOfFirstNonRegularSpace]).IsSpace()) {
   140                     if( TChar(newStr[indexOfFirstNonRegularSpace]).IsSpace()) {
   132                         newStr[indexOfFirstNonRegularSpace] = ' ';
   141                        if (newStr[indexOfFirstNonRegularSpace] != UnicodeZeroWidthSpace) {
       
   142                            newStr[indexOfFirstNonRegularSpace] = ' ';
       
   143                        }
   133                     }
   144                     }
   134                 }
   145                 }
   135             }
   146             }
   136 
   147 
   137             if (style.rtl()) {
   148             if (style.rtl()) {