How tweak space typographics with QTextEdit ?
-
Hello,
would like understanding possibility to tweak space as & thinsp; between letter/word with QTextEdit...I try to import a text witch have html format like:
@"<p style=font-family:plantagenet cherokee;font-
size:16px;text-indent:0px;margin:0px;text-
align:justify;white-space:normal;letter-
spacing:0.01px;word-spacing:0.1px;text-align-
last:justify;>"
// word word@
I observe that style seems doesn't works like:
word-spacing (with different values)
text-align: justify
thin_space looks as an usual space...What is possible to do in that case ?
-
QTextEdit only supports a very small "subset of HTML/CSS":http://qt-project.org/doc/qt-4.8/richtext-html-subset.html.
So in this case you're better off with an QWebView and set it's "contentEditable property":http://qt-project.org/doc/qt-4.8/qwebpage.html#contentEditable-prop to get a full HTML/CSS support. -
@Konstantin Ritt: I don't understand exactly what you mean, may be add a tag for it ?
@Raven_worx : I have trying QWebView with previewer sample whitch works with the code above as expected... but i saw some difference with same code run on a web apps like CkEditor (a text editor in JS).
I observe that space between words have not same bulk (it's very special things about typographics displaying), what result in some line are largest/smallest that expected and text format dissolve.
I observe also double space in the html text doesn't work, don't know why...
-
[quote author="Marco_105" date="1367231732"]@Konstantin Ritt: I don't understand exactly what you mean, may be add a tag for it ?[/quote]
he meant you can submit a bug "here":https://bugreports.qt-project.org.
[quote author="Marco_105" date="1367231732"]
@Raven_worx : I have trying QWebView with previewer sample whitch works with the code above as expected... but i saw some difference with same code run on a web apps like CkEditor (a text editor in JS).I observe that space between words have not same bulk (it's very special things about typographics displaying), what result in some line are largest/smallest that expected and text format dissolve.
I observe also double space in the html text doesn't work, don't know why...[/quote]
The engine used by QWebView is webkit so if you compared your sample to your JS editor in another browser it may be that there are small differences in rendering. Also it may be possible that the JS editor adds some additional CSS which also impacts rendering the mentioned differences.
You need to investigate further what causes the difference appearing directly in HTML. i would suggest using "Firebug browser extension":https://getfirebug.com/ in your (external) browser.