Skip to content

Commit 4ca7f05

Browse files
committed
[WIP] Proportional font: character width
See akiyosi#591 (comment)
1 parent af11943 commit 4ca7f05

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

editor/window.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3015,7 +3015,8 @@ func (w *Window) newTextCache(text string, hlkey HlKey, isNormalWidth bool) *gui
30153015

30163016
width := float64(len(text))*font.cellwidth + 1
30173017
if fontfallbacked.proportional {
3018-
fmWidth := fontfallbacked.fontMetrics.HorizontalAdvance(text, -1)
3018+
fm := getFontMetrics(fontfallbacked, &Highlight{bold: hlkey.bold, italic: hlkey.italic})
3019+
fmWidth := fm.HorizontalAdvance(text, -1)
30193020
if fmWidth > width {
30203021
width = fmWidth
30213022
}

0 commit comments

Comments
 (0)