Skip to content

Commit 80ec066

Browse files
committed
update
1 parent 8f38e6e commit 80ec066

39 files changed

+102
-55
lines changed

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66

77
## Installation
88

9-
go get -u github.com/Coloured-glaze/gg
9+
go get -u github.com/FloatTech/gg
1010

1111
Alternatively, you may use gopkg.in to grab a specific major-version:
1212

13-
go get -u gopkg.in/Coloured-glaze/gg.v1
13+
go get -u github.com/FloatTech/gg.v1
1414

1515
## Documentation
1616

17-
- godoc: https://godoc.org/github.com/Coloured-glaze/gg
18-
- pkg.go.dev: https://pkg.go.dev/github.com/Coloured-glaze/gg?tab=doc
17+
- godoc: https://godoc.org/github.com/FloatTech/gg
18+
- pkg.go.dev: https://pkg.go.dev/github.com/FloatTech/gg?tab=doc
1919

2020
## Hello, Circle!
2121

@@ -24,7 +24,7 @@ Look how easy!
2424
```go
2525
package main
2626

27-
import "github.com/Coloured-glaze/gg"
27+
import "github.com/FloatTech/gg"
2828

2929
func main() {
3030
dc := gg.NewContext(1000, 1000)
@@ -37,7 +37,7 @@ func main() {
3737

3838
## Examples
3939

40-
There are [lots of examples](https://github.com/Coloured-glaze/gg/tree/master/examples) included. They're mostly for testing the code, but they're good for learning, too.
40+
There are [lots of examples](https://github.com/FloatTech/gg/tree/master/examples) included. They're mostly for testing the code, but they're good for learning, too.
4141

4242
![Examples](http://i.imgur.com/tMFoyzu.png)
4343

@@ -203,7 +203,7 @@ See the output of this example below.
203203
```go
204204
package main
205205

206-
import "github.com/Coloured-glaze/gg"
206+
import "github.com/FloatTech/gg"
207207

