From: Mischa POSLAWSKY Date: Fri, 6 Mar 2015 08:46:41 +0000 (+0100) Subject: font: do not align columns to a power of 32 X-Git-Tag: v1.7~39 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/77599c89c009e35136eb090114014b2d5ddcaea0?ds=sidebyside font: do not align columns to a power of 32 Alphabets do not specifically align this way as previously thought. --- diff --git a/font.plp b/font.plp index 8c9b098..a039905 100644 --- a/font.plp +++ b/font.plp @@ -74,22 +74,18 @@ EOT ); for my $cp ($offset .. $offset+$pagerows-1) { - state $sameblock; + state $colpos; my $block = Unicode::UCD::charblock($cp); - - if ($sameblock and $sameblock ne $block and $block ne 'No_Block') { - say sprintf '%s', $pagecols+1, $block; - undef $sameblock; - } - - if (not $sameblock) { + if ($block ne (state $sameblock = $block) and $block ne 'No_Block') { + print ''; + printf '%s', $pagecols+1, $block + unless $block eq 'No_Block'; + say ''; $sameblock = $block; - if (my $gap = $cp % $pagecols) { - say sprintf '%X', $cp, $gap; - } + $colpos = 0; } - say sprintf '%X', $cp if $cp % $pagecols == 0; + say sprintf '%X', $cp if $colpos++ % $pagecols == 0; my $info = $glyphs->glyph_info($cp); my ($class, $name, $mnem, $html, $string) = @{$info};