From f63ff5f151c9bcb18e84a6748e590b426e13d4db Mon Sep 17 00:00:00 2001 From: jahorton Date: Tue, 3 Sep 2019 10:51:14 +0700 Subject: [PATCH 1/3] Adds handling for pt and unitless font size specs --- web/source/kmwutils.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/web/source/kmwutils.ts b/web/source/kmwutils.ts index 0bfd8a1ed6..071a526fbc 100644 --- a/web/source/kmwutils.ts +++ b/web/source/kmwutils.ts @@ -374,11 +374,22 @@ namespace com.keyman { } else if(fs.indexOf('px') != -1) { val = parseFloat(fs.substr(0, fs.indexOf('px'))); return {val: val, absolute: true}; + } else if(fs.indexOf('pt') != -1) { + // 16 px ~= 12 pt. + // Reference: https://kyleschaeffer.com/css-font-size-em-vs-px-vs-pt-vs-percent + val = parseFloat(fs.substr(0, fs.indexOf('pt'))); + return {val: (4 * val / 3), absolute: true}; } else if(fs.indexOf('%') != -1) { val = parseFloat(fs.substr(0, fs.indexOf('%'))); return {val: val/100, absolute: false}; + } else if(!isNaN(val = Number(fs))) { + // Note: this one is NOT natively handled by browsers! + // We'll treat it as if it were 'pt', since that's likely the user's + // most famiilar font size unit. + return {val: (4 * val / 3), absolute: true}; } else { // Cannot parse. + console.error("Could not properly parse specified fontsize info: '" + fs + "'."); return null; } } From 897f161850915eead5cf04fd7707a5ec34064851 Mon Sep 17 00:00:00 2001 From: jahorton Date: Tue, 3 Sep 2019 10:52:48 +0700 Subject: [PATCH 2/3] Yay, typo. --- web/source/kmwutils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/source/kmwutils.ts b/web/source/kmwutils.ts index 071a526fbc..8a319a3c02 100644 --- a/web/source/kmwutils.ts +++ b/web/source/kmwutils.ts @@ -385,7 +385,7 @@ namespace com.keyman { } else if(!isNaN(val = Number(fs))) { // Note: this one is NOT natively handled by browsers! // We'll treat it as if it were 'pt', since that's likely the user's - // most famiilar font size unit. + // most familiar font size unit. return {val: (4 * val / 3), absolute: true}; } else { // Cannot parse. From 884c42ffc689d3c20f8c145d522196cff02623df Mon Sep 17 00:00:00 2001 From: jahorton Date: Wed, 4 Sep 2019 08:25:31 +0700 Subject: [PATCH 3/3] history.md --- web/history.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/history.md b/web/history.md index 7ce68315d2..dd9e80727b 100644 --- a/web/history.md +++ b/web/history.md @@ -3,6 +3,10 @@ ## 13.0 alpha * Start version 13.0 +## 2019-09-04 12.0.80 beta +* Fixed issue with 'pt' and unitless font size specifications for keyboard layouts (#2033) +* Slightly enhanced error logging for internal events (#2037) + ## 2019-09-03 12.0.79 beta * Tweaks suggestion banner behavior after multiple backspaces. (#2027)