#!/usr/local/bin/fontforge
Open($1,1)
Print("Open font ",$1)
-i=2;
-while ( i<=$argc-2 )
+i=2
+while ( i<=$argc-3 )
Print ("Merge with font ",$argv[i]);
MergeFonts($argv[i],1)
++i
endloop
+
+//
+if($argv[i]!="-")
+ cmap=LoadStringFromFile()
+ glyphs=StrSplit(cmap,"\\n");
+ j=0
+ while(j<SizeOf(glyphs))
+ if(glyphs[j]!="")
+ glyph=StrSplit(glyphs[j]," ")
+ u=Strtol(glyph[0],16)
+ Select(glyph[1])
+ SetUnicodeValue(UCodePoint(u))
+ j++
+ endif
+ endloop
+endif
+
+i++
Print("Write font ",$argv[i])
Generate($argv[i])
\ No newline at end of file
private Map<String, PDFont> documentFontCache = new HashMap<String, PDFont>();
private int validCharCnt;
private int totalCharCnt;
+ protected String currentString;
/**
* Flag to skip malformed or otherwise unparseable input where possible.
*/
totalCharCnt = 0;
}
+ public void setCurrentString(String s) {
+ currentString = s;
+ }
+
public boolean isForceParsing() {
return forceParsing;
}
c = font.encode(string, i, codeLength);
}
+ try {
+ String currentChar= Character.toString(currentString.charAt(i));
+ if (c.toUpperCase().equals(currentChar)) {
+ System.out.println("up");
+ c = c.toUpperCase();
+ } else if (c.toLowerCase().equals(currentChar)) {
+ System.out.println("low");
+ c = c.toLowerCase();
+ }
+ } catch ( NullPointerException | StringIndexOutOfBoundsException e) {
+ }
+
+ //System.out.println(c+";"+currentString.charAt(i));
+
// the space width has to be transformed into display units
float spaceWidthDisp = spaceWidthText * fontSizeText * horizontalScalingText * textMatrix.getValue(0, 0) * ctm.getValue(0, 0);
--- /dev/null
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pdfbox.util.operator;
+
+import java.util.List;
+
+import org.apache.pdfbox.cos.COSBase;
+import org.apache.pdfbox.cos.COSString;
+import org.apache.pdfbox.util.PDFOperator;
+
+import java.io.IOException;
+
+/**
+ * @author Huault : huault@free.fr
+ * @version $Revision: 1.4 $
+ */
+public class ShowText extends OperatorProcessor {
+
+ /**
+ * Tj show Show text.
+ * @param operator The operator that is being executed.
+ * @param arguments List
+ *
+ * @throws IOException If there is an error processing this operator.
+ */
+ public void process(PDFOperator operator, List<COSBase> arguments) throws IOException {
+ COSString string = (COSString) arguments.get(0);
+ context.setCurrentString(string.getString());
+ context.processEncodedText(string.getBytes());
+ }
+}
--- /dev/null
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pdfbox.util.operator;
+
+import java.util.List;
+
+import org.apache.pdfbox.util.Matrix;
+import org.apache.pdfbox.util.PDFOperator;
+import org.apache.pdfbox.cos.COSArray;
+import org.apache.pdfbox.cos.COSBase;
+import org.apache.pdfbox.cos.COSNumber;
+import java.io.IOException;
+import org.apache.pdfbox.cos.COSString;
+
+/**
+ * @author Huault : huault@free.fr
+ * @version $Revision: 1.6 $
+ */
+public class ShowTextGlyph extends OperatorProcessor {
+
+ /**
+ * TJ Show text, allowing individual glyph positioning.
+ * @param operator The operator that is being executed.
+ * @param arguments List
+ * @throws IOException If there is an error processing this operator.
+ */
+ public void process(PDFOperator operator, List<COSBase> arguments) throws IOException {
+ COSArray array = (COSArray) arguments.get(0);
+ int arraySize = array.size();
+ float fontsize = context.getGraphicsState().getTextState().getFontSize();
+ float horizontalScaling = context.getGraphicsState().getTextState().getHorizontalScalingPercent() / 100;
+ for (int i = 0; i < arraySize; i++) {
+ COSBase next = array.get(i);
+ if (next instanceof COSNumber) {
+ float adjustment = ((COSNumber) next).floatValue();
+ Matrix adjMatrix = new Matrix();
+ adjustment = -(adjustment / 1000) * horizontalScaling * fontsize;
+ // TODO vertical writing mode
+ adjMatrix.setValue(2, 0, adjustment);
+ context.setTextMatrix(adjMatrix.multiply(context.getTextMatrix(), adjMatrix));
+ } else if (next instanceof COSString) {
+ context.setCurrentString(((COSString) next).getString());
+ context.processEncodedText(((COSString) next).getBytes());
+
+ } else {
+ throw new IOException("Unknown type in array for TJ operation:" + next);
+ }
+ }
+ }
+}
foreach ($files as $file) {\r
$fontforge->setArg(null, $out . '/' . $file);\r
}\r
+ $fontforge->setArg(null, $this->out . '/html/' . $fontname . '.cmap');\r
$fontforge->setArg(null, $this->out . '/fonts/web/' . $fontname . '.ttf');\r
$fontforge->execute();\r
$this->addToLog($fontforge);\r
$firstDoc = $daoDoc->selectById($this->pages[1]['document_id']);
$size = $firstDoc->generalInfos['size'];
- $this->width = round($size[0],2);
- $this->height = round($size[1],2);
+ $this->width = round($size[0], 2);
+ $this->height = round($size[1], 2);
}
public function virtualToPhysical($virtual) {
$config->numerotation = explode(',', $this->book->numerotation);
$config->id = $this->book->book_id;
$config->cacheDate = TIME;
- $config->width=$this->width;
- $config->height=$this->height;
+ $config->width = $this->width;
+ $config->height = $this->height;
return 'var DATAS=' . json_encode($config) . ';' . "\n";
}
foreach ($this->fontDocs[$font] as $document_id => $dummy) {
$fontforge->setArg(null, WS_DOCS . '/' . $document_id . '/fonts/web/' . $font . '.ttf');
}
+ $fontforge->setArg(null, '-');
$fontforge->setArg(null, $this->vdir . '/data/style/F' . $index . '.' . $format);
$fontforge->execute();
+
+ fb($fontforge->commande);
}
}
}
// Links Styles
$res = array_merge($res, $links);
$res[] = '.link a.displayArea:hover,.link a.displayArea.animating{background-color:' . self::colorToCSS($this->theme->parametres->linksColor, 0.4) . ';}';
- $res[]='.link a.displayArea{-webkit-tap-highlight-color:'.self::colorToCSS($this->theme->parametres->linksColor, 0.4).';}';
+ $res[] = '.link a.displayArea{-webkit-tap-highlight-color:' . self::colorToCSS($this->theme->parametres->linksColor, 0.4) . ';}';
// Menus
# View