summaryrefslogtreecommitdiff
path: root/drw/drw.go
diff options
context:
space:
mode:
authorhhvn <dev@hhvn.uk>2023-11-18 19:50:26 +0000
committerhhvn <dev@hhvn.uk>2023-11-18 19:56:13 +0000
commit19781aeb974bd20c421a6b4677ffab348df8faf9 (patch)
tree22bde9a97fdc36f6d412203319f797cf168986d9 /drw/drw.go
parent505685c6d546cab46f919f6b5296ca73b80d09b2 (diff)
Statuses
Diffstat (limited to 'drw/drw.go')
-rw-r--r--drw/drw.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/drw/drw.go b/drw/drw.go
index a0844c8..a0b3579 100644
--- a/drw/drw.go
+++ b/drw/drw.go
@@ -2,6 +2,7 @@ package drw // import "hhvn.uk/hbspbar/drw"
import (
"image"
+ "image/draw"
"hhvn.uk/hbspbar/config"
@@ -10,6 +11,10 @@ import (
)
func DrawText(i *image.RGBA, x int, col uint32, text string) (int, error) {
+ ft := freetype.NewContext()
+ ft.SetDPI(72)
+ ft.SetFont(font)
+ ft.SetFontSize(config.FontSize)
ft.SetClip(i.Bounds())
ft.SetDst(i)
@@ -42,3 +47,8 @@ func DrawRect(i *image.RGBA, x, y, w, h int, c uint32, fill bool) {
}
}
}
+
+func AddImg(dst *image.RGBA, x, w int, src *image.RGBA) {
+ r := image.Rect(x, 0, x + w, int(config.H))
+ draw.Draw(dst, r, src, image.Pt(0,0), draw.Src)
+}