Skip to content

Commit 00537b2

Browse files
committed
Upgrade to a tagged version of go-text/typesetting
1 parent 01b96e2 commit 00537b2

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ require (
1515
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b
1616
github.com/go-ole/go-ole v1.2.6
1717
github.com/go-text/render v0.0.0-20230619120952-35bccb6164b8
18-
github.com/go-text/typesetting v0.0.0-20230616162802-9c17dd34aa4a
18+
github.com/go-text/typesetting v0.1.0
1919
github.com/godbus/dbus/v5 v5.1.0
2020
github.com/gopherjs/gopherjs v1.17.2
2121
github.com/jackmordaunt/icns/v2 v2.2.6

go.sum

+4-2
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,12 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
105105
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
106106
github.com/go-text/render v0.0.0-20230619120952-35bccb6164b8 h1:VkKnvzbvHqgEfm351rfr8Uclu5fnwq8HP2ximUzJsBM=
107107
github.com/go-text/render v0.0.0-20230619120952-35bccb6164b8/go.mod h1:h29xCucjNsDcYb7+0rJokxVwYAq+9kQ19WiFuBKkYtc=
108-
github.com/go-text/typesetting v0.0.0-20230616162802-9c17dd34aa4a h1:VjN8ttdfklC0dnAdKbZqGNESdERUxtE3l8a/4Grgarc=
109108
github.com/go-text/typesetting v0.0.0-20230616162802-9c17dd34aa4a/go.mod h1:evDBbvNR/KaVFZ2ZlDSOWWXIUKq0wCOEtzLxRM8SG3k=
110-
github.com/go-text/typesetting-utils v0.0.0-20230616150549-2a7df14b6a22 h1:LBQTFxP2MfsyEDqSKmUBZaDuDHN1vpqDyOZjcqS7MYI=
109+
github.com/go-text/typesetting v0.1.0 h1:vioSaLPYcHwPEPLT7gsjCGDCoYSbljxoHJzMnKwVvHw=
110+
github.com/go-text/typesetting v0.1.0/go.mod h1:d22AnmeKq/on0HNv73UFriMKc4Ez6EqZAofLhAzpSzI=
111111
github.com/go-text/typesetting-utils v0.0.0-20230616150549-2a7df14b6a22/go.mod h1:DDxDdQEnB70R8owOx3LVpEFvpMK9eeH1o2r0yZhFI9o=
112+
github.com/go-text/typesetting-utils v0.0.0-20231211103740-d9332ae51f04 h1:zBx+p/W2aQYtNuyZNcTfinWvXBQwYtDfme051PR/lAY=
113+
github.com/go-text/typesetting-utils v0.0.0-20231211103740-d9332ae51f04/go.mod h1:DDxDdQEnB70R8owOx3LVpEFvpMK9eeH1o2r0yZhFI9o=
112114
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
113115
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
114116
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=

internal/painter/font.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ func walkString(faces []font.Face, s string, textSize fixed.Int26_6, tabWidth in
206206
}
207207

208208
*advance = x
209-
return fyne.NewSize(*advance, fixed266ToFloat32(out.LineBounds.LineHeight())),
209+
return fyne.NewSize(*advance, fixed266ToFloat32(out.LineBounds.LineThickness())),
210210
fixed266ToFloat32(out.LineBounds.Ascent)
211211
}
212212

widget/richtext.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1093,9 +1093,9 @@ func truncateLimit(s string, text *canvas.Text, limit int, ellipsis []rune) (int
10931093
out := shaper.Shape(in)
10941094

10951095
l.Prepare(conf, runes, shaping.NewSliceIterator([]shaping.Output{out}))
1096-
finalLine, _, done := l.WrapNextLine(limit)
1096+
wrapped, done := l.WrapNextLine(limit)
10971097

1098-
count := finalLine[0].Runes.Count
1098+
count := wrapped.Line[0].Runes.Count
10991099
full := done && count == len(runes)
11001100
if !full && len(ellipsis) > 0 {
11011101
count--

0 commit comments

Comments
 (0)