diff --git a/templates/html/Wize_S5/ui/default/slides.js b/templates/html/Wize_S5/ui/default/slides.js
index 5183efd..6727632 100644
--- a/templates/html/Wize_S5/ui/default/slides.js
+++ b/templates/html/Wize_S5/ui/default/slides.js
@@ -398,8 +398,10 @@ function createControls() {
function fontScale() { // causes layout problems in FireFox that get fixed if browser's Reload is used; same may be true of other Gecko-based browsers
if (!s5mode) return false;
- var vScale = 22; // both yield 32 (after rounding) at 1024x768
- var hScale = 32; // perhaps should auto-calculate based on theme's declared value?
+ //var vScale = 22; // both yield 32 (after rounding) at 1024x768
+ //var hScale = 32; // perhaps should auto-calculate based on theme's declared value?
+ var vScale = Math.round(22 / getScaleFromTheme());
+ var hScale = Math.round(vScale * 32 / 22);
if (window.innerHeight) {
var vSize = window.innerHeight;
var hSize = window.innerWidth;
@@ -422,6 +424,12 @@ function fontScale() { // causes layout problems in FireFox that get fixed if b
}
}
+function getScaleFromTheme() {
+ var sc = parseFloat(getComputedStyle(document.documentElement).getPropertyValue('--main-pres-font-scale'));
+ sc = isNaN(sc) ? 1.0 : sc;
+ return sc;
+}
+
function fontSize(value) {
if (!(s5ss = document.getElementById('s5ss'))) {
if (!isIE) {