Commit 2abe0bb6 authored by Khaled Hosny's avatar Khaled Hosny
Browse files

Fix inverted y sign for glyph positioning

This is causing vertical glyph positioning to move in the wrong
direction e.g. marks go below base glyph instead of above. Seems to be a
regression introduced in:

commit 83dac189
Author: Tavmjong Bah <tavmjong@free.fr>
Date:   Tue Nov 3 13:19:36 2015 +0100

    Rearrange code to make handling of baseline clearer.

    (bzr r14430.1.3)
parent 7f48eea3
......@@ -767,7 +767,7 @@ void Layout::Calculator::_outputLine(ParagraphInfo const &para,
if( dominant_baseline == SP_CSS_BASELINE_AUTO ) dominant_baseline = SP_CSS_BASELINE_ALPHABETIC;
}
new_glyph.y += delta_y;
new_glyph.y -= delta_y;
// TODO: Should also check 'glyph_orientation_vertical' if 'text-orientation' is unset...
if( new_span.text_orientation == SP_CSS_TEXT_ORIENTATION_SIDEWAYS ||
......@@ -801,7 +801,7 @@ void Layout::Calculator::_outputLine(ParagraphInfo const &para,
if( dominant_baseline == SP_CSS_BASELINE_AUTO ) dominant_baseline = SP_CSS_BASELINE_ALPHABETIC;
new_glyph.y -= delta_y;
new_glyph.y += delta_y;
new_glyph.y += new_span.font_size * para.pango_items[unbroken_span.pango_item_index].font->GetBaselines()[ dominant_baseline ];
new_glyph.width = unbroken_span_glyph_info->geometry.width * font_size_multiplier;
......
......@@ -2,6 +2,7 @@
#add your test here (do not put the .svg extension)
set(RENDERING_TESTS
test-empty
test-glyph-y-pos
)
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="600" height="600"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1"
viewBox="0 0 600 600">
<style type="text/css">
text {
font-family: DejaVu Sans;
font-size: 36px;
}
.title {
text-anchor: middle;
}
</style>
<g>
<text x="50" y="200">G̃g̃X̃x̃</text>
<text x="300" y="200" style="writing-mode:vertical-lr;">G̃g̃X̃x̃</text>
<text x="500" y="200" style="writing-mode:vertical-lr;text-orientation:upright">G̃g̃X̃x̃</text>
</g>
<text class="title" x="50%" y="120">Composed Glyphs</text>
</svg>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment