summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLenni <[email protected]>2021-03-06 21:08:19 +0100
committerLenni <[email protected]>2021-03-06 21:08:19 +0100
commite58a1961dd3bf91541c911216a626f6be10e9dd1 (patch)
tree0ef6a069db908a009c80f7abeeec11d6bc3822d1
parent64165cad09ef73cb6acb3852d7650418c36bbfea (diff)
close font after usage
-rw-r--r--examples/shapes/main.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/shapes/main.go b/examples/shapes/main.go
index cfd873c..7a74da2 100644
--- a/examples/shapes/main.go
+++ b/examples/shapes/main.go
@@ -109,9 +109,12 @@ func main() {
mask = uint32(xproto.GcForeground | xproto.GcBackground | xproto.GcFont)
values = []uint32{screen.BlackPixel, screen.WhitePixel, uint32(font)}
xproto.CreateGC(X, textCtx, draw, mask, values)
- text := convertStringToChar2b("Hellö World!")
+ text := convertStringToChar2b("Hellö World!") // Unicode capable!
- // In the end, writing text is way more comfortable using Xft - it supports TrueType,
+ // Close the font handle:
+ xproto.CloseFont(X, font)
+
+ // After all, writing text is way more comfortable using Xft - it supports TrueType,
// and overall better configuration.
points := []xproto.Point{