Skip to content
Snippets Groups Projects
Commit 8c11cd89 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Allow 'wantblink' to be set globally (in the root section) of fonts.ini

Document it and set it by default.
parent cb033b61
No related branches found
No related tags found
No related merge requests found
Pipeline #8829 passed
......@@ -25,7 +25,7 @@
; Font Slots
; **********
; The global section here is for associating names with font slot numbers.
; The root section here is mainly for associating names with font slot numbers.
; Synchronet uses the highest slot numbers for dynamically loading XBin/XBimage
; fonts - so do not assign or use slots 252 through 255.
; SyncTERM currently preserves slots 0-42 for hard-coded pre-defined fonts,
......@@ -145,6 +145,13 @@ tekton = 141 ;16
thin = 142 ;16
tiny = 143 ;8
; Set 'wantblink=true' globally if blinking text is desired for all fonts,
; in all conditions. When wantblink is not set to 'true' here, the blink
; attribute will be disabled on the terminal when displaying text using any
; blink or highblink styles (by default) in the Font Sections defined below.
; 'wantblink' can also be enabled on a per-font basis (in Font Sections).
wantblink = true
; *****************
; Filename Sections
; *****************
......@@ -191,10 +198,11 @@ oldenglish=oldeng.f14
; re-sending any of those characters!
; A 'requirements' key may be set to a valid Access Requirement String (ARS)
; both globally (e.g. before any [sections] are defined, towards the top of
; this file) and per Font Section. Users not meeting the specified
; requirements will not receive the font change(s). If specified, both the
; global and per-font requirements must be met for a font to apply to a user.
; both globally (i.e. in the root section before any Font Sections are
; defined, towards the top of this file) and within any Font Section. Users
; not meeting the specified requirements will not receive the font change(s).
; If specified, both the global and per-font requirements must be met for a
; font to apply to a user.
; ****************************
; Loading and Activating Fonts
......
// $Id: fonts.js,v 1.3 2020/06/07 05:12:35 rswindell Exp $
// Load and/or activate fonts into terminal based ctrl/fonts.ini file contents
var cterm = load({}, 'cterm_lib.js');
......@@ -28,6 +28,8 @@ function fonts(key)
ini.close();
var requirements = slotnames.requirements;
slotnames.requirements = undefined;
var wantblink = slotnames.wantblink;
slotnames.wantblink = undefined;
if(!obj)
return false;
for(var p in obj) {
......@@ -51,7 +53,7 @@ function fonts(key)
filename = obj[p] + '.f' + charheight;
load_font(slotnum, filename);
}
if(cterm.activate_font(cterm.font_styles[p], slotval == undefined ? obj[p] : slotnum, obj.wantblink) == false)
if(cterm.activate_font(cterm.font_styles[p], slotval == undefined ? obj[p] : slotnum, wantblink || obj.wantblink) == false)
log(LOG_WARNING, "Failed to activate font: " + cterm.font_styles[p]);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment