[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 Oct 4 02:58:20 PDT 2013


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





--- Comment #39 from Denis Nomiyama (dnomi) <d.nomiyama at samsung.com>  2013-10-04 02:57:11 PST ---
(In reply to comment #38)
> (From update of attachment 212584 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=212584&action=review
> 
> Thanks a lot for your time preparing the diagram! I thought about it, and I proposed an alternative that maybe feels a bit easier to understand.

Pleasure and many thanks for helping on this :)

> > 2) From horizontal orientation to vertical orientation
> > This is the same case as in (a) to (b).
> > I realised this last case is incorrect in my patch, which incorrectly translates in the x-axis. This case is not currently used in the code and that explains why this bug wasn't spotted before.
> > I will fix it.
> 
> If we start from a Horizontal matrix H and we want to get to the Vertical matrix V, we are doing it like:
> 
> V = H • R • T
> 
> So, if we want to go back to the original Horizontal matrix, we should be able to do
> 
> H • (R • T) • (R • T)^(-1) = V • (R • T)^(-1)
> 
> So
> 
> H = V • T^(-1) • R^(-1)
> 
> In the case of the rotation matrix, if we invert it, we get to a Rotation matrix of M_PI_2: the opposite to the previous angle. Then, when we invert the translation matrix, it turns out that we are translating back (0, -1): the opposite amount of the previous translation.
> 
> When going from horizontal to vertical, we do
> 
> cairo_matrix_rotate(&fontMatrix, -M_PI_2);
> cairo_matrix_translate(&fontMatrix, 0.0, 1.0);
> 
> so we would, when going from vertical to horizontal, do
> 
> cairo_matrix_translate(&fontMatrix, 0.0, -1.0);
> cairo_matrix_rotate(&fontMatrix, M_PI_2);
> 
> It could be that keeping the order you suggest is also fine, but I think it feels more natural to think about inverting the matrices for going back.

Great approach. I completely agree and the code will be much easier to understand.
I will modify it in the next patch. And also add some comments based on your explanation.

-- 
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