Created
March 29, 2020 22:38
-
-
Save inxomnyaa/b105368ac73668264ad2948a0a08db0e to your computer and use it in GitHub Desktop.
PocketMine-MP: print all characters/symbols inside a font image file (glyph_XX.png)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
const GRID = 16;//16 * 16 icons | |
$filename = basename("glyph_E1",".png"); | |
$startChar = hexdec(substr($filename, strrpos($filename, "_")+1)."00"); | |
$i=0; | |
do{ | |
$x = $i % GRID; | |
$z = ($i - ($i % GRID)) / GRID; | |
$ci = $startChar + $i;//char index | |
$char = mb_chr($ci); | |
$hex = dechex($ci); | |
print "I:$i X:$x Z:$z H:$hex C#:$ci C:$char".PHP_EOL; | |
} | |
while(++$i < GRID**2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment