Skip to content

Commit 3cfcdcf

Browse files
authored
Merge pull request #14 from movableink/always-complex-text
Always use complex text code path
2 parents 194b8bc + 1cc87f2 commit 3cfcdcf

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

Source/WebCore/platform/graphics/FontCascade.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -307,17 +307,7 @@ class FontCascade : public CanMakeWeakPtr<FontCascade> {
307307

308308
bool advancedTextRenderingMode() const
309309
{
310-
#if PLATFORM(QT)
311-
auto textRenderingMode = m_fontDescription.textRenderingMode();
312-
if (textRenderingMode == TextRenderingMode::GeometricPrecision || textRenderingMode == TextRenderingMode::OptimizeLegibility)
313-
return true;
314-
if (textRenderingMode == TextRenderingMode::OptimizeSpeed)
315-
return false;
316-
317-
return false;
318-
#else
319310
return m_fontDescription.textRenderingMode() != TextRenderingMode::OptimizeSpeed;
320-
#endif
321311
}
322312

323313
bool computeEnableKerning() const

Source/WebCore/platform/graphics/FontCascadeFonts.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,9 @@ GlyphData FontCascadeFonts::glyphDataForCharacter(UChar32 c, const FontCascadeDe
495495
ASSERT(m_thread ? m_thread->ptr() == &Thread::current() : isMainThread());
496496
ASSERT(variant != AutoVariant);
497497

498+
if (c == 10) // newline
499+
c = space;
500+
498501
if (variant != NormalVariant)
499502
return glyphDataForVariant(c, description, variant);
500503

Source/WebCore/platform/graphics/qt/FontCascadeQt.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,12 @@ void FontCascade::drawGlyphs(GraphicsContext& context, const Font& font, const G
312312
for (int i = 0; i < numGlyphs; ++i) {
313313
Glyph glyph = glyphs[i];
314314
float advance = advances[i].x();
315-
if (!glyph)
315+
316+
if (!glyph) {
317+
width += advance;
316318
continue;
319+
}
320+
317321
glyphIndexes.append(glyph);
318322
positions.append(QPointF(width, 0));
319323
width += advance;

0 commit comments

Comments
 (0)