shithub: mycel

Download patch

ref: 11850642bf7527bbaf86a0394875b4f6984f80ed
parent: 4c43991753041448188bf93aed87b5f5434fa316
author: Philip Silva <philip.silva@protonmail.com>
date: Sun Sep 12 04:36:36 EDT 2021

Test hidpi on plan9

--- a/style/fonts_plan9.go
+++ b/style/fonts_plan9.go
@@ -17,7 +17,11 @@
 	fontHs []int
 )
 
-func initFontserver() {}
+func initFontserver() {
+	if df := dui.Font(nil); df.Height >= 40 {
+		dui.Display.DPI = 200
+	}
+}
 
 func initFonts() {
 	fonts = make(map[int]*draw.Font)
--- a/style/stylesheets.go
+++ b/style/stylesheets.go
@@ -14,6 +14,7 @@
 	"math"
 	"os/exec"
 	"regexp"
+	"runtime"
 	"strconv"
 	"strings"
 )
@@ -292,6 +293,10 @@
 	fn, ok := cs.FontFilename()
 	if !ok || dui == nil {
 		return nil
+	}
+	if runtime.GOOS == "plan9" && dui.Display.HiDPI() {
+		// TODO: proper hidpi handling
+		return dui.Font(nil)
 	}
 	font, ok := fontCache[fn]
 	if ok {