Qt-4.8 WebKit + QtWebKit-2.3.x上CSS3 Web Fonts支持的一些记录
来源:互联网 发布:mariadb mysql 对比 编辑:程序博客网 时间:2024/05/29 07:17
TTF/OTF格式的字体文件属于Web Fonts默认支持的;
WOFF需要开启一个条件宏,也没什么问题
EOT是IE专用的
SVG需要启用ENABLE(SVG_FONTS),问题是最终链接时报错:
g++ -fuse-ld=gold -Wl,--gc-sections -Wl,--no-undefined -Wl,-O1 -Wl,-rpath,/home/cteng/qt48/WebKitBuild/Release/lib -Wl,-rpath,/opt/browser13/qt/lib -o ../../bin/QtTestBrowser obj/release/QtInitializeTestFonts.o obj/release/locationedit.o obj/release/launcherwindow.o obj/release/main.o obj/release/mainwindow.o obj/release/urlloader.o obj/release/utils.o obj/release/webpage.o obj/release/webview.o obj/release/fpstimer.o obj/release/cookiejar.o obj/release/moc_locationedit.o obj/release/moc_launcherwindow.o obj/release/moc_mainwindow.o obj/release/moc_urlloader.o obj/release/moc_webinspector.o obj/release/moc_webpage.o obj/release/moc_webview.o obj/release/moc_fpstimer.o obj/release/moc_cookiejar.o obj/release/qrc_QtTestBrowser.o -L/home/cteng/qt48/WebKitBuild/Release/lib -L/opt/browser13/qt/plugins/platforms -L/opt/browser13/qt/plugins/generic -L/opt/browser13/qt/lib -L/usr/X11R6/lib -lQtWebKit -lgio-2.0 -lgstapp-0.10 -lgstpbutils-0.10 -lgstvideo-0.10 -lgstaudio-0.10 -lgstbase-0.10 -lgstinterfaces-0.10 -pthread -lgstfft-0.10 -lm -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lxml2 -lglib-2.0 -lQtSql -L/opt/browser13/qt/lib -lQtXmlPatterns -lQtOpenGL -L/usr/lib/i386-linux-gnu -lQtGui -lQtNetwork -lQtCore -lGLESv2 -lpthread
/home/cteng/qt48/WebKitBuild/Release/lib/libQtWebKit.so: undefined reference to `WebCore::GlyphPageTreeNode::getRoot(unsigned int)'
/home/cteng/qt48/WebKitBuild/Release/lib/libQtWebKit.so: undefined reference to `WebCore::GlyphPageTreeNode::getChild(WebCore::FontData const*, unsigned int)'
/home/cteng/qt48/WebKitBuild/Release/lib/libQtWebKit.so: undefined reference to `WebCore::WidthIterator::WidthIterator(WebCore::Font const*, WebCore::TextRun const&, WTF::HashSet<WebCore::SimpleFontData const*, WTF::PtrHash<WebCore::SimpleFontData const*>, WTF::HashTraits<WebCore::SimpleFontData const*> >*, bool, bool)'
/home/cteng/qt48/WebKitBuild/Release/lib/libQtWebKit.so: undefined reference to `WebCore::Font::glyphDataForCharacter(unsigned int, bool, WebCore::FontDataVariant) const'
/home/cteng/qt48/WebKitBuild/Release/lib/libQtWebKit.so: undefined reference to `WebCore::SurrogatePairAwareTextIterator::SurrogatePairAwareTextIterator(unsigned short const*, int, int, int)'
/home/cteng/qt48/WebKitBuild/Release/lib/libQtWebKit.so: undefined reference to `WebCore::WidthIterator::advance(int, WebCore::GlyphBuffer*)'
/home/cteng/qt48/WebKitBuild/Release/lib/libQtWebKit.so: undefined reference to `WebCore::SimpleFontData::widthForGlyph(unsigned short) const'
/home/cteng/qt48/WebKitBuild/Release/lib/libQtWebKit.so: undefined reference to `WebCore::Font::glyphDataAndPageForCharacter(unsigned int, bool, WebCore::FontDataVariant) const'
/home/cteng/qt48/WebKitBuild/Release/lib/libQtWebKit.so: undefined reference to `WebCore::SurrogatePairAwareTextIterator::advance(unsigned int)'
/home/cteng/qt48/WebKitBuild/Release/lib/libQtWebKit.so: undefined reference to `WebCore::SurrogatePairAwareTextIterator::consume(unsigned int&, unsigned int&)'
进一步调查发现,函数依赖于QRawFont特性,而这个特性在qt-4.8上不支持:
#if !(PLATFORM(QT) && !HAVE(QRAWFONT))
ALWAYS_INLINE FloatRect SimpleFontData::boundsForGlyph(Glyph glyph) const
{
if (isZeroWidthSpaceGlyph(glyph))
return FloatRect();
FloatRect bounds;
if (m_glyphToBoundsMap) {
bounds = m_glyphToBoundsMap->metricsForGlyph(glyph);
if (bounds.width() != cGlyphSizeUnknown)
return bounds;
}
bounds = platformBoundsForGlyph(glyph);
if (!m_glyphToBoundsMap)
m_glyphToBoundsMap = adoptPtr(new GlyphMetricsMap<FloatRect>);
m_glyphToBoundsMap->setMetricsForGlyph(glyph, bounds);
return bounds;
}
ALWAYS_INLINE float SimpleFontData::widthForGlyph(Glyph glyph) const
{
if (isZeroWidthSpaceGlyph(glyph))
return 0;
float width = m_glyphToWidthMap.metricsForGlyph(glyph);
if (width != cGlyphSizeUnknown)
return width;
if (m_fontData)
width = m_fontData->widthForSVGGlyph(glyph, m_platformData.size());
#if ENABLE(OPENTYPE_VERTICAL)
else if (m_verticalData)
#if USE(CG) || USE(CAIRO) || PLATFORM(WX) || USE(SKIA_ON_MAC_CHROMIUM)
width = m_verticalData->advanceHeight(this, glyph) + m_syntheticBoldOffset;
#else
width = m_verticalData->advanceHeight(this, glyph);
#endif
#endif
else
width = platformWidthForGlyph(glyph);
m_glyphToWidthMap.setMetricsForGlyph(glyph, width);
return width;
}
#endif // HAVE(QRAWFONT)
- Qt-4.8 WebKit + QtWebKit-2.3.x上CSS3 Web Fonts支持的一些记录
- 在Windows Qt-4.8.x平台上编译Qt-5.0+ WebKit(即qtwebkit-2.3.x) Debug版注意事项
- QTWebkit中的webkit/qt/api文档
- QTWebkit中的webkit/qt/api文档
- QT 上WEBKIT 的文章
- qt webkit 中文支持
- webkit(qt)的一些问题
- rk3288上支持 can bus 芯片MCP2515 的一些记录
- 基于webkit浏览器开发html/css3的web应用程序
- 支持语音输入的文本框(x-webkit-speech)
- Qt webkit收集网页内容的一些进展。
- 垃圾的Wordpress,老是引用fonts.googleapis.com上的Web字体文件,火了
- css3一些知识记录
- Windows平台下使用VS2012编译Qt-4.8.7源代码及单独编译qtwebkit-2.3.4
- 常用的CSS3 -webkit-前缀
- Qt之QtWebKit(一)
- Qt之QtWebKit(二)
- Qt之QtWebKit(一)
- 传递动态内存
- A View Controller Instantiation
- 番茄当下之作——莽荒纪
- 关于内存的一些问题
- c++函数参数类型-引用
- Qt-4.8 WebKit + QtWebKit-2.3.x上CSS3 Web Fonts支持的一些记录
- c单链表逆置
- 【构造】 Codeforces 476D Dreamoon and Sets
- 《算法竞赛入门经典(第2版)》代码 Chapter 2
- mount过程分析之三(do_mount -> do_new_mount)
- 静态库的生成
- 关于sda与hda
- HTML中实现两个列,每个列都固定宽度高度占满整个屏幕。如果内容多就出现滚动条!
- 热烈祝贺Polymer中文组织网站上线