From 19781aeb974bd20c421a6b4677ffab348df8faf9 Mon Sep 17 00:00:00 2001 From: hhvn Date: Sat, 18 Nov 2023 19:50:26 +0000 Subject: Statuses --- drw/drw.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drw/drw.go') 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) +} -- cgit v1.2.3