예제 #1
0
 public function __construct($cSym)
 {
     switch (strlen($cSym)) {
         case 3:
             $this->base = $cSym;
             $this->key = base2view($cSym);
             $this->bsw = key2bsw($this->key);
             break;
         case 5:
             $this->base = substr($cSym, 0, 3);
             $this->key = $cSym;
             $this->bsw = key2bsw($this->key);
             break;
         case 9:
             $this->base = substr($cSym, 0, 3);
             $this->key = bsw2key($cSym);
             $this->bsw = $cSym;
             break;
     }
     $this->png = key2png($this->key);
     $img = imagecreatefromstring($this->png);
     $this->width = ImageSX($img);
     $this->height = ImageSY($img);
     $this->centerX = ImageSX($img) / 2;
     $this->centerY = ImageSY($img) / 2;
     imagedestroy($img);
 }
예제 #2
0
            if (count($chars) == 5) {
                $fswpm .= bsw2utf($sbsw, 1) . '0°0';
            } else {
                $fswpm .= bsw2utf($sbsw, 1) . $sd . '°' . $sl;
            }
            $fbswml .= '&nbsp;&nbsp;&lt;sym x="' . $sx . '" y="' . $sy . '"&gt;' . bsw2key($sbsw) . '&lt;/sym&gt;<br>';
        }
        $fswcm .= ' ';
        $fswpm .= ' ';
        if ($seq) {
            $fswcm .= ' Q' . bsw2utf($seq, 1) . ' ';
            $fswpm .= ' Q' . bsw2utf($seq, 1) . ' ';
            $chars = str_split($seq, 9);
            for ($i = 0; $i < count($chars); $i++) {
                $sbsw = $chars[$i];
                $fbswml .= '&nbsp;&nbsp;&lt;seq&gt;' . bsw2key($sbsw) . '&lt;/seq&gt;<br>';
            }
        }
        $fbswml .= '&lt;/sign&gt;<br>';
    }
}
if ($bsw) {
    echo '<h2>BSW</h2>' . $fbsw;
    echo '<h2>Unicode PUA</h2>' . $fupua;
    echo '<h2>SignWriting Cartesian Markup</h2>' . $fswcm;
    echo '<h2>SignWriting Polar Markup</h2>' . $fswpm;
    echo '<h2>BSWML</h2>' . $fbswml;
}
?>

</div>
예제 #3
0
        $extra .= '&size=' . $size;
    }
    if ($colorize) {
        $extra .= '&colorize=1';
    } else {
        $extra .= '&line=' . $line;
    }
    $extra .= '&fill=' . $fill;
    $extra .= '&back=' . $back;
    if ($view) {
        $chars = str_split(bsw2iswa($bsw), 9);
        $chars = array_unique($chars);
        sort($chars, SORT_STRING);
        $syms = array();
        foreach ($chars as $bsw) {
            $base = substr($bsw, 0, 3);
            $syms[$base][] = $bsw;
        }
        foreach ($syms as $base => $chars) {
            $bs_id = $iswa->key2id(bsw2key($base), 4);
            echo '<h1>' . $msg['iswa_' . $bs_id] . ' <img src="glyph.php?key=' . base2view($base) . $extra . '">' . '</h1>';
            foreach ($chars as $bsw) {
                echo '<img src="glyph.php?bsw=' . $bsw . $extra . '&name=' . bsw2key($bsw) . '"> ';
            }
        }
    }
}
?>
</div></body>
</html>
예제 #4
0
}
$dir .= "/{$stamp}";
if (!is_dir($dir)) {
    $rs = @mkdir($dir, 0777);
    $rs = @mkdir($dir . '/iswa', 0777);
    if (!$rs) {
        die('Fail: could not make directory for this stamp for ' . $stamp);
    }
}
//main extract array of symbols
$extract = array();
//get iswa list of bsw
$chars = str_split(bsw2iswa($bsw), 9);
//get a list of chars
foreach ($chars as $char) {
    $key = bsw2key($char);
    $extract[$key] = 1;
    $key = base2view(substr($char, 0, 3));
    $extract[$key] = 1;
    $key = base2view(base2group(substr($char, 0, 3)));
    $extract[$key] = 1;
}
ksort($extract);
//cycle through the iswa chars and copy
if (!is_dir($dir . '/iswa')) {
    mkdir($dir . '/iswa');
}
foreach ($extract as $key => $val) {
    $base = substr($key, 0, 3);
    $file = 'iswa/' . $base . '/' . $key . '.png';
    //  echo "<img src='" . $file . "'>&nbsp;&nbsp;";