208208
func main() {
209209
const S = 1024

context.go

+7-5
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ func NewContextForRGBA(im *image.RGBA) *Context {
125125

126126
// ScaleStyle determines the way image pixels are interpolated when scaled.
127127
// See
128-
// https://pkg.go.dev/golang.org/x/image/draw
128+
//
129+
// https://pkg.go.dev/golang.org/x/image/draw
130+
//
129131
// for the corresponding interpolators.
130132
//
131133
// 确定缩放时图像像素的插值方式。 请看
@@ -222,7 +224,7 @@ func (dc *Context) SetScaleCatmullRom() {
222224
// The point will have been transformed by the context's transformation matrix.
223225
//
224226
// 返回当前点,如果存在当前点。
225-
//该点将通过上下文的变换矩阵进行变换。
227+
// 该点将通过上下文的变换矩阵进行变换。
226228
func (dc *Context) GetCurrentPoint() (Point, bool) {
227229
if dc.hasCurrent {
228230
return dc.current, true
@@ -347,7 +349,7 @@ func (dc *Context) SetLineJoinRound() {
347349
dc.lineJoin = LineJoinRound
348350
}
349351

350-
/// 设置线帽连接斜面
352+
// / 设置线帽连接斜面
351353
func (dc *Context) SetLineJoinBevel() {
352354
dc.lineJoin = LineJoinBevel
353355
}
@@ -957,13 +959,13 @@ func (dc *Context) DrawImageAnchored(im image.Image, x, y int, ax, ay float64) {
957959
// 设置字体面
958960
func (dc *Context) SetFontFace(fontFace font.Face) {
959961
dc.fontFace = fontFace
960-
dc.fontHeight = float64(fontFace.Metrics().Height) / 64
962+
dc.fontHeight = (float64(fontFace.Metrics().Height) / 64) * 72 / 96
961963
}
962964

963965
// Load the font from the specified path
964966
//
965967
// 加载指定路径的字体
966-
func (dc *Context) LoadFontFace(path string, points float64) error {
968+
func (dc *Context) LoadFontFace(path any, points float64) error {
967969
face, err := LoadFontFace(path, points)
968970
if err == nil {
969971
dc.fontFace = face

examples/beziers.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"math/rand"
55

6-
"github.com/Coloured-glaze/gg"
6+
"github.com/FloatTech/gg"
77
)
88

99
func random() float64 {

examples/circle.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package main
22

3-
import "github.com/Coloured-glaze/gg"
3+
import "github.com/FloatTech/gg"
44

55
func main() {
66
dc := gg.NewContext(1000, 1000)

examples/clip.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package main
22

3-
import "github.com/Coloured-glaze/gg"
3+
import "github.com/FloatTech/gg"
44

55
func main() {
66
dc := gg.NewContext(1000, 1000)

examples/concat.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"math"
55

6-
"github.com/Coloured-glaze/gg"
6+
"github.com/FloatTech/gg"
77
)
88

99
func main() {

examples/crisp.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package main
22

33
import (
4-
"github.com/Coloured-glaze/gg"
4+
"github.com/FloatTech/gg"
55
)
66

77
func main() {

examples/cubic.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package main
22

3-
import "github.com/Coloured-glaze/gg"
3+
import "github.com/FloatTech/gg"
44

55
func main() {
66
const S = 1000

examples/ellipse.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package main
22

3-
import "github.com/Coloured-glaze/gg"
3+
import "github.com/FloatTech/gg"
44

55
func main() {
66
const S = 1024

examples/gofont.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"log"
55

6-
"github.com/Coloured-glaze/gg"
6+
"github.com/FloatTech/gg"
77
"github.com/golang/freetype/truetype"
88
"golang.org/x/image/font/gofont/goregular"
99
)

examples/gradient-conic.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package main
66
import (
77
"image/color"
88

9-
"github.com/Coloured-glaze/gg"
9+
"github.com/FloatTech/gg"
1010
)
1111

1212
func main() {

examples/gradient-linear.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"image/color"
55

6-
"github.com/Coloured-glaze/gg"
6+
"github.com/FloatTech/gg"
77
)
88

99
func main() {

examples/gradient-radial.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"image/color"
55

6-
"github.com/Coloured-glaze/gg"
6+
"github.com/FloatTech/gg"
77
)
88

99
func main() {

examples/gradient-text.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"image/color"
55

6-
"github.com/Coloured-glaze/gg"
6+
"github.com/FloatTech/gg"
77
)
88

99
const (

examples/invert-mask.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package main
22

3-
import "github.com/Coloured-glaze/gg"
3+
import "github.com/FloatTech/gg"
44

55
func main() {
66
dc := gg.NewContext(1024, 1024)

examples/lines.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"math/rand"
55

6-
"github.com/Coloured-glaze/gg"
6+
"github.com/FloatTech/gg"
77
)
88

99
func main() {

examples/linewidth.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package main
22

3-
import "github.com/Coloured-glaze/gg"
3+
import "github.com/FloatTech/gg"
44

55
func main() {
66
dc := gg.NewContext(1000, 1000)

examples/lorem.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package main
22

3-
import "github.com/Coloured-glaze/gg"
3+
import "github.com/FloatTech/gg"
44

55
var lines = []string{
66
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod",

examples/mask.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"log"
55

6-
"github.com/Coloured-glaze/gg"
6+
"github.com/FloatTech/gg"
77
)
88

99
func main() {

examples/meme.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package main
22

3-
import "github.com/Coloured-glaze/gg"
3+
import "github.com/FloatTech/gg"
44

55
func main() {
66
const S = 1024

examples/openfill.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"math"
55
"math/rand"
66

7-
"github.com/Coloured-glaze/gg"
7+
"github.com/FloatTech/gg"
88
)
99

1010
func main() {

examples/pattern-fill.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package main
22

3-
import "github.com/Coloured-glaze/gg"
3+
import "github.com/FloatTech/gg"
44

55
func main() {
66
im, err := gg.LoadPNG("examples/james-webb.png")

examples/quadratic.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package main
22

3-
import "github.com/Coloured-glaze/gg"
3+
import "github.com/FloatTech/gg"
44

55
func main() {
66
const S = 1000

examples/rotated-image.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package main
22

3-
import "github.com/Coloured-glaze/gg"
3+
import "github.com/FloatTech/gg"
44

55
func main() {
66
const W = 400

examples/rotated-text.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package main
22

33
import (
4-
"github.com/Coloured-glaze/gg"
4+
"github.com/FloatTech/gg"
55
"github.com/golang/freetype/truetype"
66
"golang.org/x/image/font/gofont/goregular"
77
)

examples/scatter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"math/rand"
55

6-
"github.com/Coloured-glaze/gg"
6+
"github.com/FloatTech/gg"
77
)
88

99
func CreatePoints(n int) []gg.Point {

examples/sine.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"math"
55

6-
"github.com/Coloured-glaze/gg"
6+
"github.com/FloatTech/gg"
77
)
88

99
func main() {

examples/spiral.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"math"
55

6-
"github.com/Coloured-glaze/gg"
6+
"github.com/FloatTech/gg"
77
)
88

99
func main() {

examples/star.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"math"
55

6-
"github.com/Coloured-glaze/gg"
6+
"github.com/FloatTech/gg"
77
)
88

99
type Point struct {

examples/stars.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"math"
55
"math/rand"
66

7-
"github.com/Coloured-glaze/gg"
7+
"github.com/FloatTech/gg"
88
)
99

1010
type Point struct {

examples/text.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package main
22

3-
import "github.com/Coloured-glaze/gg"
3+
import "github.com/FloatTech/gg"
44

55
func main() {
66
const S = 1024

examples/tiling.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package main
22

3-
import "github.com/Coloured-glaze/gg"
3+
import "github.com/FloatTech/gg"
44

55
func main() {
66
const NX = 4

examples/unicode.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package main
22

3-
import "github.com/Coloured-glaze/gg"
3+
import "github.com/FloatTech/gg"
44

55
func main() {
66
const S = 4096 * 2

examples/wrap.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package main
22

3-
import "github.com/Coloured-glaze/gg"
3+
import "github.com/FloatTech/gg"
44

55
const TEXT = "Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation. Whenever I find myself growing grim about the mouth; whenever it is a damp, drizzly November in my soul; whenever I find myself involuntarily pausing before coffin warehouses, and bringing up the rear of every funeral I meet; and especially whenever my hypos get such an upper hand of me, that it requires a strong moral principle to prevent me from deliberately stepping into the street, and methodically knocking people's hats off—then, I account it high time to get to sea as soon as I can. This is my substitute for pistol and ball. With a philosophical flourish Cato throws himself upon his sword; I quietly take to the ship. There is nothing surprising in this. If they but knew it, almost all men in their degree, some time or other, cherish very nearly the same feelings towards the ocean with me."
66

go.mod

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module github.com/FloatTech/gg
2+
3+
go 1.19
4+
5+
require (
6+
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
7+
golang.org/x/image v0.3.0
8+
)

0 commit comments

Comments
 (0)