]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 13 Oct 2011 10:32:17 +0000 (10:32 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 13 Oct 2011 10:32:17 +0000 (10:32 +0000)
fluidbook/tools/convert.pe
inc/ws/Util/fontextractor/class.ws.pdf.font.php
inc/ws/Util/html5/class.ws.html5.compiler.php

index a70350060dd15e1b02a04021e6681ee2b0c0202d..efc6c41412f8c08839ef8cb3e32d2267de99af32 100644 (file)
@@ -10,12 +10,19 @@ while ( i<=$argc-3 )
 endloop
 
 if($argv[i]!="-")
+       if($iscid==1)
+               Print("It's a CID Font")
+               Print("Flatten CID")
+               CIDFlatten()
+       endif
+       
        Print("Rewrite font with CMAP ",$argv[i]);
        cmap=LoadStringFromFile($argv[i])
        glyphs=StrSplit(cmap,"\\n");
        j=0
        while(j<SizeOf(glyphs))
                if(glyphs[j]!="")
+                       SelectNone()
                        glyph=StrSplit(glyphs[j],"      ")
                        ufrom=Strtol(glyph[0],16)
                        uto=Strtol(glyph[1],16)
index 592d471d155c78568dce1b5f69dbf9e71e0d67b2..96122f9d45a151fa1ac7241a9a85dcb0fdcf8525 100644 (file)
@@ -19,6 +19,7 @@ class wsPDFFont {
        protected $capheight = 700;
        protected $firstWidth;
        protected $firstChar;
+       protected $bbox;
        protected static $ligatures = array('AE' => '00C6', 'ae' => '00E6',
                'OE' => '0152', 'oe' => '0152',
                'IJ' => '0132', 'ij' => '0133',
@@ -85,6 +86,8 @@ class wsPDFFont {
                                $this->capheight = $e[1];
                        } elseif ($e[0] == '/Flags') {
                                $this->flags = $e[1];
+                       } elseif ($e[0] == '/FontBBox') {
+                               $this->bbox = array($e[2], $e[3], $e[4], $e[5]);
                        }
                }
        }
@@ -97,11 +100,15 @@ class wsPDFFont {
                if (!is_null($this->descendant)) {
                        $font = $this->decendant;
                }
+               
+               if(is_null($font)){
+                       $font=$this;
+               }
 
                $fontforge->setArg(null, $file);
                $fontforge->setArg(null, $font->italicAngle);
-               $fontforge->setArg(null, $font->ascent);
-               $fontforge->setArg(null, $font->descent);
+               $fontforge->setArg(null, $font->getAscent());
+               $fontforge->setArg(null, $font->getDescent());
                //if ($font->firstChar == 0 && $font->firstWidth == 500) {
                $fontforge->setArg(null, '-');
                $fontforge->setArg(null, '-');
@@ -110,7 +117,9 @@ class wsPDFFont {
                //      $fontforge->setArg(null, $font->firstWidth);
                //}
                $fontforge->execute();
+               
                $this->addToLog($fontforge);
+               
        }
 
        public function getInfos() {
@@ -269,9 +278,9 @@ class wsPDFFont {
                                $inMap = true;
                                continue;
                        }
-                       
-                       if(count($e)==1 && $e[0]=='endbfchar'){
-                               $inMap=false;
+
+                       if (count($e) == 1 && $e[0] == 'endbfchar') {
+                               $inMap = false;
                        }
 
                        if (!$inMap) {
@@ -286,6 +295,20 @@ class wsPDFFont {
                return $res;
        }
 
+       public function getAscent() {
+               if ($this->ascent == 0) {
+                       return $this->bbox[3];
+               }
+               return $this->ascent;
+       }
+
+       public function getDescent() {
+               if ($this->descent == 0) {
+                       return abs($this->bbox[1]);
+               }
+               return $this->descent;
+       }
+
        protected function manageLigatures($code) {
                $codes = str_split($code, 4);
                $str = '';
index 0f9e0778afd241c78f0ecec26f339228e7abda2a..6f449afb9d880149ea2f016cfba24bd32dac7480 100644 (file)
@@ -386,6 +386,9 @@ class wsHTML5Compiler {
                                $fontforge->setArg(null, '-');
                                $fontforge->setArg(null, $this->vdir . '/data/style/F' . $index . '.' . $format);
                                $fontforge->execute();
+                               
+                               fb($fontforge->commande);
+                               fb($fontforge->output);
                        }
                }
        }