From da9b71275d04f35c77a48e3bbaee356c04fd24b2 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Mon, 10 Apr 2017 19:49:03 +0200 Subject: [PATCH 1/1] latin: support repeat glyph substitution in sample Optional 28th glyph to be shown instead of a doubled letter in sample texts. --- latinsample.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/latinsample.js b/latinsample.js index cff51e3..b576f95 100644 --- a/latinsample.js +++ b/latinsample.js @@ -29,8 +29,12 @@ function appendsample() { for (var i = 0; i < input.length; i++) { var col = input.charCodeAt(i) - 64; if (col < 1) col = 27; // space + else if (cols[28] && i && col == input.charCodeAt(i - 1) - 64) { + col = 28; // repetition char + } + if (col < cols.length) { - output += '' + cols[col].innerHTML.trimRight() + ''; + output += '' + (cols[col].innerHTML.trimRight() || ' ') + ''; } else { output += ' '; -- 2.30.0