Thanks for testing !<br><br>I attach a new code with Arial (maybe you're under windows) and a new png.<br>this time, I also draw a rectangle. 200x40px, red.<br><br>you can check that the scene produced my the pyqt code gives a rectangle like the one in the png. I did it in inkscape. a 200x40px red rect.<br>
<br>but for the font, "hello 1" is too big. "hello 2" seems to be of similar size. but it was scale.<br>I attach the .svg too.<br>in the svg (and the png), i wrote "hello" in arial/40<br><br>
why should I scale the text (with a ratio of .75) to get a correct size ?<br><br><div class="gmail_quote">2011/2/6 KONTRA, Gergely <span dir="ltr"><<a href="mailto:pihentagy@gmail.com">pihentagy@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">For me the 2 texts are sized equal if I remove the line, which scales the text.<br>
<br>
But I guess I do not have the font Norasi (rendered as some<br>
sans-serirf font on my PC).<br>
<br>
Gergo<br>
+-[ Gergely Kontra <<a href="mailto:pihentagy@gmail.com">pihentagy@gmail.com</a>> ]------------------+<br>
|                                                           |<br>
| Mobile:(+36 20)356 9656                                   |<br>
|                                                           |<br>
+- "Olyan lángész vagyok, hogy poroltóval kellene járnom!" -+<br>
<div><div></div><div class="h5"><br>
<br>
<br>
On Sat, Feb 5, 2011 at 11:14, Philippe Crave <<a href="mailto:philippe.crave@gmail.com">philippe.crave@gmail.com</a>> wrote:<br>
> Hello,<br>
><br>
> When I add to the Scene some rectangles and texts, rectangles are perfect,<br>
> but text are too big.<br>
><br>
> If I add a QGraphicsSimpleTextItem with a font_size of 40, it will display<br>
> bigger than the same text/font/size if I draw it in inkscape (or anywhere<br>
> else).<br>
> Seems that I have to scale with a ratio of 0.75 to get a correct size.<br>
><br>
> What am I doing wrong ?<br>
><br>
> here is my sample (I also attach a png with a text in Norasi with a size of<br>
> 40):<br>
><br>
> from PyQt4 import QtGui<br>
><br>
> import sys<br>
><br>
> app = QtGui.QApplication(sys.argv)<br>
><br>
> scene = QtGui.QGraphicsScene(0, 0, 400, 400)<br>
><br>
> scene.addSimpleText('HELLO 1', QtGui.QFont('Norasi', 40))<br>
><br>
> t = scene.addSimpleText('HELLO 2', QtGui.QFont('Norasi', 40))<br>
><br>
> t.setY(100)<br>
><br>
> t.scale(.75, .75)<br>
><br>
> view = QtGui.QGraphicsView(scene)<br>
><br>
> view.setRenderHint(QtGui.QPainter.Antialiasing)<br>
><br>
> view.setViewportUpdateMode(QtGui.QGraphicsView.BoundingRectViewportUpdate)<br>
><br>
> view.show()<br>
><br>
> sys.exit(app.exec_())<br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> PyQt mailing list    <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>
> <a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br>
><br>
</blockquote></div><br>