Skip to content

Commit

Permalink
Merge branch 'master' into fix/input_forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaraslaut authored Apr 28, 2024
2 parents ba5ecdb + f11a560 commit a6cd6ab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
<li>Add SGRSAVE and SGRRESTORE VT sequences to save and restore SGR state (They intentionally conflict with XTPUSHSGR and XTPOPSGR)</li>
<li>Update of contour.desktop file (#1423)</li>
<li>Fixed forwarding of input while in normal mode (#1468)</li>
<li>Fixed overlap of glyphs for long codepoints (#1349)</li>
<li>Fixed too verbose info during ssh session login (#1447)</li>
<li>Fixes corruption of sixel image on high resolution (#1049)</li>
<li>Fixes bad wording of OS/X to macOS (#1462)</li>
Expand Down
1 change: 1 addition & 0 deletions src/text_shaper/open_shaper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ namespace
gpos.presentation = presentation;
result.emplace_back(gpos);
}

return crispy::none_of(result, glyphMissing);
}
} // namespace
Expand Down
11 changes: 7 additions & 4 deletions src/vtrasterizer/TextRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,15 +582,14 @@ void TextRenderer::renderTextGroup(std::u32string_view codepoints,
text::shape_result const& glyphPositions =
getOrCreateCachedGlyphPositions(hash, codepoints, clusters, style);
crispy::point pen = _gridMetrics.mapBottomLeft(initialPenPosition);
auto const advanceX = unbox(_gridMetrics.cellSize.width);

for (auto const& glyphPosition: glyphPositions)
{
if (auto const* attributes = ensureRasterizedIfDirectMapped(glyphPosition.glyph))
{
auto const pen1 = applyGlyphPositionToPen(pen, *attributes, glyphPosition);
renderRasterizedGlyph(pen1, color, *attributes);
pen.x += static_cast<decltype(pen.x)>(advanceX);
pen.x += unbox<decltype(pen.x)>(_gridMetrics.cellSize.width);
continue;
}

Expand All @@ -617,10 +616,14 @@ void TextRenderer::renderTextGroup(std::u32string_view codepoints,

if (glyphPosition.advance.x)
{

auto numberOfCellsToAdvance =
std::rint(glyphPosition.advance.x / unbox<double>(_gridMetrics.cellSize.width));
// Only advance horizontally, as we're (guess what) a terminal. :-)
// Only advance in fixed-width steps.
// Only advance iff there harfbuzz told us to.
pen.x += static_cast<decltype(pen.x)>(advanceX);
// Only advance if there harfbuzz told us to.
pen.x +=
static_cast<decltype(pen.x)>(numberOfCellsToAdvance * (unbox(_gridMetrics.cellSize.width)));
}
}
}
Expand Down

0 comments on commit a6cd6ab

Please sign in to comment.