]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 13 Jun 2011 17:45:53 +0000 (17:45 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 13 Jun 2011 17:45:53 +0000 (17:45 +0000)
inc/ws/Metier/class.ws.document.php
inc/ws/Util/packager/class.ws.packager.html5.php

index 2b409549a65c76f28f61e217b7cffdf2b3823d30..2b8801ed23af57289848ec099b8ee2eb07a92304 100644 (file)
@@ -607,7 +607,8 @@ class wsDocument extends cubeMetier {
                // Then make HD background shots\r
                $resolutions = array(36 => 80, 72 => 70, 150 => 50);\r
                foreach ($resolutions as $r => $q) {\r
-                       $this->makeShotPNM($page, 'html/h' . $r . '-', $r, $q, 4, null, false);\r
+                       $texts=true;\r
+                       $this->makeShotPNM($page, 'html/h' . $r . '-', $r, $q, 4, null, $texts);\r
                }\r
        }\r
 \r
index d4c5f00f4722af14c8471000fbe10653e8f5a14c..198035adcd6603f9b7ea55555d32e158f587c993 100644 (file)
@@ -94,7 +94,7 @@ class wsPackagerHTML5 extends wsPackager {
                        mkdir($this->vdir . '/images/' . $r, 0777);\r
                }\r
                foreach ($this->pages as $page => $infos) {\r
-                       foreach ($resolutions as $r) {\r
+                       foreach ($self::$resolutions as $r) {\r
                                copy(WS_DOCS . '/' . $infos['document_id'] . '/html/h' . $r . '-' . $infos['document_page'] . '.jpg', $this->vdir . '/images/' . $r . '/p' . $page . '.jpg');\r
                        }\r
                }\r
@@ -139,6 +139,7 @@ class wsPackagerHTML5 extends wsPackager {
                }\r
 \r
                $group['y'] = $this->getCSSY($group['y'] * $this->multiply);\r
+               $group['x'] = $this->getCSSX($group['x'] * $this->multiply);\r
 \r
                $class = array('g');\r
                if (!is_null($group['color'])) {\r
@@ -150,6 +151,9 @@ class wsPackagerHTML5 extends wsPackager {
                if (!is_null($group['font'])) {\r
                        $class[] = 'f' . $group['font'];\r
                }\r
+               if (!is_null($group['x'])) {\r
+                       $class[] = 'x' . $group['x'];\r
+               }\r
                if (!is_null($group['y'])) {\r
                        $class[] = 'y' . $group['y'];\r
                }\r
@@ -186,13 +190,13 @@ class wsPackagerHTML5 extends wsPackager {
 \r
                $navTop = ($this->book->parametres->height - 40 - 100) / 2;\r
                $res[] = '#next,#previous{top:' . $navTop . 'px}';\r
-               $res[] = '.page,.background{width:' . $w . ';max-width:' . $w . ';height:' . $h . ';max-height:' . $h . '}';\r
+               $res[] = '.page,.texts{width:' . $w . ';max-width:' . $w . ';height:' . $h . ';max-height:' . $h . '}';\r
                $res[] = '.doublePage,#pages{width:' . $w2 . ';max-width:' . $w2 . ';height:' . $h . ';max-height:' . $h . '}';\r
                $res[] = '.page.right{left:' . $w . '}';\r
 \r
                foreach (self::$resolutions as $r) {\r
-                       $wb = ($this->book->parametres->width * $r) / 72;\r
-                       $hb = ($this->book->parametres->height * $r) / 72;\r
+                       $wb = round(($this->book->parametres->width * $r) / 72, 2) . 'px';\r
+                       $hb = round(($this->book->parametres->height * $r) / 72, 2) . 'px';\r
                        $s = 72 / $r;\r
 \r
                        $scale = '';\r
@@ -200,7 +204,7 @@ class wsPackagerHTML5 extends wsPackager {
                                $scale = self::writeCSSUA('transform', 'scale(' . $s . ')');\r
                        }\r
 \r
-                       $res[] = '.background .r' . $r . '{width:' . $wb . ';height:' . $hb . ';' . $scale . '}';\r
+                       $res[] = '.background.r' . $r . '{width:' . $wb . ';height:' . $hb . ';' . $scale . '}';\r
                }\r
 \r
                foreach ($this->cssColor as $color => $index) {\r
@@ -275,7 +279,12 @@ class wsPackagerHTML5 extends wsPackager {
 \r
                $res = array();\r
 \r
+               $first = true;\r
                foreach ($group->s as $span) {\r
+                       if ($first) {\r
+                               $x = $span['x'];\r
+                               $first = false;\r
+                       }\r
                        $newSpan = $this->addSpan($span, $document_id);\r
 \r
                        array_push($res, $newSpan);\r
@@ -288,6 +297,7 @@ class wsPackagerHTML5 extends wsPackager {
                        'letterspacing' => $this->getCSSLetterSpacing($group['letterspacing']),\r
                        'wordspacing' => $this->getCSSWordSpacing($group['wordspacing']),\r
                        'y' => ($group['size']) / -1.2,\r
+                       'x' => $x,\r
                        'spans' => $res);\r
        }\r
 \r
@@ -382,8 +392,8 @@ class wsPackagerHTML5 extends wsPackager {
        }\r
 \r
        protected function base62($val) {\r
-               $base = 62;\r
-               $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\r
+               $chars = '0123456789abcdefghijklmnopqrstuvwxyz';\r
+               $base = strlen($chars);\r
                $str = '';\r
                do {\r
                        $i = $val % $base;\r