]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 17 May 2011 16:59:05 +0000 (16:59 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 17 May 2011 16:59:05 +0000 (16:59 +0000)
inc/ws/Util/packager/class.ws.packager.html5.php

index 094ec2ab8cfbf2229c99f8710fa91e81fca37067..60e2c2283137b73f47737b9d540ef994b14dec23 100644 (file)
@@ -34,7 +34,7 @@ class wsPackagerHTML5 extends wsPackager {
 \r
                $imagesize = getimagesize(WS_DOCS . '/' . $this->pages[1]['document_id'] . '/html/h150-' . $this->pages[1]['document_page'] . '.jpg');\r
                $this->pdf2htmlRatio = $imagesize[0] / $this->layouts[1]['width'];\r
-               $this->scale = 5;\r
+               $this->scale = 10;\r
                $this->multiply = $this->pdf2htmlRatio * $this->scale;\r
 \r
                $this->createHTML();\r
@@ -141,6 +141,12 @@ class wsPackagerHTML5 extends wsPackager {
                if (!is_null($group['y'])) {\r
                        $class[] = 'y' . $group['y'];\r
                }\r
+               if (!is_null($group['letterspacing'])) {\r
+                       $class[] = 'l' . $group['letterspacing'];\r
+               }\r
+               if (!is_null($group['wordspacing'])) {\r
+                       $class[] = 'w' . $group['wordspacing'];\r
+               }\r
                $class = implode(' ', $class);\r
 \r
                $res = '<div class="' . $class . '">';\r
@@ -163,9 +169,6 @@ class wsPackagerHTML5 extends wsPackager {
                if (!is_null($span['x'])) {\r
                        $class[] = 'x' . $span['x'];\r
                }\r
-               if (!is_null($span['letterspacing'])) {\r
-                       $class[] = 'l' . $span['letterspacing'];\r
-               }\r
 \r
                if (count($class)) {\r
                        $class = ' class="' . implode(' ', $class) . '"';\r
@@ -190,13 +193,11 @@ class wsPackagerHTML5 extends wsPackager {
                }\r
 \r
                foreach ($this->cssLetterSpacing as $letterspacing => $index) {\r
-                       $letterspacing*=$this->multiply;\r
-                       $res[] = '.l' . $index . '{letter-spacing:' . $letterspacing . 'px}';\r
+                       $res[] = '.l' . $index . '{letter-spacing:' . $letterspacing . 'em}';\r
                }\r
 \r
                foreach ($this->cssWordSpacing as $wordspacing => $index) {\r
-                       $wordspacing*=$this->multiply;\r
-                       $res[] = '.w' . $index . '{word-spacing:' . $wordspacing . 'px}';\r
+                       $res[] = '.w' . $index . '{word-spacing:' . $wordspacing . 'em}';\r
                }\r
 \r
                foreach ($this->cssX as $x => $index) {\r
@@ -259,6 +260,8 @@ class wsPackagerHTML5 extends wsPackager {
                        'color' => $this->getCSSColor($group['color']),\r
                        'size' => $this->getCSSSize($group['size']),\r
                        'font' => $this->getCSSFont($group['font'], $document_id),\r
+                       'letterspacing' => $this->getCSSLetterSpacing($group['letterspacing']),\r
+                       'wordspacing' => $this->getCSSWordSpacing($group['wordspacing']),\r
                        'y' => ($group['size']) / -1.2,\r
                        'spans' => $res);\r
        }\r
@@ -271,12 +274,11 @@ class wsPackagerHTML5 extends wsPackager {
                }\r
                return array('text' => $text,\r
                        'x' => $this->normalizeFloatValue($span['x']),\r
-                       'width' => $this->normalizeFloatValue($span['width']),\r
-                       'letterspacing' => null);\r
+                       'width' => $this->normalizeFloatValue($span['width']));\r
        }\r
 \r
        protected function getCSSSize(&$size) {\r
-               $size/=1.05;\r
+               $size=$this->normalizeFloatValue($size, 1);\r
                $sizer = round($size * $this->multiply);\r
                return $this->getIndex($sizer, $this->cssSize);\r
        }\r
@@ -297,7 +299,9 @@ class wsPackagerHTML5 extends wsPackager {
        }\r
 \r
        protected function getCSSLetterSpacing($letterspacing) {\r
+\r
                $letterspacing = $this->normalizeFloatValue($letterspacing, 5);\r
+\r
                if ($letterspacing == 0) {\r
                        return null;\r
                }\r
@@ -306,6 +310,7 @@ class wsPackagerHTML5 extends wsPackager {
 \r
        protected function getCSSWordSpacing($wordspacing) {\r
                $wordspacing = $this->normalizeFloatValue($wordspacing, 5);\r
+\r
                if ($wordspacing == 0) {\r
                        return null;\r
                }\r