# HG changeset patch # User David Barts # Date 1579589944 28800 # Node ID 0cd912d291845e104e410889dc8543f057a0df1a # Parent fe0fcfc8b2aa60e7ab3fd4b4da7067a53d237522 Better cope with Swing's idiosyncrasies. diff -r fe0fcfc8b2aa -r 0cd912d29184 src/name/blackcap/clipman/Main.kt --- a/src/name/blackcap/clipman/Main.kt Mon Jan 20 21:53:15 2020 -0800 +++ b/src/name/blackcap/clipman/Main.kt Mon Jan 20 22:59:04 2020 -0800 @@ -115,6 +115,7 @@ add(stdLabel("Styled text")) val (html, style) = preproc(contents.html) val hek = HTMLEditorKit().apply { + style.addStyleSheet(styleSheet) styleSheet = style } add(ClipText().apply { @@ -150,8 +151,8 @@ private fun preproc(html: String): Pair { val sty = StyleSheet().apply { - addRule("html { font-family: serif; font-size: %d; }".format(PROP_SIZE)) - addRule("code, kbd, pre, samp { font-family: monospace; font-size: %d; }".format(MONO_SIZE)) + addRule("head, body { font-family: serif; font-size: %d; }".format(PROP_SIZE)) + addRule("code, kbd, pre, samp, tt { font-family: monospace; font-size: %d; }".format(MONO_SIZE)) } val scrubbed = Jsoup.parse(html).run { select("style").forEach {