[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
Fri Dec 24 16:54:05 PST 2010
https://bugs.webkit.org/show_bug.cgi?id=50619
--- Comment #16 from Koan-Sin Tan <koansin.tan at gmail.com> 2010-12-24 16:54:05 PST ---
(In reply to comment #15)
> > WebCore/platform/graphics/cairo/FontCairo.cpp:63
> > + cairo_matrix_rotate(&fontMatrix, M_PI*0.5);
> Is there any reason this is better than M_PI / 2?
I think multiplication is cheaper than division :-)
How about M_PI_2? it seems most unix platforms have M_PI_2, and I can add
#if !defined(M_PI_2)
#define M_PI_2 1.57079632679489661923132169163975144 /* pi/2 */
#endif
> > WebCore/platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:48
> > +static bool substituteWithVerticalGlyphs(unsigned offset, unsigned length, const SimpleFontData* fontData, FT_Face face, GlyphPage* glyphPage)
>
> Is this called for many glyphs? If so is there a lot of overhead for doing this over and over again for each one?
>
Yes, I already avoid those in isCJKIdeographs. Many glyphs have vertical forms, esp. in Japanese fonts. To reduce the overhead, the only way I can think of right now is to load and parse the table using freetype, cache it in memory.
> > 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.
OK, I'll try that.
--
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