Skip to content

Instantly share code, notes, and snippets.

@inxomnyaa
Created March 29, 2020 22:38
Show Gist options
  • Save inxomnyaa/b105368ac73668264ad2948a0a08db0e to your computer and use it in GitHub Desktop.
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)
<?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