mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
go.mod: upgrade to github.com/go-text/typesetting@v0.3.4
Signed-off-by: Egon Elbre <egonelbre@gmail.com>
This commit is contained in:
@@ -5,7 +5,7 @@ go 1.24.0
|
|||||||
require (
|
require (
|
||||||
eliasnaur.com/font v0.0.0-20230308162249-dd43949cb42d
|
eliasnaur.com/font v0.0.0-20230308162249-dd43949cb42d
|
||||||
gioui.org/shader v1.0.8
|
gioui.org/shader v1.0.8
|
||||||
github.com/go-text/typesetting v0.3.0
|
github.com/go-text/typesetting v0.3.4
|
||||||
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0
|
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0
|
||||||
golang.org/x/exp/shiny v0.0.0-20250408133849-7e4ce0ab07d0
|
golang.org/x/exp/shiny v0.0.0-20250408133849-7e4ce0ab07d0
|
||||||
golang.org/x/image v0.26.0
|
golang.org/x/image v0.26.0
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ eliasnaur.com/font v0.0.0-20230308162249-dd43949cb42d/go.mod h1:OYVuxibdk9OSLX8v
|
|||||||
gioui.org/cpu v0.0.0-20210808092351-bfe733dd3334/go.mod h1:A8M0Cn5o+vY5LTMlnRoK3O5kG+rH0kWfJjeKd9QpBmQ=
|
gioui.org/cpu v0.0.0-20210808092351-bfe733dd3334/go.mod h1:A8M0Cn5o+vY5LTMlnRoK3O5kG+rH0kWfJjeKd9QpBmQ=
|
||||||
gioui.org/shader v1.0.8 h1:6ks0o/A+b0ne7RzEqRZK5f4Gboz2CfG+mVliciy6+qA=
|
gioui.org/shader v1.0.8 h1:6ks0o/A+b0ne7RzEqRZK5f4Gboz2CfG+mVliciy6+qA=
|
||||||
gioui.org/shader v1.0.8/go.mod h1:mWdiME581d/kV7/iEhLmUgUK5iZ09XR5XpduXzbePVM=
|
gioui.org/shader v1.0.8/go.mod h1:mWdiME581d/kV7/iEhLmUgUK5iZ09XR5XpduXzbePVM=
|
||||||
github.com/go-text/typesetting v0.3.0 h1:OWCgYpp8njoxSRpwrdd1bQOxdjOXDj9Rqart9ML4iF4=
|
github.com/go-text/typesetting v0.3.4 h1:YYurUOtEb9kGSOz4uE3k4OpBGsp1dDL8+fjCeaFamAU=
|
||||||
github.com/go-text/typesetting v0.3.0/go.mod h1:qjZLkhRgOEYMhU9eHBr3AR4sfnGJvOXNLt8yRAySFuY=
|
github.com/go-text/typesetting v0.3.4/go.mod h1:4qZCQphq4KSgGTAeI0uMEkVbROgfah8BuyF5LRYr7XY=
|
||||||
github.com/go-text/typesetting-utils v0.0.0-20241103174707-87a29e9e6066 h1:qCuYC+94v2xrb1PoS4NIDe7DGYtLnU2wWiQe9a1B1c0=
|
github.com/go-text/typesetting-utils v0.0.0-20260223113751-2d88ac90dae3 h1:drBZzMgdYPbmyXqOto4YhhJGrFIQCX94FpR4MzTCsos=
|
||||||
github.com/go-text/typesetting-utils v0.0.0-20241103174707-87a29e9e6066/go.mod h1:DDxDdQEnB70R8owOx3LVpEFvpMK9eeH1o2r0yZhFI9o=
|
github.com/go-text/typesetting-utils v0.0.0-20260223113751-2d88ac90dae3/go.mod h1:3/62I4La/HBRX9TcTpBj4eipLiwzf+vhI+7whTc9V7o=
|
||||||
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 h1:R84qjqJb5nVJMxqWYb3np9L5ZsaDtB+a39EqjV0JSUM=
|
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 h1:R84qjqJb5nVJMxqWYb3np9L5ZsaDtB+a39EqjV0JSUM=
|
||||||
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0/go.mod h1:S9Xr4PYopiDyqSyp5NjCrhFrqg6A5zA2E/iPHPhqnS8=
|
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0/go.mod h1:S9Xr4PYopiDyqSyp5NjCrhFrqg6A5zA2E/iPHPhqnS8=
|
||||||
golang.org/x/exp/shiny v0.0.0-20250408133849-7e4ce0ab07d0 h1:tMSqXTK+AQdW3LpCbfatHSRPHeW6+2WuxaVQuHftn80=
|
golang.org/x/exp/shiny v0.0.0-20250408133849-7e4ce0ab07d0 h1:tMSqXTK+AQdW3LpCbfatHSRPHeW6+2WuxaVQuHftn80=
|
||||||
|
|||||||
+9
-12
@@ -103,8 +103,7 @@ func (l *line) insertTrailingSyntheticNewline(newLineClusterIdx int) {
|
|||||||
clusterIndex: newLineClusterIdx,
|
clusterIndex: newLineClusterIdx,
|
||||||
glyphCount: 0,
|
glyphCount: 0,
|
||||||
runeCount: 1,
|
runeCount: 1,
|
||||||
xAdvance: 0,
|
advance: 0,
|
||||||
yAdvance: 0,
|
|
||||||
xOffset: 0,
|
xOffset: 0,
|
||||||
yOffset: 0,
|
yOffset: 0,
|
||||||
}
|
}
|
||||||
@@ -160,9 +159,9 @@ type glyph struct {
|
|||||||
// runeCount is the quantity of runes in the source text that this glyph
|
// runeCount is the quantity of runes in the source text that this glyph
|
||||||
// corresponds to.
|
// corresponds to.
|
||||||
runeCount int
|
runeCount int
|
||||||
// xAdvance and yAdvance describe the distance the dot moves when
|
// advance is the distance the dot moves when laying out the glyph along
|
||||||
// laying out the glyph on the X or Y axis.
|
// the run's primary axis.
|
||||||
xAdvance, yAdvance fixed.Int26_6
|
advance fixed.Int26_6
|
||||||
// xOffset and yOffset describe offsets from the dot that should be
|
// xOffset and yOffset describe offsets from the dot that should be
|
||||||
// applied when rendering the glyph.
|
// applied when rendering the glyph.
|
||||||
xOffset, yOffset fixed.Int26_6
|
xOffset, yOffset fixed.Int26_6
|
||||||
@@ -438,8 +437,7 @@ func (s *shaperImpl) shapeText(ppem fixed.Int26_6, lc system.Locale, txt []rune)
|
|||||||
Height: input.Size,
|
Height: input.Size,
|
||||||
XBearing: 0,
|
XBearing: 0,
|
||||||
YBearing: 0,
|
YBearing: 0,
|
||||||
XAdvance: input.Size,
|
Advance: input.Size,
|
||||||
YAdvance: input.Size,
|
|
||||||
XOffset: 0,
|
XOffset: 0,
|
||||||
YOffset: 0,
|
YOffset: 0,
|
||||||
ClusterIndex: input.RunStart,
|
ClusterIndex: input.RunStart,
|
||||||
@@ -855,11 +853,10 @@ func toGioGlyphs(in []shaping.Glyph, ppem fixed.Int26_6, faceIdx int) []glyph {
|
|||||||
bounds.Max = bounds.Min.Add(fixed.Point26_6{X: g.Width, Y: -g.Height})
|
bounds.Max = bounds.Min.Add(fixed.Point26_6{X: g.Width, Y: -g.Height})
|
||||||
out = append(out, glyph{
|
out = append(out, glyph{
|
||||||
id: newGlyphID(ppem, faceIdx, g.GlyphID),
|
id: newGlyphID(ppem, faceIdx, g.GlyphID),
|
||||||
clusterIndex: g.ClusterIndex,
|
clusterIndex: g.TextIndex(),
|
||||||
runeCount: g.RuneCount,
|
runeCount: g.RunesCount(),
|
||||||
glyphCount: g.GlyphCount,
|
glyphCount: g.GlyphsCount(),
|
||||||
xAdvance: g.XAdvance,
|
advance: g.Advance,
|
||||||
yAdvance: g.YAdvance,
|
|
||||||
xOffset: g.XOffset,
|
xOffset: g.XOffset,
|
||||||
yOffset: g.YOffset,
|
yOffset: g.YOffset,
|
||||||
bounds: bounds,
|
bounds: bounds,
|
||||||
|
|||||||
+3
-3
@@ -464,7 +464,7 @@ func (l *Shaper) NextGlyph() (_ Glyph, ok bool) {
|
|||||||
if rtl {
|
if rtl {
|
||||||
// Modify the advance prior to computing runOffset to ensure that the
|
// Modify the advance prior to computing runOffset to ensure that the
|
||||||
// current glyph's width is subtracted in RTL.
|
// current glyph's width is subtracted in RTL.
|
||||||
l.advance += g.xAdvance
|
l.advance += g.advance
|
||||||
}
|
}
|
||||||
// runOffset computes how far into the run the dot should be positioned.
|
// runOffset computes how far into the run the dot should be positioned.
|
||||||
runOffset := l.advance
|
runOffset := l.advance
|
||||||
@@ -477,7 +477,7 @@ func (l *Shaper) NextGlyph() (_ Glyph, ok bool) {
|
|||||||
Y: int32(line.yOffset),
|
Y: int32(line.yOffset),
|
||||||
Ascent: line.ascent,
|
Ascent: line.ascent,
|
||||||
Descent: line.descent,
|
Descent: line.descent,
|
||||||
Advance: g.xAdvance,
|
Advance: g.advance,
|
||||||
Runes: uint16(g.runeCount),
|
Runes: uint16(g.runeCount),
|
||||||
Offset: fixed.Point26_6{
|
Offset: fixed.Point26_6{
|
||||||
X: g.xOffset,
|
X: g.xOffset,
|
||||||
@@ -490,7 +490,7 @@ func (l *Shaper) NextGlyph() (_ Glyph, ok bool) {
|
|||||||
}
|
}
|
||||||
l.glyph++
|
l.glyph++
|
||||||
if !rtl {
|
if !rtl {
|
||||||
l.advance += g.xAdvance
|
l.advance += g.advance
|
||||||
}
|
}
|
||||||
|
|
||||||
endOfRun := l.glyph == len(run.Glyphs)
|
endOfRun := l.glyph == len(run.Glyphs)
|
||||||
|
|||||||
+2
-2
@@ -450,8 +450,8 @@ func printLinePositioning(t *testing.T, lines []line, glyphs []Glyph) {
|
|||||||
for g := start; ; g += inc {
|
for g := start; ; g += inc {
|
||||||
glyph := run.Glyphs[g]
|
glyph := run.Glyphs[g]
|
||||||
if glyphCursor < len(glyphs) {
|
if glyphCursor < len(glyphs) {
|
||||||
t.Logf("glyph %2d, adv %3d, runes %2d, glyphs %d - glyphs[%2d] flags %s", g, glyph.xAdvance, glyph.runeCount, glyph.glyphCount, glyphCursor, glyphs[glyphCursor].Flags)
|
t.Logf("glyph %2d, adv %3d, runes %2d, glyphs %d - glyphs[%2d] flags %s", g, glyph.advance, glyph.runeCount, glyph.glyphCount, glyphCursor, glyphs[glyphCursor].Flags)
|
||||||
t.Logf("glyph %2d, adv %3d, runes %2d, glyphs %d - n/a", g, glyph.xAdvance, glyph.runeCount, glyph.glyphCount)
|
t.Logf("glyph %2d, adv %3d, runes %2d, glyphs %d - n/a", g, glyph.advance, glyph.runeCount, glyph.glyphCount)
|
||||||
}
|
}
|
||||||
glyphCursor++
|
glyphCursor++
|
||||||
if g == end {
|
if g == end {
|
||||||
|
|||||||
Reference in New Issue
Block a user