shithub: opossum

Download patch

ref: 4eda0a73c1b856dd4d41c2fcea49e3e2e1b00725
parent: e48d995bfd8e072bb9ac11c4b8145fae5505a16c
author: Philip Silva <philip.silva@protonmail.com>
date: Sun Jan 3 13:13:38 EST 2021

font sizes vs. hidpi

--- a/README.md
+++ b/README.md
@@ -86,4 +86,4 @@
 - load images on the fly
 - implement more parts of HTML5 and CSS
 - create a widget for div/span
-- clean up code, support webfs, snarf, font sizes vs. hidpi
+- clean up code, support webfs, snarf
--- a/browser/browser.go
+++ b/browser/browser.go
@@ -87,7 +87,9 @@
 func NewCodeView(s string, n style.Map) (cv *CodeView) {
 	log.Printf("NewCodeView(%+v)", s)
 	cv = &CodeView{}
-	edit := &duit.Edit{}
+	edit := &duit.Edit{
+		Font: Style.Font(),
+	}
 	/*edit.Keys = func(k rune, m draw.Mouse) (e duit.Event) {
 		//log.Printf("k=%v (c %v    p %v)", k, unicode.IsControl(k), unicode.IsPrint(k))
 		if unicode.IsPrint(k) {
--- a/style/stylesheets.go
+++ b/style/stylesheets.go
@@ -31,7 +31,7 @@
 var rMinWidth = regexp.MustCompile(`min-width: (\d+)px`)
 var rMaxWidth = regexp.MustCompile(`max-width: (\d+)px`)
 
-const FontBaseSize = 14.0
+const FontBaseSize = 11.0
 
 const AddOnCSS = `
 a, span, i, tt, b {
@@ -545,6 +545,8 @@
 	if unit == "em" {
 		f *= FontBaseSize
 	}
+
+	f = float64(dui.Scale(int(f)))
 
 	return
 }