Changeset 23128 in webkit
- Timestamp:
- Mar 20, 2007 2:13:54 AM (17 years ago)
- Location:
- branches/WindowsMerge/WebCore
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WindowsMerge/WebCore/ChangeLog
r23126 r23128 1 2007-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 1 28 2007-03-20 Anders Carlsson <acarlsson@apple.com> 2 29 -
branches/WindowsMerge/WebCore/WebCore.vcproj/WebCore.vcproj
r23118 r23128 3024 3024 <File 3025 3025 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" 3026 3034 > 3027 3035 </File> -
branches/WindowsMerge/WebCore/platform/win/FontCacheWin.cpp
r22917 r23128 107 107 108 108 // 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; 110 110 winfont.lfWidth = 0; 111 111 winfont.lfEscapement = 0; -
branches/WindowsMerge/WebCore/platform/win/FontDataWin.cpp
r23084 r23128 106 106 RestoreDC(dc, -1); 107 107 ReleaseDC(0, dc); 108 109 m_scriptCache = 0; 110 m_scriptFontProperties = 0; 108 111 } 109 112 … … 122 125 // We don't hash this on Win32, so it's effectively owned by us. 123 126 delete m_smallCapsFontData; 127 128 ScriptFreeCache(&m_scriptCache); 129 delete m_scriptFontProperties; 124 130 } 125 131 … … 130 136 GetObject(m_font.hfont(), sizeof(LOGFONT), &winfont); 131 137 int smallCapsHeight = lroundf(0.70f * fontDescription.computedSize()); 132 winfont.lfHeight = -smallCapsHeight ;138 winfont.lfHeight = -smallCapsHeight * 32; 133 139 HFONT hfont = CreateFontIndirect(&winfont); 134 140 m_smallCapsFontData = new FontData(FontPlatformData(hfont, smallCapsHeight, fontDescription.bold(), fontDescription.italic())); … … 189 195 } 190 196 191 } 197 SCRIPT_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 33 33 #include "IntRect.h" 34 34 #include "NotImplemented.h" 35 #include "UniscribeController.h" 35 36 #include <ApplicationServices/ApplicationServices.h> 36 37 #include <WebKitSystemInterface/WebKitSystemInterface.h> … … 96 97 } 97 98 98 void Font::drawComplexText(GraphicsContext* graphicsContext, const TextRun& run, const TextStyle& style, const FloatPoint& point) const99 void Font::drawComplexText(GraphicsContext* context, const TextRun& run, const TextStyle& style, const FloatPoint& point) const 99 100 { 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); 101 108 } 102 109 103 110 float Font::floatWidthForComplexText(const TextRun& run, const TextStyle& style) const 104 111 { 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(); 107 119 } 108 120 109 121 int Font::offsetForPositionForComplexText(const TextRun& run, const TextStyle& style, int x, bool includePartialGlyphs) const 110 122 { 111 LOG_NOIMPL();112 123 return 0; 113 124 }
Note: See TracChangeset
for help on using the changeset viewer.