Skip to content

Commit

Permalink
Merge pull request #14 from movableink/always-complex-text
Browse files Browse the repository at this point in the history
Always use complex text code path
  • Loading branch information
mnutt committed Aug 11, 2023
2 parents 194b8bc + 1cc87f2 commit 3cfcdcf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
10 changes: 0 additions & 10 deletions Source/WebCore/platform/graphics/FontCascade.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,17 +307,7 @@ class FontCascade : public CanMakeWeakPtr<FontCascade> {

bool advancedTextRenderingMode() const
{
#if PLATFORM(QT)
auto textRenderingMode = m_fontDescription.textRenderingMode();
if (textRenderingMode == TextRenderingMode::GeometricPrecision || textRenderingMode == TextRenderingMode::OptimizeLegibility)
return true;
if (textRenderingMode == TextRenderingMode::OptimizeSpeed)
return false;

return false;
#else
return m_fontDescription.textRenderingMode() != TextRenderingMode::OptimizeSpeed;
#endif
}

bool computeEnableKerning() const
Expand Down
3 changes: 3 additions & 0 deletions Source/WebCore/platform/graphics/FontCascadeFonts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,9 @@ GlyphData FontCascadeFonts::glyphDataForCharacter(UChar32 c, const FontCascadeDe
ASSERT(m_thread ? m_thread->ptr() == &Thread::current() : isMainThread());
ASSERT(variant != AutoVariant);

if (c == 10) // newline
c = space;

if (variant != NormalVariant)
return glyphDataForVariant(c, description, variant);

Expand Down
6 changes: 5 additions & 1 deletion Source/WebCore/platform/graphics/qt/FontCascadeQt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,12 @@ void FontCascade::drawGlyphs(GraphicsContext& context, const Font& font, const G
for (int i = 0; i < numGlyphs; ++i) {
Glyph glyph = glyphs[i];
float advance = advances[i].x();
if (!glyph)

if (!glyph) {
width += advance;
continue;
}

glyphIndexes.append(glyph);
positions.append(QPointF(width, 0));
width += advance;
Expand Down

0 comments on commit 3cfcdcf

Please sign in to comment.