<div dir="ltr">Hi,<div>I am trying to use Cairo-pango to render text as svg. The following ruby code shows that the ink lbearing=0 & ascent=-16. So i do a move_to (0,+16). But the output svg has y at 66.40091. I expected output svg y to begin at 16. So the text is not snug fit to right top and there is a vertical padding of 50 pixels. Is my code wrong or my expectation from the code wrong. Is it possible to position the text so that it 'hugs' the top & left.</div><div><br></div><div>----txt2svg.rb----------</div><div><div>def draw_text(cr)</div><div>text1 = "The grass is greener where we're going."</div><div>  layout = cr.create_pango_layout</div><div>  desc = Pango::FontDescription.new(FONT1)</div><div>  layout.set_font_description(desc)</div><div>  layout.set_text(text1)</div><div>  ink,logical=layout.pixel_extents</div><div>  puts ink.lbearing,ink.ascent</div><div>  cr.move_to(ink.lbearing*-1,ink.ascent*-1)</div><div>  cr.update_pango_layout(layout)</div><div>  cr.show_pango_layout(layout)</div><div>end</div><div>surface = Cairo::SVGSurface.new("text.svg",1080, 720)</div><div>cr = Cairo::Context.new(surface);</div><div>draw_text(cr)</div></div><div><br></div><div>-----------------</div><div><br></div><div>---text.svg---</div><br><br><?xml version="1.0" encoding="UTF-8"?> <br><br><svg xmlns="<a href="http://www.w3.org/2000/svg">http://www.w3.org/2000/svg</a>" xmlns:xlink="<a href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</a>" width="1080pt" height="720pt" viewBox="0 0 1080 720" version="1.1"> <br><br><defs> <br><br><g> <br><br><symbol overflow="visible" id="glyph0-0"> <br><br><path style="stroke:none;" d="M 11.765625 -7.484375.......<br><br>.........<br><br></defs><br><br><g id="surface1"><br><br><g style="fill:rgb(0%,0%,0%);fill-opacity:1;"><br><br>  <use xlink:href="#glyph0-1" x="0" y="66.400391"/><br><br>  <use xlink:href="#glyph0-2" x="22.65625" y="66.400391"/><br><br>  <use xlink:href="#glyph0-3" x="46.416016" y="66.400391"/><br><br>  <use xlink:href="#glyph0-4" x="68.832031" y="66.400391"/><br>....<div></svg><br><div>---------------</div></div><div><br></div><div>Jagan</div></div>