Changeset View
Changeset View
Standalone View
Standalone View
externals/pear-figlet/Text/Figlet.php
Show First 20 Lines • Show All 225 Lines • ▼ Show 20 Lines | function loadFont($filename, $loadgerman = true) | ||||
if (preg_match('/^\-0x/i', $i)) { | if (preg_match('/^\-0x/i', $i)) { | ||||
$this->_skip($fp); | $this->_skip($fp); | ||||
} else { | } else { | ||||
// If Unicode | // If Unicode | ||||
if (preg_match('/^0x/i', $i)) { | if (preg_match('/^0x/i', $i)) { | ||||
$i = hexdec(substr($i, 2)); | $i = hexdec(substr($i, 2)); | ||||
} else { | } else { | ||||
// If octal | // If octal | ||||
if ($i{0} === '0' && $i !== '0' || substr($i, 0, 2) == '-0') { | if ($i[0] === '0' && $i !== '0' || substr($i, 0, 2) == '-0') { | ||||
$i = octdec($i); | $i = octdec($i); | ||||
} | } | ||||
} | } | ||||
$letter = $this->_char($fp); | $letter = $this->_char($fp); | ||||
// Invalid character but main font is loaded and I can use it | // Invalid character but main font is loaded and I can use it | ||||
if ($letter === false) { | if ($letter === false) { | ||||
Show All 26 Lines | function lineEcho($str, $inhtml = false) | ||||
$out = array(); | $out = array(); | ||||
for ($i = 0; $i<strlen($str); $i++) { | for ($i = 0; $i<strlen($str); $i++) { | ||||
// Pseudo Unicode support | // Pseudo Unicode support | ||||
if (substr($str, $i, 2) == '%u') { | if (substr($str, $i, 2) == '%u') { | ||||
$lt = hexdec(substr($str, $i+2, 4)); | $lt = hexdec(substr($str, $i+2, 4)); | ||||
$i += 5; | $i += 5; | ||||
} else { | } else { | ||||
$lt = ord($str{$i}); | $lt = ord($str[$i]); | ||||
} | } | ||||
$hb = preg_quote($this->hardblank, '/'); | $hb = preg_quote($this->hardblank, '/'); | ||||
$sp = "$hb\\x00\\s"; | $sp = "$hb\\x00\\s"; | ||||
// If chosen character not found try to use default | // If chosen character not found try to use default | ||||
// If default character is not defined skip it | // If default character is not defined skip it | ||||
▲ Show 20 Lines • Show All 215 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0