aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2025-04-22 20:50:48 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2025-04-22 20:50:48 +0300
commit93d3cbd390e65576d0c8740233b0a7569d9bdd89 (patch)
tree5484ef6437748ee76dc0cde9679b57061c591c7e
parent746d62515dc9dece35147df341d4a5218e3044af (diff)
downloadsciteco-93d3cbd390e65576d0c8740233b0a7569d9bdd89.tar.gz
Gtk: monospaced sections in womanpages now respect lexer.font and variable-width font is configurable via lexer.woman.font (refs #34)
* grosciteco was just hardcoding "Monospace", regardless of what was configured via lexer.font in ~/.teco_ini * The variable-width font used for ordinary "womanpage" body texts was hardcoded to "Serif". It is now configurable via the lexer.woman.font register. * There is a difference, though: lexer.font has no default value and must therefore be checked everywhere. This is so you can set it even before munging lexer.tes. lexer.woman.font however has a default (Serif), so it can only be overridden after munging lexer.tes. Perhaps it would be easier and more consistent to have a default for lexer.font as well.
-rwxr-xr-xdoc/grosciteco.tes4
-rw-r--r--fallback.teco_ini1
-rw-r--r--lib/lexers/woman.tes8
3 files changed, 10 insertions, 3 deletions
diff --git a/doc/grosciteco.tes b/doc/grosciteco.tes
index ac268b6..ce194b7 100755
--- a/doc/grosciteco.tes
+++ b/doc/grosciteco.tes
@@ -176,11 +176,11 @@ EBN[input]
!cmd.xf!
:M#sa :M#giU.n Q.n+16U.#nt .(:M#sa).X[font] :M#sc
:Q[fonts.\.n]"F F< ' -U[fonts.\.n]
- @:EU[styles]{\.#ntESSTYLESETFONTMonospace^J}
+ @:EU[styles]{:Q[lexer.font]"> \.#ntESSTYLESETFONTQ[lexer.font] '^J}
Ocmd.xfQ[font]
!cmd.xfR!
Q.nU[default-style]
- @:EU[styles]{16ESSTYLESETFONTMonospace^J}
+ @:EU[styles]{:Q[lexer.font]"> 16ESSTYLESETFONTQ[lexer.font] '^J}
F<
!cmd.xfB!
@:EU[styles]{1,\.nESSTYLESETBOLD 1,\.#ntESSTYLESETBOLD^J}
diff --git a/fallback.teco_ini b/fallback.teco_ini
index 0211ade..4a20807 100644
--- a/fallback.teco_ini
+++ b/fallback.teco_ini
@@ -55,6 +55,7 @@ EMQ[$SCITECOPATH]/opener.tes
* The size unit is 1pt/100
*!
!![lexer.font]Monospace 1300U[lexer.font]
+!![lexer.woman.font]Serif
!* Enable default function key macros *!
EMQ[$SCITECOPATH]/fnkeys.tes
diff --git a/lib/lexers/woman.tes b/lib/lexers/woman.tes
index 86580f3..6265e60 100644
--- a/lib/lexers/woman.tes
+++ b/lib/lexers/woman.tes
@@ -10,11 +10,17 @@
:EN*.womanQ*
}
+!*
+ * Font used for body text in woman pages.
+ * This can be a variable-width font.
+ *!
+[lexer.woman.font]Serif
+
@[lexer.set.woman]{
1ESSETWRAPMODE
1ESSETWRAPINDENTMODE
10,1#4ESSETYCARETPOLICY
- 0EJ-1"> 32ESSTYLESETFONTSerif :M[color.init] '
+ 0EJ-1"> 32ESSTYLESETFONTQ[lexer.woman.font] :M[color.init] '
1:EN*Q*.tec"S EMQ*.tec '
}