From 19a958799b0660d447d5edbe9715f78c08b0d1b5 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 13 Jun 2011 17:45:53 +0000 Subject: [PATCH] --- inc/ws/Metier/class.ws.document.php | 3 ++- .../Util/packager/class.ws.packager.html5.php | 24 +++++++++++++------ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/inc/ws/Metier/class.ws.document.php b/inc/ws/Metier/class.ws.document.php index 2b409549a..2b8801ed2 100644 --- a/inc/ws/Metier/class.ws.document.php +++ b/inc/ws/Metier/class.ws.document.php @@ -607,7 +607,8 @@ class wsDocument extends cubeMetier { // Then make HD background shots $resolutions = array(36 => 80, 72 => 70, 150 => 50); foreach ($resolutions as $r => $q) { - $this->makeShotPNM($page, 'html/h' . $r . '-', $r, $q, 4, null, false); + $texts=true; + $this->makeShotPNM($page, 'html/h' . $r . '-', $r, $q, 4, null, $texts); } } diff --git a/inc/ws/Util/packager/class.ws.packager.html5.php b/inc/ws/Util/packager/class.ws.packager.html5.php index d4c5f00f4..198035adc 100644 --- a/inc/ws/Util/packager/class.ws.packager.html5.php +++ b/inc/ws/Util/packager/class.ws.packager.html5.php @@ -94,7 +94,7 @@ class wsPackagerHTML5 extends wsPackager { mkdir($this->vdir . '/images/' . $r, 0777); } foreach ($this->pages as $page => $infos) { - foreach ($resolutions as $r) { + foreach ($self::$resolutions as $r) { copy(WS_DOCS . '/' . $infos['document_id'] . '/html/h' . $r . '-' . $infos['document_page'] . '.jpg', $this->vdir . '/images/' . $r . '/p' . $page . '.jpg'); } } @@ -139,6 +139,7 @@ class wsPackagerHTML5 extends wsPackager { } $group['y'] = $this->getCSSY($group['y'] * $this->multiply); + $group['x'] = $this->getCSSX($group['x'] * $this->multiply); $class = array('g'); if (!is_null($group['color'])) { @@ -150,6 +151,9 @@ class wsPackagerHTML5 extends wsPackager { if (!is_null($group['font'])) { $class[] = 'f' . $group['font']; } + if (!is_null($group['x'])) { + $class[] = 'x' . $group['x']; + } if (!is_null($group['y'])) { $class[] = 'y' . $group['y']; } @@ -186,13 +190,13 @@ class wsPackagerHTML5 extends wsPackager { $navTop = ($this->book->parametres->height - 40 - 100) / 2; $res[] = '#next,#previous{top:' . $navTop . 'px}'; - $res[] = '.page,.background{width:' . $w . ';max-width:' . $w . ';height:' . $h . ';max-height:' . $h . '}'; + $res[] = '.page,.texts{width:' . $w . ';max-width:' . $w . ';height:' . $h . ';max-height:' . $h . '}'; $res[] = '.doublePage,#pages{width:' . $w2 . ';max-width:' . $w2 . ';height:' . $h . ';max-height:' . $h . '}'; $res[] = '.page.right{left:' . $w . '}'; foreach (self::$resolutions as $r) { - $wb = ($this->book->parametres->width * $r) / 72; - $hb = ($this->book->parametres->height * $r) / 72; + $wb = round(($this->book->parametres->width * $r) / 72, 2) . 'px'; + $hb = round(($this->book->parametres->height * $r) / 72, 2) . 'px'; $s = 72 / $r; $scale = ''; @@ -200,7 +204,7 @@ class wsPackagerHTML5 extends wsPackager { $scale = self::writeCSSUA('transform', 'scale(' . $s . ')'); } - $res[] = '.background .r' . $r . '{width:' . $wb . ';height:' . $hb . ';' . $scale . '}'; + $res[] = '.background.r' . $r . '{width:' . $wb . ';height:' . $hb . ';' . $scale . '}'; } foreach ($this->cssColor as $color => $index) { @@ -275,7 +279,12 @@ class wsPackagerHTML5 extends wsPackager { $res = array(); + $first = true; foreach ($group->s as $span) { + if ($first) { + $x = $span['x']; + $first = false; + } $newSpan = $this->addSpan($span, $document_id); array_push($res, $newSpan); @@ -288,6 +297,7 @@ class wsPackagerHTML5 extends wsPackager { 'letterspacing' => $this->getCSSLetterSpacing($group['letterspacing']), 'wordspacing' => $this->getCSSWordSpacing($group['wordspacing']), 'y' => ($group['size']) / -1.2, + 'x' => $x, 'spans' => $res); } @@ -382,8 +392,8 @@ class wsPackagerHTML5 extends wsPackager { } protected function base62($val) { - $base = 62; - $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + $chars = '0123456789abcdefghijklmnopqrstuvwxyz'; + $base = strlen($chars); $str = ''; do { $i = $val % $base; -- 2.39.5