Bug 475092. Fix incorrect positioning on Windows when glyph run includes vertically-offset glyphs is drawn to canvas. r=vlad

--HG--
extra : rebase_source : 30a3730fd3db418854462cc31dc0ee06c7f56ae0
This commit is contained in:
Jonathan Kew 2009-01-30 20:15:08 +13:00
Родитель 3b14f7cc85
Коммит 67ebf17341
9 изменённых файлов: 97 добавлений и 5 удалений

Просмотреть файл

@ -44,6 +44,8 @@ glyph-safety-margin.patch: Change the glyph dropping safety margin from 2em to 1
win32-vertically-offset-glyph.patch: bug 454098; vertical positioning errors when drawing glyph runs including delta-y offsets on screen via GDI
win32-canvas-glyph-position.patch: bug 475092; horizontal positioning errors when drawing glyph runs with delta-y offsets to canvas through win32-font
==== pixman patches ====
endian.patch: include cairo-platform.h for endian macros

Просмотреть файл

@ -1187,12 +1187,12 @@ _add_glyph (cairo_glyph_state_t *state,
if (status)
return status;
state->start_x = logical_x;
} else {
dx = logical_x - state->last_x;
status = _cairo_array_append (&state->dx, &dx);
if (status)
return status;
}
dx = logical_x - state->last_x;
status = _cairo_array_append (&state->dx, &dx);
if (status)
return status;
} else {
state->start_x = logical_x;
}

Просмотреть файл

@ -0,0 +1,31 @@
diff --git a/gfx/cairo/cairo/src/cairo-win32-font.c b/gfx/cairo/cairo/src/cairo-win32-font.c
--- a/gfx/cairo/cairo/src/cairo-win32-font.c
+++ b/gfx/cairo/cairo/src/cairo-win32-font.c
@@ -1182,22 +1182,22 @@ _add_glyph (cairo_glyph_state_t *state,
if (state->glyphs.num_elements > 0) {
int dx;
if (logical_y != state->last_y) {
status = _flush_glyphs (state);
if (status)
return status;
state->start_x = logical_x;
+ } else {
+ dx = logical_x - state->last_x;
+ status = _cairo_array_append (&state->dx, &dx);
+ if (status)
+ return status;
}
-
- dx = logical_x - state->last_x;
- status = _cairo_array_append (&state->dx, &dx);
- if (status)
- return status;
} else {
state->start_x = logical_x;
}
state->last_x = logical_x;
state->last_y = logical_y;
status = _cairo_array_append (&state->glyphs, &glyph_index);

Двоичные данные
layout/reftests/fonts/PositioningTest1.ttf Normal file

Двоичный файл не отображается.

Двоичные данные
layout/reftests/fonts/PositioningTest2.ttf Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,19 @@
<html>
<head>
<style type="text/css">
@font-face {
font-family: Pos;
src: url(../fonts/PositioningTest1.ttf);
}
p {
font-family: Pos;
font-size: 50px;
opacity: 0.5;
}
</style>
</head>
<body>
<!-- The PositioningTest2 font uses a GPOS positioning lookup
to replace the 'o' with a raised version of the glyph -->
<p>Hello World!</p>
</body>

Просмотреть файл

@ -0,0 +1,19 @@
<html>
<head>
<style type="text/css">
@font-face {
font-family: Pos;
src: url(../fonts/PositioningTest1.ttf);
}
p {
font-family: Pos;
font-size: 50px;
opacity: 0.5;
}
</style>
</head>
<body>
<!-- The capital O character in the PositioningTest font
is actually a raised lowercase o glyph -->
<p>HellO WOrld!</p>
</body>

Просмотреть файл

@ -0,0 +1,19 @@
<html>
<head>
<style type="text/css">
@font-face {
font-family: Pos;
src: url(../fonts/PositioningTest2.ttf);
}
p {
font-family: Pos;
font-size: 50px;
opacity: 0.5;
}
</style>
</head>
<body>
<!-- The PositioningTest2 font uses a GSUB substitution lookup
to replace the 'o' with a raised version of the glyph -->
<p>Hello World!</p>
</body>

Просмотреть файл

@ -32,3 +32,5 @@ random-if(MOZ_WIDGET_TOOLKIT=="gtk2") != zwnj-01.html zwnj-01-notref.html # Bad
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == cgj-01.html cgj-01-ref.html # bug 455455
== 444656.html 444656-ref.html
== 449555-1.html 449555-1-ref.html
HTTP(..) == 475092-sub.html 475092-ref.html
HTTP(..) == 475092-pos.html 475092-ref.html