Changeset 23128 in webkit


Ignore:
Timestamp:
Mar 20, 2007 2:13:54 AM (17 years ago)
Author:
hyatt
Message:

Land advanced text ( turned off )

Location:
branches/WindowsMerge/WebCore
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/WindowsMerge/WebCore/ChangeLog

    r23126 r23128  
     12007-03-20  Dave Hyatt  <hyatt@apple.com>
     2
     3        Land advanced text code path (turned off).
     4       
     5        Reviewed by aroben
     6       
     7        * WebCore.vcproj/WebCore.vcproj:
     8        * platform/win/FontCacheWin.cpp:
     9        (WebCore::FontCache::createFontPlatformData):
     10        * platform/win/FontDataWin.cpp:
     11        (WebCore::FontData::platformInit):
     12        (WebCore::FontData::platformDestroy):
     13        (WebCore::FontData::smallCapsFontData):
     14        (WebCore::FontData::scriptFontProperties):
     15        * platform/win/FontWin.cpp:
     16        (WebCore::Font::drawComplexText):
     17        (WebCore::Font::floatWidthForComplexText):
     18        (WebCore::Font::offsetForPositionForComplexText):
     19        * platform/win/UniscribeController.cpp: Added.
     20        (WebCore::UniscribeController::UniscribeController):
     21        (WebCore::UniscribeController::resetControlAndState):
     22        (WebCore::UniscribeController::shapeAndPlaceItem):
     23        (WebCore::UniscribeController::shape):
     24        * platform/win/UniscribeController.h: Added.
     25        (WebCore::UniscribeController::width):
     26        (WebCore::UniscribeController::glyphBuffer):
     27
    1282007-03-20  Anders Carlsson  <acarlsson@apple.com>
    229
  • branches/WindowsMerge/WebCore/WebCore.vcproj/WebCore.vcproj

    r23118 r23128  
    30243024                                <File
    30253025                                        RelativePath="..\platform\win\TextBoundariesWin.cpp"
     3026                                        >
     3027                                </File>
     3028                                <File
     3029                                        RelativePath="..\platform\win\UniscribeController.cpp"
     3030                                        >
     3031                                </File>
     3032                                <File
     3033                                        RelativePath="..\platform\win\UniscribeController.h"
    30263034                                        >
    30273035                                </File>
  • branches/WindowsMerge/WebCore/platform/win/FontCacheWin.cpp

    r22917 r23128  
    107107
    108108    // The size here looks unusual.  The negative number is intentional.  The logical size constant is 32.
    109     winfont.lfHeight = -fontDescription.computedPixelSize();
     109    winfont.lfHeight = -fontDescription.computedPixelSize() * 32;
    110110    winfont.lfWidth = 0;
    111111    winfont.lfEscapement = 0;
  • branches/WindowsMerge/WebCore/platform/win/FontDataWin.cpp

    r23084 r23128  
    106106    RestoreDC(dc, -1);
    107107    ReleaseDC(0, dc);
     108
     109    m_scriptCache = 0;
     110    m_scriptFontProperties = 0;
    108111}
    109112
     
    122125    // We don't hash this on Win32, so it's effectively owned by us.
    123126    delete m_smallCapsFontData;
     127
     128    ScriptFreeCache(&m_scriptCache);
     129    delete m_scriptFontProperties;
    124130}
    125131
     
    130136        GetObject(m_font.hfont(), sizeof(LOGFONT), &winfont);
    131137        int smallCapsHeight = lroundf(0.70f * fontDescription.computedSize());
    132         winfont.lfHeight = -smallCapsHeight;
     138        winfont.lfHeight = -smallCapsHeight * 32;
    133139        HFONT hfont = CreateFontIndirect(&winfont);
    134140        m_smallCapsFontData = new FontData(FontPlatformData(hfont, smallCapsHeight, fontDescription.bold(), fontDescription.italic()));
     
    189195}
    190196
    191 }
     197SCRIPT_FONTPROPERTIES* FontData::scriptFontProperties() const
     198{
     199    if (!m_scriptFontProperties) {
     200        m_scriptFontProperties = new SCRIPT_FONTPROPERTIES;
     201        memset(m_scriptFontProperties, 0, sizeof(SCRIPT_FONTPROPERTIES));
     202        m_scriptFontProperties->cBytes = sizeof(SCRIPT_FONTPROPERTIES);
     203        HRESULT result = ScriptGetFontProperties(0, scriptCache(), m_scriptFontProperties);
     204        if (result == E_PENDING) {
     205            HDC dc = GetDC(0);
     206            SaveDC(dc);
     207            SelectObject(dc, m_font.hfont());
     208            ScriptGetFontProperties(dc, scriptCache(), m_scriptFontProperties);
     209            RestoreDC(dc, -1);
     210            ReleaseDC(0, dc);
     211        }
     212    }
     213    return m_scriptFontProperties;
     214}
     215
     216}
  • branches/WindowsMerge/WebCore/platform/win/FontWin.cpp

    r22942 r23128  
    3333#include "IntRect.h"
    3434#include "NotImplemented.h"
     35#include "UniscribeController.h"
    3536#include <ApplicationServices/ApplicationServices.h>
    3637#include <WebKitSystemInterface/WebKitSystemInterface.h>
     
    9697}
    9798
    98 void Font::drawComplexText(GraphicsContext* graphicsContext, const TextRun& run, const TextStyle& style, const FloatPoint& point) const
     99void Font::drawComplexText(GraphicsContext* context, const TextRun& run, const TextStyle& style, const FloatPoint& point) const
    99100{
    100     LOG_NOIMPL();
     101    // Constructing the controller itemizes and shapes the run.
     102    UniscribeController controller(this, run, style, context);
     103
     104    // FIXME: Handle from/to values set in the run so that selection works.
     105    if (controller.glyphBuffer().isEmpty())
     106        return;
     107    drawGlyphBuffer(context, controller.glyphBuffer(), run, style, point);
    101108}
    102109
    103110float Font::floatWidthForComplexText(const TextRun& run, const TextStyle& style) const
    104111{
    105     LOG_NOIMPL();
    106     return 0;
     112    // Copied from the Mac code, although not sure why this would ever happen.
     113    if (run.from() == run.to())
     114        return 0;
     115
     116    // Constructing the controller itemizes and shapes the run.
     117    UniscribeController controller(this, run, style);
     118    return controller.width();
    107119}
    108120
    109121int Font::offsetForPositionForComplexText(const TextRun& run, const TextStyle& style, int x, bool includePartialGlyphs) const
    110122{
    111     LOG_NOIMPL();
    112123    return 0;
    113124}
Note: See TracChangeset for help on using the changeset viewer.