From f81941ce8c17d1fc1f1715478d7c7d867c97c440 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 5 Jun 2021 09:58:28 +0200 Subject: [PATCH] Disable the `WrapAlgorithm` select field for now See #326. --- examples/wasm/www/index.html | 8 +++----- examples/wasm/www/index.js | 5 ++++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/wasm/www/index.html b/examples/wasm/www/index.html index bd902bbb..20460135 100644 --- a/examples/wasm/www/index.html +++ b/examples/wasm/www/index.html @@ -80,17 +80,15 @@

Textwrap WebAssembly Demo

+ + + -->
diff --git a/examples/wasm/www/index.js b/examples/wasm/www/index.js index 4e6ad6a7..a81bfacb 100644 --- a/examples/wasm/www/index.js +++ b/examples/wasm/www/index.js @@ -25,7 +25,10 @@ function redraw(event) { let breakWords = document.getElementById("break-words").checked; let wordSeparator = document.getElementById("word-separator").value; let wordSplitter = document.getElementById("word-splitter").value; - let wrapAlgorithm = document.getElementById("wrap-algorithm").value; + // TODO: The optimal-fit algorithm does not work well for + // proportional fonts, so we always use FirstFit. See + // https://github.com/mgeisler/textwrap/issues/326. + let wrapAlgorithm = "FirstFit"; // document.getElementById("wrap-algorithm").value; let options = new WasmOptions(lineWidth, breakWords, wordSeparator, wordSplitter, wrapAlgorithm); draw_wrapped_text(ctx, options, text); }