Changeset 23199 in webkit


Ignore:
Timestamp:
Mar 27, 2007 1:59:40 AM (17 years ago)
Author:
hyatt
Message:

Add support for glyph offsets to the GlyphBuffer.

Location:
branches/WindowsMerge/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/WindowsMerge/WebCore/ChangeLog

    r23198 r23199  
     12007-03-27  Dave Hyatt  <hyatt@apple.com>
     2
     3        Add support for glyph offsets to the GlyphBuffer.
     4       
     5        Reviewed by olliej
     6
     7        * platform/win/FontWin.cpp:
     8        (WebCore::Font::drawGlyphs):
     9        * platform/win/UniscribeController.cpp:
     10        (WebCore::UniscribeController::shapeAndPlaceItem):
     11
    1122007-03-26  Antti Koivisto  <antti@apple.com>
    213
  • branches/WindowsMerge/WebCore/platform/win/FontWin.cpp

    r23197 r23199  
    6868
    6969    CGAffineTransform matrix = CGAffineTransformIdentity;
    70     //memcpy(&matrix, [drawFont matrix], sizeof(matrix));
    71     //if ([gContext isFlipped]) {
    72     {
    73         matrix.b = -matrix.b;
    74         matrix.d = -matrix.d;
    75     }
     70    matrix.b = -matrix.b;
     71    matrix.d = -matrix.d;
     72
    7673    if (platformData.syntheticOblique())
    7774    {
     
    7976        matrix = CGAffineTransformConcat(matrix, CGAffineTransformMake(1, 0, skew, 1, 0, 0));
    8077    }
     78
     79    // Uniscribe gives us offsets to help refine the positioning of combining glyphs.
     80    FloatSize translation = glyphBuffer.offsetAt(from);
     81    if (translation.width() || translation.height())
     82        CGAffineTransformTranslate(matrix, translation.width(), translation.height());
     83   
    8184    CGContextSetTextMatrix(cgContext, matrix);
    8285
  • branches/WindowsMerge/WebCore/platform/win/UniscribeController.cpp

    r23197 r23199  
    335335        Glyph glyph = glyphs[k];
    336336        float advance = advances[k] / 32.0f;
     337        float offsetX = offsets[k].du / 32.0f;
     338        float offsetY = offsets[k].dv / 32.0f;
    337339
    338340        // Match AppKit's rules for the integer vs. non-integer rendering modes.
    339341        float roundedAdvance = roundf(advance);
    340         if (!m_font.isPrinterFont() && !fontData->isSystemFont())
     342        if (!m_font.isPrinterFont() && !fontData->isSystemFont()) {
    341343            advance = roundedAdvance;
    342        
     344            offsetX = roundf(offsetX);
     345            offsetY = roundf(offsetY);
     346        }
     347       
    343348        // We special case spaces in two ways when applying word rounding.
    344349        // First, we round spaces to an adjusted width in all fonts.
     
    401406        // translation.
    402407        if (glyphBuffer)
    403             glyphBuffer->add(glyph, fontData, advance);
     408            glyphBuffer->add(glyph, fontData, advance, &FloatSize(offsetX, offsetY));
    404409
    405410        // Mutate the glyph array to contain our altered advances.
Note: See TracChangeset for help on using the changeset viewer.