- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我用QtWebkit写了一个程序。我在此应用程序中使用了阿拉伯字体。但如下所示的文本不适用。是否有解决方案可以解决?
(来源:shiaupload.ir)
html代码:{
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<style>
/*Twe Arabic font for test:*/
@font-face {
font-family: '__me_quran';
src: url(me_quran.ttf) format('truetype');
}
@font-face {
font-family: '__traditionalArabic';
src: url(trado.ttf) format('truetype');
}
#para1
{
font-family :/*__me_quran*/__traditionalArabic;
text-align : justify;/*In this project i need justify alinement*/
direction:rtl;
}
</style>
<script type="text/javascript" >
var step=1;
function plusZoom1(){
document.getElementById("para1").style.zoom = parseFloat(step);
step +=0.5;
}
function minusZoom1(){
step -=0.5;
document.getElementById("para1").style.zoom = parseFloat(step);
}
</script>
<body>
<input type="button" value="+" onclick="plusZoom1();" />
<input type="button" value="-" onclick="minusZoom1();" />
<p id="para1">
بِسْمِ اَللّٰهِ اَلرَّحْمٰنِ اَلرَّحِيمِ ( 1 ) اَلْحَمْدُ لِلّٰهِ رَبِّ اَلْعٰالَمِينَ ( 2 ) اَلرَّحْمٰنِ اَلرَّحِيمِ ( 3 ) مٰالِكِ يَوْمِ اَلدِّينِ ( 4 ) إِيّٰاكَ نَعْبُدُ وَ إِيّٰاكَ نَسْتَعِينُ ( 5 ) اِهْدِنَا اَلصِّرٰاطَ اَلْمُسْتَقِيمَ ( 6 ) صِرٰاطَ اَلَّذِينَ أَنْعَمْتَ عَلَيْهِمْ غَيْرِ اَلْمَغْضُوبِ عَلَيْهِمْ وَ لاَ اَلضّٰالِّينَ ( 7 )
</p>
</body>
</html>
}
qt代码:{
#include <QtGui/QApplication>
#include <QWebView>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QWebView wv;
wv.setUrl(QUrl::QUrl("qrc:/rc/a.html"));
wv.show();
return a.exec();
}
}
最佳答案
我很久以前就遇到过类似的问题。 Qt 没有显示一些应该出现的阿拉伯字符。我不得不更改 Qt 的字体绘制机制并使用“FreeType”字体库来绘制字体。您可以使用 FreeType。更多信息请点击:http://freetype.sourceforge.net/index2.html
或者您可以使用其他图形引擎来绕过 Qt 的绘图 - 它可以显示这些字体。
关于qt - 在 QtWebKit 中显示阿拉伯字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12269764/
使用 QtWebKit (C++) 构建的应用程序能否在 Windows、Mac OSX 和 Linux 上成功地使用 Javascript、flash 插件、html5 呈现网页? QtWebKit
QtWebKit 调用 QWebPage::loadFinished ( false )当网页无法加载时 - 但不知道为什么会失败。 如何获取详细的错误消息,例如 HTTP 响应代码或其他消息? 最佳
我是 QtWebKit 的初学者,我构建了加载页面的简单 Web 框架(服务器端)当我从这个页面提交数据时,我喜欢在 C++ 端捕获来自服务器的响应字符串我怎样才能做到这一点 ? 最佳答案 我对 Qt
我被要求研究一种在 QT 之外管理 QTWebKit 模块的方法。这个想法是使用 QTWebKit 作为应用程序的界面(GUI)。所需的(管理器)应该作为 GUI 和用 C++ 编写的主应用程序之间的
我将图像以二进制格式存储在 SQLite 数据库(客户端)中,并在桌面应用程序中使用 QtWebKit。 除了需要显示存储在数据库中的二进制图像之外,一切正常。 如何在 QtWebKit 中显示数据库
我使用 QWebView 加载一个页面,然后我只用 reload()slot 重新加载它。 loadFinished(bool) 信号通常表示错误。我还使用 QwebView 的网络访问管理器的 fi
我是Qt的新手。 我正在构建一个控制台应用程序,我需要处理许多现实世界的html页面。 QtWebkit是一个容易选择的选择,因为它的API明确易用且易于获得。 我 checkout 了文档,他们说我
Qt5.2.1 中的错误: 唯一的问题已在QPrintPreviewDialog中得到纠正,但当打印到纸张上时,故障仍然存在。 使用QPrintPreviewDialog页面工作完美,但是在第二页的“
在QtWebKit中,有没有一种方法可以控制每个HTTP请求的超时时间?例如,如果我为每个 HTTP 请求设置 3 秒,如果 3 秒后请求未完成,则请求中止并开始其他请求。 我检查了 QNetwork
我正在开发一个使用 QT-Jambi 将文本渲染为图像的项目。 webkit 渲染 HTML 并生成图像。使用单线程运行代码时没有问题但是当我使用多个线程(5-6)运行程序,每个线程多次调用 getI
请告诉我如何处理 QtWebKit 中的网页身份验证提示(可能是一些可以设置用户名和密码的事件)? 谢谢 最佳答案 QtWebkit提供了操作网页元素的接口(interface),通过这些接口(int
我试图让 QtWebkit 允许通过 Javascript 打开页面但没有成功。 我不使用 QWebView,只使用 QWebPage( headless 运行)。我从 QWebPage 派生并覆盖了
我最近在玩 QtWebkit,我想知道是否有可能解析 QWebView 中显示的负责事件的元素,例如鼠标事件。 我在 WebView 对象上安装了一个 EventFilter 函数,其功能如下: bo
将使用 QWebView() 显示的网页保存到文件的最佳和最简单方法是什么? from PyQt4.QtCore import * from PyQt4.QtWebKit import * from
目前,我将 HTML、JS、CSS、图形等存储在本地硬盘上,并使用 QWebFrame::SetUrl( QUrl::fromLocalFile( "appFolder\html\index.html
如何在输入字段中获取用户输入? QObject::connect( webView, SIGNAL(loadStarted()), this, SLOT(slotLoadStarted()) ); v
我在基于 Arm 的平台上移植了 QtWebkit。我们能够运行 QtTestBrowser。 我想在上面的浏览器中禁用“同源策略”。 请让我知道是否有任何机构对此有想法。 最佳答案 我知道这是旧的,
我正在按照 an example in the QtWebkit documentation 编写缩略图生成器.我想避免错误页面的截图,例如404 not found或 503 Internal se
我用QtWebkit写了一个程序。我在此应用程序中使用了阿拉伯字体。但如下所示的文本不适用。是否有解决方案可以解决? (来源:shiaupload.ir) an example code in her
我正在使用 qt 和 qtWebkit 编写应用程序,用于访问 Web 应用程序。在 Web 应用程序中,我们有各种需要处理的自定义协议(protocol),例如'我的协议(protocol):var
我是一名优秀的程序员,十分优秀!