Skip to content

Commit

Permalink
Merge pull request #3259 from andydotxyz/feature/go-text2
Browse files Browse the repository at this point in the history
Move to the shared go-text project for our text shaping
  • Loading branch information
andydotxyz committed Oct 21, 2022
2 parents f4c3d02 + 41c0376 commit 0a1325c
Show file tree
Hide file tree
Showing 780 changed files with 88,779 additions and 6,888 deletions.
Binary file modified canvas/testdata/text/layout_long_center_large.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified canvas/testdata/text/layout_long_center_small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified canvas/testdata/text/layout_long_leading_large.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified canvas/testdata/text/layout_long_leading_small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified canvas/testdata/text/layout_long_trailing_large.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified canvas/testdata/text/layout_long_trailing_small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified canvas/testdata/text/layout_short_center_large.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified canvas/testdata/text/layout_short_center_small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified canvas/testdata/text/layout_short_leading_large.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified canvas/testdata/text/layout_short_leading_small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified canvas/testdata/text/layout_short_trailing_large.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified canvas/testdata/text/layout_short_trailing_small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions container/doctabs_mobile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,28 +341,28 @@ func TestDocTabs_Tapped(t *testing.T) {
w := test.NewWindow(tabs)
defer w.Close()
w.SetPadded(false)
w.Resize(fyne.NewSize(300, 100))
w.Resize(fyne.NewSize(380, 100))
c := w.Canvas()

require.Equal(t, 0, tabs.SelectedIndex())
test.AssertRendersToMarkup(t, "doctabs/mobile/tapped_first_selected.xml", c)

test.TapCanvas(c, fyne.NewPos(100, 10))
test.TapCanvas(c, fyne.NewPos(120, 10))
assert.Equal(t, 1, tabs.SelectedIndex())
test.AssertRendersToMarkup(t, "doctabs/mobile/tapped_second_selected.xml", c)

test.TapCanvas(c, fyne.NewPos(200, 10))
test.TapCanvas(c, fyne.NewPos(240, 10))
assert.Equal(t, 2, tabs.SelectedIndex())
test.AssertRendersToMarkup(t, "doctabs/mobile/tapped_third_selected.xml", c)

test.TapCanvas(c, fyne.NewPos(10, 10))
require.Equal(t, 0, tabs.SelectedIndex())
test.AssertRendersToMarkup(t, "doctabs/mobile/tapped_first_selected.xml", c)

test.TapCanvas(c, fyne.NewPos(254, 10))
test.TapCanvas(c, fyne.NewPos(330, 10))
require.Equal(t, 3, tabs.SelectedIndex())
test.AssertRendersToMarkup(t, "doctabs/mobile/tapped_create_tab.xml", c)

test.TapCanvas(c, fyne.NewPos(286, 10))
test.TapCanvas(c, fyne.NewPos(346, 10))
test.AssertRendersToMarkup(t, "doctabs/mobile/tapped_all_tabs.xml", c)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
<widget size="150x150" type="*container.AppTabs">
<container size="150x36">
<container size="150x36">
<widget size="56x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="40x20">Test1</text>
<widget size="52x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="36x20">Test1</text>
</widget>
<widget pos="60,0" size="56x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="40x20">Test2</text>
<widget pos="56,0" size="52x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="36x20">Test2</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,36" size="150x4"/>
<rectangle fillColor="primary" pos="0,36" size="56x4"/>
<widget pos="0,40" size="150x109" type="*widget.Label">
<text pos="8,8" size="134x20">Text3</text>
<rectangle fillColor="primary" pos="0,36" size="52x4"/>
<widget pos="0,40" size="150x110" type="*widget.Label">
<text pos="8,8" size="134x19">Text3</text>
</widget>
</widget>
</content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
<widget size="150x150" type="*container.AppTabs">
<container size="150x36">
<container size="150x36">
<widget size="56x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="40x20">Test1</text>
<widget size="52x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="36x20">Test1</text>
</widget>
<widget pos="60,0" size="56x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="40x20">Test2</text>
<widget pos="56,0" size="52x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="36x20">Test2</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,36" size="150x4"/>
<rectangle fillColor="primary" pos="0,36" size="56x4"/>
<widget pos="0,40" size="150x109" type="*widget.Label">
<text pos="8,8" size="134x20">Text3</text>
<rectangle fillColor="primary" pos="0,36" size="52x4"/>
<widget pos="0,40" size="150x110" type="*widget.Label">
<text pos="8,8" size="134x19">Text3</text>
</widget>
</widget>
</content>
Expand Down
14 changes: 7 additions & 7 deletions container/testdata/apptabs/desktop/change_content_initial.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
<widget size="150x150" type="*container.AppTabs">
<container size="150x36">
<container size="150x36">
<widget size="56x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="40x20">Test1</text>
<widget size="52x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="36x20">Test1</text>
</widget>
<widget pos="60,0" size="56x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="40x20">Test2</text>
<widget pos="56,0" size="52x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="36x20">Test2</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,36" size="150x4"/>
<rectangle fillColor="primary" pos="0,36" size="56x4"/>
<widget pos="0,40" size="150x109" type="*widget.Label">
<text pos="8,8" size="134x20">Text1</text>
<rectangle fillColor="primary" pos="0,36" size="52x4"/>
<widget pos="0,40" size="150x110" type="*widget.Label">
<text pos="8,8" size="134x19">Text1</text>
</widget>
</widget>
</content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
</container>
<rectangle fillColor="shadow" pos="0,36" size="150x4"/>
<rectangle fillColor="primary" pos="0,36" size="28x4"/>
<widget pos="0,40" size="150x109" type="*widget.Label">
<text pos="8,8" size="134x20">Text1</text>
<widget pos="0,40" size="150x110" type="*widget.Label">
<text pos="8,8" size="134x19">Text1</text>
</widget>
</widget>
</content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
</container>
<rectangle fillColor="shadow" pos="0,36" size="150x4"/>
<rectangle fillColor="primary" pos="0,36" size="28x4"/>
<widget pos="0,40" size="150x109" type="*widget.Label">
<text pos="8,8" size="134x20">Text1</text>
<widget pos="0,40" size="150x110" type="*widget.Label">
<text pos="8,8" size="134x19">Text1</text>
</widget>
</widget>
</content>
Expand Down
4 changes: 2 additions & 2 deletions container/testdata/apptabs/desktop/change_icon_initial.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
</container>
<rectangle fillColor="shadow" pos="0,36" size="150x4"/>
<rectangle fillColor="primary" pos="0,36" size="28x4"/>
<widget pos="0,40" size="150x109" type="*widget.Label">
<text pos="8,8" size="134x20">Text1</text>
<widget pos="0,40" size="150x110" type="*widget.Label">
<text pos="8,8" size="134x19">Text1</text>
</widget>
</widget>
</content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
<widget size="150x150" type="*container.AppTabs">
<container size="150x36">
<container size="150x36">
<widget size="62x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="46x20">New 1</text>
<widget size="59x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="43x20">New 1</text>
</widget>
<widget pos="66,0" size="56x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="40x20">Test2</text>
<widget pos="63,0" size="52x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="36x20">Test2</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,36" size="150x4"/>
<rectangle fillColor="primary" pos="0,36" size="62x4"/>
<widget pos="0,40" size="150x109" type="*widget.Label">
<text pos="8,8" size="134x20">Text1</text>
<rectangle fillColor="primary" pos="0,36" size="59x4"/>
<widget pos="0,40" size="150x110" type="*widget.Label">
<text pos="8,8" size="134x19">Text1</text>
</widget>
</widget>
</content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
<widget size="150x150" type="*container.AppTabs">
<container size="150x36">
<container size="150x36">
<widget size="62x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="46x20">New 1</text>
<widget size="59x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="43x20">New 1</text>
</widget>
<widget pos="66,0" size="62x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="46x20">New 2</text>
<widget pos="63,0" size="59x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="43x20">New 2</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,36" size="150x4"/>
<rectangle fillColor="primary" pos="0,36" size="62x4"/>
<widget pos="0,40" size="150x109" type="*widget.Label">
<text pos="8,8" size="134x20">Text1</text>
<rectangle fillColor="primary" pos="0,36" size="59x4"/>
<widget pos="0,40" size="150x110" type="*widget.Label">
<text pos="8,8" size="134x19">Text1</text>
</widget>
</widget>
</content>
Expand Down
14 changes: 7 additions & 7 deletions container/testdata/apptabs/desktop/change_label_initial.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
<widget size="150x150" type="*container.AppTabs">
<container size="150x36">
<container size="150x36">
<widget size="56x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="40x20">Test1</text>
<widget size="52x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="36x20">Test1</text>
</widget>
<widget pos="60,0" size="56x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="40x20">Test2</text>
<widget pos="56,0" size="52x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="36x20">Test2</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,36" size="150x4"/>
<rectangle fillColor="primary" pos="0,36" size="56x4"/>
<widget pos="0,40" size="150x109" type="*widget.Label">
<text pos="8,8" size="134x20">Text1</text>
<rectangle fillColor="primary" pos="0,36" size="52x4"/>
<widget pos="0,40" size="150x110" type="*widget.Label">
<text pos="8,8" size="134x19">Text1</text>
</widget>
</widget>
</content>
Expand Down
14 changes: 7 additions & 7 deletions container/testdata/apptabs/desktop/dynamic_appended.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
<widget size="300x150" type="*container.AppTabs">
<container size="300x36">
<container size="300x36">
<widget size="56x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="40x20">Test1</text>
<widget size="52x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="36x20">Test1</text>
</widget>
<widget pos="60,0" size="56x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="40x20">Test2</text>
<widget pos="56,0" size="52x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="36x20">Test2</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,36" size="300x4"/>
<rectangle fillColor="primary" pos="0,36" size="56x4"/>
<widget pos="0,40" size="300x109" type="*widget.Label">
<text pos="8,8" size="284x20">Text 1</text>
<rectangle fillColor="primary" pos="0,36" size="52x4"/>
<widget pos="0,40" size="300x110" type="*widget.Label">
<text pos="8,8" size="284x19">Text 1</text>
</widget>
</widget>
</content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<widget size="300x150" type="*container.AppTabs">
<container size="300x36">
<container size="300x36">
<widget size="56x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="40x20">Test2</text>
<widget size="52x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="36x20">Test2</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,36" size="300x4"/>
<rectangle fillColor="primary" pos="0,36" size="56x4"/>
<widget pos="0,40" size="300x109" type="*widget.Label">
<text pos="8,8" size="284x20">Text 2</text>
<rectangle fillColor="primary" pos="0,36" size="52x4"/>
<widget pos="0,40" size="300x110" type="*widget.Label">
<text pos="8,8" size="284x19">Text 2</text>
</widget>
</widget>
</content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
<widget size="300x150" type="*container.AppTabs">
<container size="300x36">
<container size="300x36">
<widget size="56x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="40x20">Test2</text>
<widget size="52x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="36x20">Test2</text>
</widget>
<widget pos="60,0" size="56x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="40x20">Test3</text>
<widget pos="56,0" size="52x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="36x20">Test3</text>
</widget>
<widget pos="121,0" size="56x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="40x20">Test4</text>
<widget pos="112,0" size="52x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="36x20">Test4</text>
</widget>
<widget pos="181,0" size="56x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="40x20">Test5</text>
<widget pos="169,0" size="52x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="36x20">Test5</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,36" size="300x4"/>
<rectangle fillColor="primary" pos="0,36" size="56x4"/>
<widget pos="0,40" size="300x109" type="*widget.Label">
<text pos="8,8" size="284x20">Text 2</text>
<rectangle fillColor="primary" pos="0,36" size="52x4"/>
<widget pos="0,40" size="300x110" type="*widget.Label">
<text pos="8,8" size="284x19">Text 2</text>
</widget>
</widget>
</content>
Expand Down
10 changes: 5 additions & 5 deletions container/testdata/apptabs/desktop/dynamic_initial.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<widget size="300x150" type="*container.AppTabs">
<container size="300x36">
<container size="300x36">
<widget size="56x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="40x20">Test1</text>
<widget size="52x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="36x20">Test1</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,36" size="300x4"/>
<rectangle fillColor="primary" pos="0,36" size="56x4"/>
<widget pos="0,40" size="300x109" type="*widget.Label">
<text pos="8,8" size="284x20">Text 1</text>
<rectangle fillColor="primary" pos="0,36" size="52x4"/>
<widget pos="0,40" size="300x110" type="*widget.Label">
<text pos="8,8" size="284x19">Text 1</text>
</widget>
</widget>
</content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
<widget size="300x150" type="*container.AppTabs">
<container size="300x36">
<container size="300x36">
<widget size="56x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="40x20">Test6</text>
<widget size="52x36" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="36x20">Test6</text>
</widget>
<widget pos="60,0" size="56x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="40x20">Test7</text>
<widget pos="56,0" size="52x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="36x20">Test7</text>
</widget>
<widget pos="121,0" size="56x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="40x20">Test8</text>
<widget pos="112,0" size="52x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="36x20">Test8</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,36" size="300x4"/>
<rectangle fillColor="primary" pos="0,36" size="56x4"/>
<widget pos="0,40" size="300x109" type="*widget.Label">
<text pos="8,8" size="284x20">Text 6</text>
<rectangle fillColor="primary" pos="0,36" size="52x4"/>
<widget pos="0,40" size="300x110" type="*widget.Label">
<text pos="8,8" size="284x19">Text 6</text>
</widget>
</widget>
</content>
Expand Down
16 changes: 8 additions & 8 deletions container/testdata/apptabs/desktop/hover_first.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
<widget size="150x150" type="*container.AppTabs">
<container size="150x36">
<container size="150x36">
<widget size="56x36" type="*container.tabButton">
<rectangle fillColor="hover" size="56x36"/>
<text alignment="center" bold color="primary" pos="8,8" size="40x20">Test1</text>
<widget size="52x36" type="*container.tabButton">
<rectangle fillColor="hover" size="52x36"/>
<text alignment="center" bold color="primary" pos="8,8" size="36x20">Test1</text>
</widget>
<widget pos="60,0" size="56x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="40x20">Test2</text>
<widget pos="56,0" size="52x36" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="36x20">Test2</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,36" size="150x4"/>
<rectangle fillColor="primary" pos="0,36" size="56x4"/>
<widget pos="0,40" size="150x109" type="*widget.Label">
<text pos="8,8" size="134x20">Text1</text>
<rectangle fillColor="primary" pos="0,36" size="52x4"/>
<widget pos="0,40" size="150x110" type="*widget.Label">
<text pos="8,8" size="134x19">Text1</text>
</widget>
</widget>
</content>
Expand Down

0 comments on commit 0a1325c

Please sign in to comment.