#!/usr/bin/perl

use strict;
use warnings;

use Font::PCF;

utf8::decode $_ for @ARGV;  # pretend -CA is in effect

my $font = Font::PCF->open( shift @ARGV // die "Need FONT\n" );

my $glyph = $font->get_glyph_for_char( shift @ARGV // "Need GLYPH\n" );

sub printbits {
   my ( $bits ) = @_;
   while( $bits ) {
      print +( $bits & (1<<31) ) ? '#' : ' ';
      $bits <<= 1;
   }
   print "\n";
}

printbits $_ for $glyph->bitmap->@*;
