diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-04-23 02:07:59 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-04-23 02:07:59 +0300 |
commit | 01419ac9b5c8961e240feaa9f5d160a633f801ed (patch) | |
tree | 2731c52ad53ddae8406172c04c02365d1c119770 | |
parent | 93d3cbd390e65576d0c8740233b0a7569d9bdd89 (diff) | |
download | sciteco-01419ac9b5c8961e240feaa9f5d160a633f801ed.tar.gz |
fixup: fixed monospace sections in womanpages when lexer.font is not customized (refs #34)
* In the grosciteco-generated .woman.tec files, the fonts were only
set on the monospaced styles if lexer.font was set since it was
undefined by default.
We'd need a lare IF-ELSE statement to handle that in womanpages
since woman.tes changes the default font to a variable-width font.
Just leaving the default font, therefore won't work.
* We now always initialize lexer.font in lexer.tes.
You no longer have to check for its existance.
* Consequently, you can no longer set lexer.font *before* munging
lexer.tes because it will be overwritten.
At least not without additional checks.
Such a design is not suggested by fallback.teco_ini, though.
* Fixes monospaced sections in the tutorial and other womanpages on Gtk.
-rwxr-xr-x | doc/grosciteco.tes | 4 | ||||
-rw-r--r-- | fallback.teco_ini | 2 | ||||
-rw-r--r-- | lib/lexer.tes | 11 |
3 files changed, 12 insertions, 5 deletions
diff --git a/doc/grosciteco.tes b/doc/grosciteco.tes index ce194b7..9be0f1a 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]{:Q[lexer.font]"> \.#ntESSTYLESETFONTQ[lexer.font] '^J} + @:EU[styles]{\.#ntESSTYLESETFONTQ[lexer.font]^J} Ocmd.xfQ[font] !cmd.xfR! Q.nU[default-style] - @:EU[styles]{:Q[lexer.font]"> 16ESSTYLESETFONTQ[lexer.font] '^J} + @:EU[styles]{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 4a20807..edd8b7f 100644 --- a/fallback.teco_ini +++ b/fallback.teco_ini @@ -54,7 +54,7 @@ EMQ[$SCITECOPATH]/opener.tes * Tweak the default font name and size. * The size unit is 1pt/100 *! -!![lexer.font]Monospace 1300U[lexer.font] +!![lexer.font]Monospace 1200U[lexer.font] !![lexer.woman.font]Serif !* Enable default function key macros *! diff --git a/lib/lexer.tes b/lib/lexer.tes index 2676e1b..2969184 100644 --- a/lib/lexer.tes +++ b/lib/lexer.tes @@ -5,12 +5,19 @@ [: 0,(1ESPOSITIONFROMLINE:)::S ]: } +!* + * The monospaced font for source code and + * figures in woman-pages. + *! +[lexer.font]Monospace +1200U[lexer.font] + @[lexer.auto]{ - - 0EJ-1"> :Q[lexer.font]"> + 0EJ-1"> 32ESSTYLESETFONTQ[lexer.font] Q[lexer.font],32ESSTYLESETSIZEFRACTIONAL - ' ' + ' :M[color.init] :Q*"= ' [_ |