Summary: | [Qt] Glyphs in vertical text tests are rotated 90 degrees clockwise | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Koan-Sin Tan <koansin.tan> | ||||||||||||
Component: | WebKit Qt | Assignee: | Nobody <webkit-unassigned> | ||||||||||||
Status: | RESOLVED INVALID | ||||||||||||||
Severity: | Normal | CC: | benjamin, commit-queue, donggwan.kim, eric, hausmann, kenneth, kling, koansin.tan, yangchen | ||||||||||||
Priority: | P2 | Keywords: | PlatformOnly, Qt, QtTriaged | ||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||||
Hardware: | All | ||||||||||||||
OS: | All | ||||||||||||||
Bug Depends on: | |||||||||||||||
Bug Blocks: | 98587 | ||||||||||||||
Attachments: |
|
Description
Koan-Sin Tan
2010-12-23 23:45:58 PST
Created attachment 77406 [details]
initial patch to make vertical text work
An initial patch to make vertical text work. There are many problems in this patch, but it works.
1. Qt doesn't export font/text matrix (yet), so we have to rotate the QPainter at least once for each QString
2. Qt doesn't export API to get GSUB tables (yet), it's not quite difficult to do vertical glyph substitution
3. Currently, glyph positions use QFontMetrics to measure the width a horizontal string. This is not quite. Should be able to measure the height of a string with vertical layout
(In reply to comment #2) > Why does every platform have to solve this individually? > bug 48459, bug 51450 and bug 50619 Platform Independent part is done by Dave Hyatt, I think. These are platform dependent parts. I was intended to submitted all the patches to bug 48459, but was told to file a new bug for Chromium Linux. It turns out these are quite different. Chromium Linux uses Skia and has HarfBuzz exported. Chromium Windows uses Windows GDI Gtk uses Gtk+Cairo+freetype2 Qt uses its own QFont Some use Glyphs API, some not. > Chromium Linux uses Skia and has HarfBuzz exported. > Chromium Windows uses Windows GDI > Gtk uses Gtk+Cairo+freetype2 > Qt uses its own QFont Qt also uses HarfBuzz. In Qt 4.8 we will export the glyph API, thought I believe we will already export it privately in a 4.7.x subrelease. > Some use Glyphs API, some not. (In reply to comment #4) > > Chromium Linux uses Skia and has HarfBuzz exported. > > Chromium Windows uses Windows GDI > > Gtk uses Gtk+Cairo+freetype2 > > Qt uses its own QFont > > Qt also uses HarfBuzz. In Qt 4.8 we will export the glyph API, thought I believe we will already export it privately in a 4.7.x subrelease. Sounds good. But my Mac Ports uses Qt 4.7, my Ubuntu 10.04 still uses 4.6, I think :-) Comment on attachment 77406 [details] initial patch to make vertical text work View in context: https://bugs.webkit.org/attachment.cgi?id=77406&action=review > WebCore/platform/graphics/qt/FontQt.cpp:222 > + drawVertical(p, pt, string); A space is missing here for the indentation. Comment on attachment 77406 [details]
initial patch to make vertical text work
This code only sort of supports vertical text. You still need code that will pick the correct vertical glyphs (punctuation glyphs are different for example). It's not enough to just rotate the ideographs.
(In reply to comment #7) > (From update of attachment 77406 [details]) > This code only sort of supports vertical text. You still need code that will pick the correct vertical glyphs (punctuation glyphs are different for example). It's not enough to just rotate the ideographs. Yes, but, Qt doesn't export API to get GSUB tables (yet), it's quite difficult to do vertical glyph substitution :-) Created attachment 80015 [details] updated patch (work in progress) need Jiang Jiang's patched Qt 4.8, http://qt.gitorious.org/~jiang/qt/jiangs-qt/commits/vertical Created attachment 80016 [details]
screenshot
Created attachment 137308 [details]
updated patch[solved a bug]
The old patch can't work well on other's vertion.(such as webkit R97664).
Because there is a bug on the old patch.
This new patch solve the bug.
(In reply to comment #1) > Created an attachment (id=77406) [details] > initial patch to make vertical text work > > An initial patch to make vertical text work. There are many problems in this patch, but it works. > > 1. Qt doesn't export font/text matrix (yet), so we have to rotate the QPainter at least once for each QString > 2. Qt doesn't export API to get GSUB tables (yet), it's not quite difficult to do vertical glyph substitution > 3. Currently, glyph positions use QFontMetrics to measure the width a horizontal string. This is not quite. Should be able to measure the height of a string with vertical layout In my project , 1、I had updated QFontMetrics'width interface to support vertical flag. 2、I had updated freetype font engine to get the gsub tables. 3、I had done some codes to support spectial process(For example,90 degree rotate 、 180 degree rotate for special glyph) 4、I had modified some bugs in Jiang Jiang's patch. I dont's know whether this patchs can be passed. Created attachment 150521 [details]
updated patch (support calculating width for vertical text )
Comment on attachment 150521 [details] updated patch (support calculating width for vertical text ) This patch have to work together with patchs in https://bugreports.qt-project.org/browse/QTBUG-529. Attachment 150521 [details] did not pass style-queue:
Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files']" exit_code: 1
Total errors found: 0 in 0 files
If any of these errors are false positives, please file a bug against check-webkit-style.
=== Bulk closing of Qt bugs === If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it and remove [Qt] from the summary. If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines. |