RESOLVED FIXED 16805
Text on a path is all wonky
https://bugs.webkit.org/show_bug.cgi?id=16805
Summary Text on a path is all wonky
Oliver Hunt
Reported 2008-01-09 14:04:02 PST
Scaled textPath text is very jaggedly positioned. I would suspect it were a CG bug, but it seems to effect SVG fonts as well.
Attachments
Simple minimised text case. (526 bytes, image/svg+xml)
2008-01-09 14:04 PST, Oliver Hunt
no flags
Oliver Hunt
Comment 1 2008-01-09 14:04:53 PST
Created attachment 18353 [details] Simple minimised text case.
Nikolas Zimmermann
Comment 2 2008-01-09 14:42:03 PST
Hey Oliver, this is a known bug since ages. The root lies in Path.cpp, in following function: static void pathLengthApplierFunction(void* info, const PathElement* element) quoting parts of the code here: if ... (traversalState.m_totalLength >= traversalState.m_desiredLength)) { FloatSize change = traversalState.m_current - traversalState.m_previous; float slope = atan2f(change.height(), change.width()); if (traversalState.m_action == PathTraversalState::TraversalPointAtLength) { float offset = traversalState.m_desiredLength - traversalState.m_totalLength; traversalState.m_current.move(offset * cosf(slope), offset * sinf(slope)); I can't exactly remember what the problem was, but it's related to the slope calculation. We're really only doing a bad approimation of the actual "point at length" (ie. gimme the path point at 30% of the path length). If the path consisted of _one_ large curve segment, we're approximating _the whole_ segment using a line, as you can see above - this doesn't make too much sense and results in whacky layout.... Please fix :-) Greetings, Niko
Eric Seidel (no email)
Comment 3 2008-01-19 02:22:06 PST
Hum... I'm pretty sure I wrote the path point finding code. Perhaps i'll get a chance to fix it some day. :)
Nikolas Zimmermann
Comment 4 2010-07-08 01:50:01 PDT
Works in trunk, the root of the problem was missing subpixel positioning.
Note You need to log in before you can comment on or make changes to this bug.