Skip to content

Commit

Permalink
add MacOS to build
Browse files Browse the repository at this point in the history
  • Loading branch information
soypat committed Nov 24, 2024
1 parent 1b6005d commit 036b3b9
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 23 deletions.
42 changes: 39 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,50 @@ on:

jobs:

build:
runs-on: ubuntu-latest
build-windows:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.22

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...

build-mac:
name: MacOS
runs-on: macos-latest-xlarge
steps:
- uses: actions/checkout@v3

- name: Setup GPU drivers
run: sudo apt install libgl1-mesa-dev xorg-dev
run: brew install mesa

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.22

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...

build-linux:
name: Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

# ubuntu-latest runner has no GPU.
- name: Env disable Cgo
run: echo "CGO_ENABLED=0" >> $GITHUB_ENV

Expand Down
20 changes: 0 additions & 20 deletions forge/textsdf/glyph_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package textsdf

import (
"fmt"
"testing"

_ "embed"

"github.com/golang/freetype/truetype"
"github.com/soypat/gsdf/gleval"
"github.com/soypat/gsdf/gsdfaux"
"golang.org/x/image/math/fixed"
)

func TestABC(t *testing.T) {
Expand All @@ -33,20 +30,3 @@ func TestABC(t *testing.T) {
t.Fatal(err)
}
}

func Test(t *testing.T) {
ttf, err := truetype.Parse(_iso3098TTF)
if err != nil {
panic(err)
}
scale := fixed.Int26_6(ttf.FUnitsPerEm())
hm := ttf.HMetric(scale, 'E')
fmt.Println(hm.AdvanceWidth, int(hm.AdvanceWidth))
t.Error(hm)
// var g truetype.GlyphBuf
// err = g.Load(ttf, , 'B', font.HintingFull)
// if err != nil {
// panic(err)
// }

}

0 comments on commit 036b3b9

Please sign in to comment.