restore semantic bold rendering in terminal panes (T-73)
Bold attributes from terminal escapes now render in a real bold
weight instead of being silently flattened.
- pubspec.yaml: register JetBrainsMono Bold + BoldItalic at
weight 700 under family JetBrainsMono. Files already shipped on
disk; only the registration was missing.
- assets/licenses.yaml: bump JetBrainsMono weights_bundled to
[Regular, Italic, Bold, BoldItalic] per D-42 (the entry must
match what is actually wired into the family).
- lib/src/terminal/src/ui/painter.dart: revert the `bold: false`
override and drop the workaround comment. Bold now flows from
CellFlags.bold to TextStyle.fontWeight.
- test/terminal/painter_bold_metrics_test.dart: load Regular and
Bold via FontLoader and assert paragraph maxIntrinsicWidth is
identical (cell-grid drift = 0). JetBrainsMono Bold's monospace
by spec; this test is the canary for the day someone swaps the
font.
- test/goldens/goldens/{ci,linux}/clide_button.png: regenerate.
ClideButton's label renders slightly heavier on the bold variant
(expected — 0.28% pixel diff before regen).
Earlier perception of over-bolding in the Claude pane was
synthetic-bold smearing (Flutter overpaints when no Bold.ttf is
registered for the family), not legitimate bold rendering. Visual
A/B confirms a real Bold face renders crisp emphasis without the
smear, so no per-pane renderer config is needed.
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -126,8 +126,7 @@ class TerminalPainter {
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
void paintHighlight(Canvas canvas, Offset offset, int length, Color color) {
|
||||
final endOffset =
|
||||
offset.translate(length * _cellSize.width, _cellSize.height);
|
||||
final endOffset = offset.translate(length * _cellSize.width, _cellSize.height);
|
||||
|
||||
final paint = Paint()
|
||||
..color = color
|
||||
@@ -182,20 +181,15 @@ class TerminalPainter {
|
||||
if (paragraph == null) {
|
||||
final cellFlags = cellData.flags;
|
||||
|
||||
var color = cellFlags & CellFlags.inverse == 0
|
||||
? resolveForegroundColor(cellData.foreground)
|
||||
: resolveBackgroundColor(cellData.background);
|
||||
var color = cellFlags & CellFlags.inverse == 0 ? resolveForegroundColor(cellData.foreground) : resolveBackgroundColor(cellData.background);
|
||||
|
||||
if (cellData.flags & CellFlags.faint != 0) {
|
||||
color = color.withOpacity(0.5);
|
||||
}
|
||||
|
||||
// Skip bold rendering — Flutter's synthetic bold (no Bold.ttf
|
||||
// registered) drifts glyph advance widths slightly, breaking
|
||||
// the cell grid. Color is enough to convey emphasis in TUIs.
|
||||
final style = _textStyle.toTextStyle(
|
||||
color: color,
|
||||
bold: false,
|
||||
bold: cellFlags & CellFlags.bold != 0,
|
||||
italic: cellFlags & CellFlags.italic != 0,
|
||||
underline: cellFlags & CellFlags.underline != 0,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user