]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Sat, 24 Sep 2011 18:06:46 +0000 (18:06 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Sat, 24 Sep 2011 18:06:46 +0000 (18:06 +0000)
_project/Rapport.docx
fluidbook/tools/convert.pe
fluidbook/tools/descriptors.pe
fluidbook/tools/fwstk/nbproject/private/config.properties
fluidbook/tools/fwstk/nbproject/private/private.properties
fluidbook/tools/fwstk/src/org/apache/pdfbox/pdmodel/font/PDType0Font.java
inc/ws/Util/fontextractor/class.ws.pdf.font.php
inc/ws/Util/html5/class.ws.html5.compiler.php

index 2affa0730fc3b55146175314a50f2075aec7dc9a..29bfe093cd2023af7fcf34b9a39d4a661b4a36a3 100644 (file)
Binary files a/_project/Rapport.docx and b/_project/Rapport.docx differ
index 312b4cc935857e34177a5a84be8f9831618b65d3..0edcc64759ffeb03817629e2ba47ca864c45f3fe 100644 (file)
@@ -1,11 +1,11 @@
 #!/usr/local/bin/fontforge
-Open($1,1)
+Open($1)
 Print("Open font ",$1)
 Print("Em size : ",$em);
 i=2
 while ( i<=$argc-3 )
        Print ("Merge with font ",$argv[i]);
-       MergeFonts($argv[i],1)
+       MergeFonts($argv[i])
    ++i
 endloop
 
index f2a995f94407c633ebd63a042918c1870b505f12..9ed55d7408ec046a210ff9cf4756b46786976a11 100644 (file)
@@ -1,11 +1,34 @@
 #!/usr/local/bin/fontforge
-Open($1,1)
+Open($1)
 Print("Open font ",$1)
+
+
 if($2!="-")
        // Italic
-       Print("Set italic angle to ",$2)
+       Print("Set italic angle from ",$italicangle," to ",$2)
        SetItalicAngle(Strtol($2))
 endif
+
+if($5!="-" && $6!="-")
+       // Select first char
+       c=Strtol($5)
+       Select(c)
+       w=Real(GlyphInfo("Width"))
+       if(c==0 && Round(w)==1000)
+               Print("Maybe an error, no scaling will occur")
+       else
+               rw=Real(Strtol($6))
+               Print("First char width is ",w," and should be ",rw)
+               if(w!=rw)
+                       ratio=(rw/w)*100.0
+                       Print("Scaling the whole font to ",ratio,"%")
+                       SelectAll()
+                       Transform(Round(ratio),0,0,Round(ratio),0,0)
+               endif
+       endif
+endif
+
+
 if($3!="-" && $4!="-" && $3!="0")
        Print("Set Ascent & Descent to ",$3," and ",$4)
        // Ascent & Descent
@@ -21,5 +44,6 @@ if($3!="-" && $4!="-" && $3!="0")
 endif
 
 SetMacStyle(-1);
+SetGasp(65535,3)
 
 Generate($1)
index 2dc12851a7a69957dcc55ec1989a3c2cb55652b2..a7cc321429951de5ef6f4fc558ce09f5159aa3fd 100644 (file)
@@ -1 +1 @@
-config=Infos\r
+config=Extract_Layout\r
index c85e5f3f2e1a01c3d61bf97f79be5499643ed027..75eb4042cfe9916c9d015a70e633193825e04eb6 100644 (file)
@@ -4,4 +4,4 @@ do.depend=false
 do.jar=true\r
 javac.debug=true\r
 javadoc.preview=true\r
-user.properties.file=C:\\Users\\Vincent\\.netbeans\\7.0\\build.properties\r
+user.properties.file=C:\\Users\\Cube\\.netbeans\\7.0\\build.properties\r
index db734d316faaf0d717ea6787c6cfc7802b948c8f..099c2505cc48e54b06b1b6905953609cf4665e5b 100644 (file)
@@ -21,7 +21,6 @@ import java.io.IOException;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.fontbox.afm.FontMetric;
 import org.apache.pdfbox.cos.COSArray;
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.cos.COSName;
index 00726a7e0f21247c7f8c2178efb8f51cf7eed278..f33251a41be67da9ccb28c5a541438e954a18eea 100644 (file)
@@ -17,6 +17,8 @@ class wsPDFFont {
        protected $descent = 200;
        protected $xheight = 600;
        protected $capheight = 700;
+       protected $firstWidth;
+       protected $firstChar;
        protected static $ligatures = array('AE' => '00C6', 'ae' => '00E6',
                'OE' => '0152', 'oe' => '0152',
                'IJ' => '0132', 'ij' => '0133',
@@ -90,16 +92,23 @@ class wsPDFFont {
        public function setDescriptorsToFile($file) {
                $fontforge = new cubeCommandLine('descriptors.pe');
                $fontforge->setPath(CONVERTER_PATH);
-               
-               $font=$this;
-               if(!is_null($this->descendant)){
-                       $font=$this->decendant;
+
+               $font = $this;
+               if (!is_null($this->descendant)) {
+                       $font = $this->decendant;
                }
-               
+
                $fontforge->setArg(null, $file);
                $fontforge->setArg(null, $font->italicAngle);
                $fontforge->setArg(null, $font->ascent);
                $fontforge->setArg(null, $font->descent);
+               if ($font->firstChar == 0 && $font->firstWidth == 500) {
+                       $fontforge->setArg(null, '-');
+                       $fontforge->setArg(null, '-');
+               } else {
+                       $fontforge->setArg(null, $font->firstChar);
+                       $fontforge->setArg(null, $font->firstWidth);
+               }
                $fontforge->execute();
                $this->addToLog($fontforge);
        }
@@ -127,18 +136,16 @@ class wsPDFFont {
 
                        if ($e[0] == '/ToUnicode') {
                                $this->cmap_id = $e[1];
-                       }
-
-                       if ($e[0] == '/DescendantFonts') {
+                       } elseif ($e[0] == '/DescendantFonts') {
                                $this->descendant = new wsPDFFont($this->extractor, $e[1]);
-                       }
-
-                       if ($e[0] == '/BaseFont') {
+                       } elseif ($e[0] == '/BaseFont') {
                                $this->name = ltrim($e[1], '/');
-                       }
-
-                       if ($e[0] == '/FontDescriptor') {
+                       } elseif ($e[0] == '/FontDescriptor') {
                                $this->descriptor_id = $e[1];
+                       } elseif ($e[0] == '/FirstChar') {
+                               $this->firstChar = $e[1];
+                       } elseif ($e[0] == '/Widths') {
+                               $this->firstWidth = $e[2];
                        }
                }
 
index a7ac27cb219ef11a61a6f6296065f5800c0a8124..e73063fa62c8169377341a159fdd936420f1db53 100644 (file)
@@ -357,7 +357,6 @@ class wsHTML5Compiler {
                $formats = array('ttf', 'woff', 'svg');
 
                foreach ($this->cssFont as $font => $infos) {
-                       fb($infos, $font);
                        $index = $infos['index'];
 
                        foreach ($formats as $format) {
@@ -369,9 +368,6 @@ class wsHTML5Compiler {
                                $fontforge->setArg(null, '-');
                                $fontforge->setArg(null, $this->vdir . '/data/style/F' . $index . '.' . $format);
                                $fontforge->execute();
-
-                               fb($fontforge->commande);
-                               fb($fontforge->output);
                        }
                }
        }
@@ -481,10 +477,6 @@ class wsHTML5Compiler {
                }
 
                $class = array('g');
-               if ($group['oblique']) {
-                       $class[] = 'o';
-               }
-
                if (!is_null($group['color'])) {
                        $class[] = 'c' . $group['color'];
                }
@@ -756,8 +748,8 @@ class wsHTML5Compiler {
                foreach ($this->cssFont as $font => $infos) {
                        $index = $infos['index'];
                        $style = $infos['oblique'] ? 'oblique' : 'normal';
-                       $res[] = "@font-face{font-family:F" . $index . ";src:url('F" . $index . ".ttf') format('truetype'),url('F" . $index . ".woff') format('woff'),url('F" . $index . ".svg#" . $font . "') format('svg')}";
-                       $res[] = '.f' . $index . '{font-family:F' . $index . ',Arial,Helvetica}';
+                       $res[] = "@font-face{font-family:F" . $index . ";font-style:all;src:url('F" . $index . ".ttf') format('truetype'),url('F" . $index . ".woff') format('woff'),url('F" . $index . ".svg#" . $font . "') format('svg')}";
+                       $res[] = '.f' . $index . '{font-family:F' . $index . ',Arial,Helvetica;}';
                }
 
                $res = array_chunk($res, 3500);
@@ -861,7 +853,7 @@ class wsHTML5Compiler {
 
                return array(
                        'color' => $this->getCSSColor($group['color']),
-                       'size' => $this->getCSSSize($group['size'] * $this->fontScale),
+                       'size' => $this->getCSSSize($group['size']),
                        'font' => $this->getCSSFont($group['font'], $group['oblique'] == 'true', $document_id),
                        'y' => 0,
                        'x' => $group['x'],
@@ -880,6 +872,7 @@ class wsHTML5Compiler {
        }
 
        protected function getCSSSize($size) {
+               $os=$size;
                $size = $this->normalizeFloatValue($size);
                $size*=$this->multiply;
                return $this->getIndex($size, $this->cssSize);