groff: update vendor branch to v1.20.1
[dragonfly.git] / contrib / groff / font / util / make-Rproto
1 #! /bin/sh
2 #
3 # make-Rproto -- script for creating an R.proto file
4 #
5 # Copyright (C) 2006, 2009
6 # Free Software Foundation, Inc.
7 #      Written by Werner Lemberg <wl@gnu.org>
8 #
9 # This file is part of groff.
10 #
11 # groff is free software; you can redistribute it and/or modify it under
12 # the terms of the GNU General Public License as published by the Free
13 # Software Foundation, either version 3 of the License, or
14 # (at your option) any later version.
15 #
16 # groff is distributed in the hope that it will be useful, but WITHOUT ANY
17 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19 # for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23
24 #
25 # usage:
26 #
27 #   make-Rproto R.proto.in < uniuni.cpp > R.proto
28 #
29 # `R.proto.in' contains the device specific part of the R.proto file; it
30 # should end with a line containing the word `charset'.
31 #
32 # `uniuni.cpp' is located in directory `src/libs/libgroff'.
33
34 prog="$0"
35
36 if test $# -ne 1; then
37   echo "usage: $0 R.proto.in < uniuni.cpp > R.proto"
38   exit 1
39 fi
40
41 # Emit preamble.
42 cat "$1"
43
44 # Extract composite characters.
45 grep '^  { ".*", ".*_.*" },' \
46 | sed 's/  { "\(.*\)", ".\(.*\)" },/u\2 24      0       0x\1/'
47
48 # EOF