3 * @package php-font-lib
4 * @link https://github.com/PhenX/php-font-lib
5 * @author Fabien Ménager <fabien.menager@gmail.com>
6 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 * Encoding map used to map a code point to a Unicode char.
14 * @package php-font-lib
19 function __construct($file) {
20 $this->f
= fopen($file, "r");
26 while ($line = fgets($this->f
)) {
27 if (preg_match('/^[\!\=]([0-9A-F]{2,})\s+U\+([0-9A-F]{2})([0-9A-F]{2})\s+([^\s]+)/', $line, $matches)) {
28 $unicode = (hexdec($matches[2]) << 8) +
hexdec($matches[3]);
29 $map[hexdec($matches[1])] = array($unicode, $matches[4]);