/** * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ */ const getHtml = function (charmap) { let gridHtml, x, y; const width = Math.min(charmap.length, 25); const height = Math.ceil(charmap.length / width); gridHtml = ''; for (y = 0; y < height; y++) { gridHtml += ''; for (x = 0; x < width; x++) { const index = y * width + x; if (index < charmap.length) { const chr = charmap[index]; const charCode = parseInt(chr[0], 10); const chrText = chr ? String.fromCharCode(charCode) : ' '; gridHtml += ( '' ); } else { gridHtml += ''; } gridHtml += ''; return gridHtml; }; export default { getHtml };