From eff6c684b747dd53eb390b10ff2f8b6d0be028a6 Mon Sep 17 00:00:00 2001
From: soypat <graded.sp@gmail.com>
Date: Sun, 24 Nov 2024 12:27:01 -0300
Subject: [PATCH] add MacOS to build

---
 .github/workflows/go.yml    | 26 ++++++++++++++++++++++----
 forge/textsdf/glyph_test.go | 20 --------------------
 2 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index d46cce7..9e96bca 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -11,7 +11,28 @@ on:
 
 jobs:
 
-  build:
+  build-mac:
+    name: MacOS
+    runs-on: macos-latest
+    steps:
+    - uses: actions/checkout@v3
+
+    - name: Setup GPU drivers
+      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
@@ -19,9 +40,6 @@ jobs:
     - name: Setup GPU drivers
       run: sudo apt install libgl1-mesa-dev xorg-dev
 
-    - name: Env disable Cgo 
-      run: echo "CGO_ENABLED=0" >> $GITHUB_ENV
-
     - name: Set up Go
       uses: actions/setup-go@v3
       with:
diff --git a/forge/textsdf/glyph_test.go b/forge/textsdf/glyph_test.go
index 046e7a8..3c80738 100644
--- a/forge/textsdf/glyph_test.go
+++ b/forge/textsdf/glyph_test.go
@@ -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) {
@@ -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)
-	// }
-
-}