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)
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',
$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]);
}
}
}
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, '-');
// $fontforge->setArg(null, $font->firstWidth);
//}
$fontforge->execute();
+
$this->addToLog($fontforge);
+
}
public function getInfos() {
$inMap = true;
continue;
}
-
- if(count($e)==1 && $e[0]=='endbfchar'){
- $inMap=false;
+
+ if (count($e) == 1 && $e[0] == 'endbfchar') {
+ $inMap = false;
}
if (!$inMap) {
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 = '';