No subject
Tue May 3 15:05:30 PDT 2016
"""The returned FcFontSet references FcPattern structures which may be shared by the
return value from multiple FcFontSort calls, applications must not modify these patterns.
Instead, they should be passed, along with p to FcFontRenderPrepare which combines them into
a complete pattern."""
That means each call to FcFontSort() must be followed up by a call to FcFontRenderPrepare(),
else the patterns will lack information about how to draw the font properly.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::fallbacks):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfreetypeFontPlatformDataFreeTypecpp">trunk/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (213531 => 213532)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog 2017-03-07 20:16:03 UTC (rev 213531)
+++ trunk/Source/WebCore/ChangeLog 2017-03-07 20:36:29 UTC (rev 213532)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2017-03-07 Michael Catanzaro <mcatanzaro at igalia.com>
+
+ [FreeType] FontPlatformData::fallbacks() returns unprepared FcPatterns
+ https://bugs.webkit.org/show_bug.cgi?id=164689
+
+ Reviewed by Carlos Garcia Campos.
+
+ From the documentation of FcFontSort():
+
+ """The returned FcFontSet references FcPattern structures which may be shared by the
+ return value from multiple FcFontSort calls, applications must not modify these patterns.
+ Instead, they should be passed, along with p to FcFontRenderPrepare which combines them into
+ a complete pattern."""
+
+ That means each call to FcFontSort() must be followed up by a call to FcFontRenderPrepare(),
+ else the patterns will lack information about how to draw the font properly.
+
+ * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
+ (WebCore::FontPlatformData::fallbacks):
+
</ins><span class="cx"> 2017-03-07 Myles C. Maxfield <mmaxfield at apple.com>
</span><span class="cx">
</span><span class="cx"> Parsing font descriptors inside @font-face needs to accept ranges
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfreetypeFontPlatformDataFreeTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp (213531 => 213532)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp 2017-03-07 20:16:03 UTC (rev 213531)
+++ trunk/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp 2017-03-07 20:36:29 UTC (rev 213532)
</span><span class="lines">@@ -270,7 +270,10 @@
</span><span class="cx">
</span><span class="cx"> if (m_pattern) {
</span><span class="cx"> FcResult fontConfigResult;
</span><del>- m_fallbacks.reset(FcFontSort(nullptr, m_pattern.get(), FcTrue, nullptr, &fontConfigResult));
</del><ins>+ FcUniquePtr<FcFontSet> unpreparedFallbacks(FcFontSort(nullptr, m_pattern.get(), FcTrue, nullptr, &fontConfigResult));
+ m_fallbacks.reset(FcFontSetCreate());
+ for (int i = 0; i < unpreparedFallbacks.get()->nfont; i++)
+ FcFontSetAdd(m_fallbacks.get(), FcFontRenderPrepare(nullptr, m_pattern.get(), unpreparedFallbacks.get()->fonts[i]));
</ins><span class="cx"> }
</span><span class="cx"> return m_fallbacks.get();
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>
More information about the webkit-changes
mailing list