开发者

How to configure the display fonts in qtwebkit through the console?

开发者 https://www.devze.com 2023-02-18 12:26 出处:网络
I\'m trying to achieve maximum accur开发者_如何学Cacy in rendering pages in qtwebkit in python (via xvfb). I am I have a problem with fonts.

I'm trying to achieve maximum accur开发者_如何学Cacy in rendering pages in qtwebkit in python (via xvfb). I am I have a problem with fonts.

Here's an example (image). This example shows that there is a problem with displaying in italics, but there is not at all sites. System is ubuntu 10.10 server and it set the standard packs of fonts (msttcorefonts and others), but it seems it does not affect the display of fonts in the qtwebkit. Who knows how to configure this?

Thanks!


I think the problem is: what is "maximum accuracy" in this case?

Where does the "true" image come from? I assume that is what you saw when you visited the site in your browser. Depending on your browser's settings (your personal settings and/or default settings) and on what styling information (css, style attributes...) the web page provides, it may look different. If the site doesn't specify what fonts to use, your browser will just use the default. If this is the case, the "true" and the "qtwebkit" renderings are equally "accurate", even though they look different.

This means that you probably just have to trust qtwebkit to render correctly.

If you absolutely want to have the rendering look the same as in your browser, you can try to configure your QWebView with the same settings through QWebView.settings() (see QWebSettings). Note that this still doesn't imply that the page will look that way for everyone.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号