File: make_vmtx

package info (click to toggle)
xfonts-mona 2.90-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 7,888 kB
  • sloc: perl: 11,238; makefile: 442; lisp: 68
file content (33 lines) | stat: -rwxr-xr-x 667 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env perl
# $Id: make_vmtx,v 1.4 2003/08/05 16:26:37 s42335 Exp $
#
# usage: make_vmtx BDF ppem unitem
#
# build a vmtx (Vertical MeTriX) table and dump it into stdout.
#
# NOTE: source format is *NOT* compatible with disp_hmtx.
#
#	2002/2/6, by 1@2ch
#	* public domain *
#

$p=$0; $p=~s:[^/]+$::; push(@INC,$p);
require 'lib_util.pl';

sub usage {
    print "usage: make_vmtx BDF ppem unitem\n";
    exit 1;
}

3 <= @ARGV || usage();
($f, $pixels, $unitem) = @ARGV;

wopen('&STDOUT');
open(IN, $f) || die("open: $f: $!");
while($_ = getline(IN)) {
    if (/^BBX\s*\d+\s*(\d+)\s*\d+/) {
	wuint16(int($unitem * $1 / $pixels));
	wsint16(0);
    }
}
wclose();