
buttons. This requires some tools to convert .png images to that, and that I put the characters in a two-dimensional grid in the texture (since one-dimensional strip gets wider than the hardware supports). [git-p4: depot-paths = "//depot/solvespace/": change = 2138]
29 lines
659 B
Perl
29 lines
659 B
Perl
#!/usr/bin/perl
|
|
|
|
use GD;
|
|
|
|
for $file (sort <icons/char-*.png>) {
|
|
open(PNG, $file) or die "$file: $!\n";
|
|
$img = newFromPng GD::Image(\*PNG) or die;
|
|
$img->trueColor(1);
|
|
close PNG;
|
|
|
|
($width, $height) = $img->getBounds();
|
|
die "$file: $width, $height" if ($width != 16) or ($height != 16);
|
|
|
|
for($x = 0; $x < 16; $x++) {
|
|
for($y = 0; $y < 16; $y++) {
|
|
$index = $img->getPixel($x, $y);
|
|
($r, $g, $b) = $img->rgb($index);
|
|
if($r + $g + $b < 11) {
|
|
print " 0, ";
|
|
} else {
|
|
print "255, ";
|
|
}
|
|
}
|
|
print "\n";
|
|
}
|
|
print "\n";
|
|
}
|
|
|