Qt-4.8 WebKit + QtWebKit-2.3.x上CSS3 Web Fonts支持的一些记录
2014-10-13 18:26
337 查看
Chrome 37 | Firefox 32 | IE 8 | ||
TTF(TrueType) | ○ | ○ | ○ | ╳ |
OTF(OpenType) | ○ | ○ | ○ | ╳ |
WOFF | ○ | ○ | ○ | ╳ |
SVG | ╳ | ○ | ╳ | ╳ |
local() | ╳ | ○ | ○ | ╳ |
EOT | ╳ | ╳ | ╳ | ○ |
WOFF 2.0 | ╳ | ╳ | ╳ | ╳ |
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) && !H***E(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 // H***E(QRAWFONT)
相关文章推荐
- webkit(qt)的一些问题
- Web 开发人员需要了解的一些 HTML5 和 CSS3 片段
- Qt 笔记(记录使用Qt中遇到的一些问题)
- css3文字渐变效果。仅支持webkit内核浏览
- 主要记录下在ubuntu中配置web服务器的一些小结
- net控件中数据导到Excel的格式 首先,我们了解一下excel从web页面上导出的原理。当我们把这些数据发送到客户端时,我们想让客户端程序(浏览器)以excel的格式读取它,所以把mime类型设为:application/vnd.ms-excel,当excel读取文件时会以每个cell的格式呈现数据,如果cell没有规定的格式,则excel会以默认的格式去呈现该cell的数据。这样就给我们提供了自定义数据格式的空间,当然我们必须使用excel支持的格式。下面就列出常用的一些格式: 1) 文本
- 关于tomcat的路径(WEB-INF)的一些路径的记录
- 关于web页面清洗的一些记录,杂乱、待梳理和深入
- CutyCapt - A Qt WebKit Web Page Rendering Capture Utility
- python使用QtWebKit代码记录
- QT/WebKit::DirectFB模式遥控器支持
- QtWebKit based Web Browser
- android2.3中webkit在webview的一个更新 推荐
- Android WebKit EventSource 支持修改记录
- CS001497 - Add data to a web page with JavaScript, WebKit, and Qt
- Qt WebKit可以做什么(三)——开发包含丰富web内容的本地应用
- 记录最近web的一些学习和后面的计划
- CS001496 - Gather data from web page with JavaScript, WebKit, and Qt
- 记录Qt学习的一些经典
- app内嵌web的一些问题记录