Hi, I use QGraphicsTextItem to show QTextDocument by using setDocument function, could you tell how to change line spacing, because i need to decrease it.
Hi, I use QGraphicsTextItem to show QTextDocument by using setDocument function, could you tell how to change line spacing, because i need to decrease it.
You could use setHtml with modified CSS line-height attribute. Or have a look if rtf has a similar option. (Or whatever you have in your QTextDocument. Sorry but my crystal ball is still in repair...)
line-height attribute isn't supported by Qt
http://doc.trolltech.com/4.5/stylesh...-of-properties
so I can't do it by this way...
Jepp, sorry, I was misreading the information under QTextDocument::defaultStyleSheetSince only the syntax is meant, you have to go the harder way using QTextLayout yourself. You might want have a look at http://doc.trolltech.com/qq/qq24-textlayouts.html.The style sheet needs to be compliant to CSS 2.1 syntax.
mazurekwrc (23rd March 2009)
Is there a posibility to adjust the line spacing in the font metrics?
I use ttf font with Qt 4.5 on a linux system.
Thanks for help
I use QGraphicsTextItem with Qt4.5. As act of desperation I changed font properties of true type font with help of fontforge.
hhead ascent offset
hhead descent offset
hhead line gap
It works.
Bookmarks