From: vincent@cubedesigners.com Date: Sat, 24 Sep 2011 18:06:46 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=e8ddb2dca533f350755a703b3f5aae6ec6e01933;p=cubeextranet.git --- diff --git a/_project/Rapport.docx b/_project/Rapport.docx index 2affa0730..29bfe093c 100644 Binary files a/_project/Rapport.docx and b/_project/Rapport.docx differ diff --git a/fluidbook/tools/convert.pe b/fluidbook/tools/convert.pe index 312b4cc93..0edcc6475 100644 --- a/fluidbook/tools/convert.pe +++ b/fluidbook/tools/convert.pe @@ -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 diff --git a/fluidbook/tools/descriptors.pe b/fluidbook/tools/descriptors.pe index f2a995f94..9ed55d740 100644 --- a/fluidbook/tools/descriptors.pe +++ b/fluidbook/tools/descriptors.pe @@ -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) diff --git a/fluidbook/tools/fwstk/nbproject/private/config.properties b/fluidbook/tools/fwstk/nbproject/private/config.properties index 2dc12851a..a7cc32142 100644 --- a/fluidbook/tools/fwstk/nbproject/private/config.properties +++ b/fluidbook/tools/fwstk/nbproject/private/config.properties @@ -1 +1 @@ -config=Infos +config=Extract_Layout diff --git a/fluidbook/tools/fwstk/nbproject/private/private.properties b/fluidbook/tools/fwstk/nbproject/private/private.properties index c85e5f3f2..75eb4042c 100644 --- a/fluidbook/tools/fwstk/nbproject/private/private.properties +++ b/fluidbook/tools/fwstk/nbproject/private/private.properties @@ -4,4 +4,4 @@ do.depend=false do.jar=true javac.debug=true javadoc.preview=true -user.properties.file=C:\\Users\\Vincent\\.netbeans\\7.0\\build.properties +user.properties.file=C:\\Users\\Cube\\.netbeans\\7.0\\build.properties diff --git a/fluidbook/tools/fwstk/src/org/apache/pdfbox/pdmodel/font/PDType0Font.java b/fluidbook/tools/fwstk/src/org/apache/pdfbox/pdmodel/font/PDType0Font.java index db734d316..099c2505c 100644 --- a/fluidbook/tools/fwstk/src/org/apache/pdfbox/pdmodel/font/PDType0Font.java +++ b/fluidbook/tools/fwstk/src/org/apache/pdfbox/pdmodel/font/PDType0Font.java @@ -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; diff --git a/inc/ws/Util/fontextractor/class.ws.pdf.font.php b/inc/ws/Util/fontextractor/class.ws.pdf.font.php index 00726a7e0..f33251a41 100644 --- a/inc/ws/Util/fontextractor/class.ws.pdf.font.php +++ b/inc/ws/Util/fontextractor/class.ws.pdf.font.php @@ -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]; } } diff --git a/inc/ws/Util/html5/class.ws.html5.compiler.php b/inc/ws/Util/html5/class.ws.html5.compiler.php index a7ac27cb2..e73063fa6 100644 --- a/inc/ws/Util/html5/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/class.ws.html5.compiler.php @@ -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);