[Webkit-unassigned] [Bug 50619] [GTK] Glyphs in vertical text tests are rotated 90 degrees clockwise

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Dec 25 18:56:39 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=50619





--- Comment #17 from Koan-Sin Tan <koansin.tan at gmail.com>  2010-12-25 18:56:39 PST ---
(In reply to comment #15)
> > WebCore/platform/graphics/cairo/FontCairo.cpp:70
> > +    rotateBackIfNecessary(context, font);
> 
> I think this can be avoided.

I tried to check if a font has vertical metrics by creating FT_Face with FcPattern in FontPlatformData::initializeWithFontFace(). Yes, it works. But I cannot find a way to deal with some broken font cases, such as LayoutTests/fast/blockflow/broken-ideographic-font.html. It seems this cannot be avoided. These cases display CJK+non-CJK glyphs with "broken" fonts (no vertical metrics), but CJK ideographs still need be displayed correctly.

Let me explain what I know, see if the this make sense.
1. there are two orientations. One is SimpleFontData's; the other is FontPlatformData's
2. by the WebCore/platform/graphics/SimpleFontData.h,  the one in SimpleFontData should be the supported orientation according to the tables in the font.  FontPlatformData will always have the desired orientation. (This is for 3.)
3. the broken font case is handled by Font::glyphDataForCharacter in WebCore/platform/graphics/FontFastPath.cpp (if (data.fontData->platformData().orientation() == Vertical && data.fontData->orientation() == Horizontal && Font::isCJKIdeographOrSymbol(c)))
4. here comes the tricky part
4.1  if all the unicode characters to be displayed are !Font::isCJKIdeographOrSymbol(), then setting FontPlatformData's orientation to be Horizontal is good.
4.2 if there are some Font::isCJKIdeographOrSymbol() characters, we need something like 3., or we have to use 3.

> 
> > WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp:59
> > +    // if the font doesn't have vertical metrics, we don't rotate it 90 degress counterclockwise 
> > +    if (m_orientation == Vertical) {
> > +        FT_Face face = cairo_ft_scaled_font_lock_face(m_platformData.scaledFont());
> > +        if (!FT_HAS_VERTICAL(face))
> > +            m_orientation = Horizontal;
> > +        cairo_ft_scaled_font_unlock_face(m_platformData.scaledFont());
> > +    }
> > +
> 
> I still think it might be better to do this check in  FontPlatformData::initializeWithFontFace so that we can avoid undoing the rotation in drawGlyphs above.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list