unifont-6.3.20131020.tar.gz
[unifont.git] / hangul / unifontchojung
1 #!/usr/bin/perl
2 #
3 # This script searches for Unicode code points in a Unifont .hex file
4 # that contain only initial consonant + vowel, with no final consonant.
5 # This allows concentrating on this combination during font development.
6 #
7 # Author: Paul Hardy, March 2012
8 #
9 # Copyright (C) 2012, 2013 Paul Hardy
10 #
11 # LICENSE:
12 #
13 #    This program is free software: you can redistribute it and/or modify
14 #    it under the terms of the GNU General Public License as published by
15 #    the Free Software Foundation, either version 2 of the License, or
16 #    (at your option) any later version.
17 #  
18 #    This program is distributed in the hope that it will be useful,
19 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
20 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
21 #    GNU General Public License for more details.
22 #  
23 #    You should have received a copy of the GNU General Public License
24 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
25 #
26
27 @chojung = (
28    'AC00:','AC1C:','AC38:','AC54:','AC70:','AC8C:','ACA8:','ACC4:',
29    'ACE0:','ACFC:','AD18:','AD34:','AD50:','AD6C:','AD88:','ADA4:',
30    'ADC0:','ADDC:','ADF8:','AE14:','AE30:','AE4C:','AE68:','AE84:',
31    'AEA0:','AEBC:','AED8:','AEF4:','AF10:','AF2C:','AF48:','AF64:',
32    'AF80:','AF9C:','AFB8:','AFD4:','AFF0:','B00C:','B028:','B044:',
33    'B060:','B07C:','B098:','B0B4:','B0D0:','B0EC:','B108:','B124:',
34    'B140:','B15C:','B178:','B194:','B1B0:','B1CC:','B1E8:','B204:',
35    'B220:','B23C:','B258:','B274:','B290:','B2AC:','B2C8:','B2E4:',
36    'B300:','B31C:','B338:','B354:','B370:','B38C:','B3A8:','B3C4:',
37    'B3E0:','B3FC:','B418:','B434:','B450:','B46C:','B488:','B4A4:',
38    'B4C0:','B4DC:','B4F8:','B514:','B530:','B54C:','B568:','B584:',
39    'B5A0:','B5BC:','B5D8:','B5F4:','B610:','B62C:','B648:','B664:',
40    'B680:','B69C:','B6B8:','B6D4:','B6F0:','B70C:','B728:','B744:',
41    'B760:','B77C:','B798:','B7B4:','B7D0:','B7EC:','B808:','B824:',
42    'B840:','B85C:','B878:','B894:','B8B0:','B8CC:','B8E8:','B904:',
43    'B920:','B93C:','B958:','B974:','B990:','B9AC:','B9C8:','B9E4:',
44    'BA00:','BA1C:','BA38:','BA54:','BA70:','BA8C:','BAA8:','BAC4:',
45    'BAE0:','BAFC:','BB18:','BB34:','BB50:','BB6C:','BB88:','BBA4:',
46    'BBC0:','BBDC:','BBF8:','BC14:','BC30:','BC4C:','BC68:','BC84:',
47    'BCA0:','BCBC:','BCD8:','BCF4:','BD10:','BD2C:','BD48:','BD64:',
48    'BD80:','BD9C:','BDB8:','BDD4:','BDF0:','BE0C:','BE28:','BE44:',
49    'BE60:','BE7C:','BE98:','BEB4:','BED0:','BEEC:','BF08:','BF24:',
50    'BF40:','BF5C:','BF78:','BF94:','BFB0:','BFCC:','BFE8:','C004:',
51    'C020:','C03C:','C058:','C074:','C090:','C0AC:','C0C8:','C0E4:',
52    'C100:','C11C:','C138:','C154:','C170:','C18C:','C1A8:','C1C4:',
53    'C1E0:','C1FC:','C218:','C234:','C250:','C26C:','C288:','C2A4:',
54    'C2C0:','C2DC:','C2F8:','C314:','C330:','C34C:','C368:','C384:',
55    'C3A0:','C3BC:','C3D8:','C3F4:','C410:','C42C:','C448:','C464:',
56    'C480:','C49C:','C4B8:','C4D4:','C4F0:','C50C:','C528:','C544:',
57    'C560:','C57C:','C598:','C5B4:','C5D0:','C5EC:','C608:','C624:',
58    'C640:','C65C:','C678:','C694:','C6B0:','C6CC:','C6E8:','C704:',
59    'C720:','C73C:','C758:','C774:','C790:','C7AC:','C7C8:','C7E4:',
60    'C800:','C81C:','C838:','C854:','C870:','C88C:','C8A8:','C8C4:',
61    'C8E0:','C8FC:','C918:','C934:','C950:','C96C:','C988:','C9A4:',
62    'C9C0:','C9DC:','C9F8:','CA14:','CA30:','CA4C:','CA68:','CA84:',
63    'CAA0:','CABC:','CAD8:','CAF4:','CB10:','CB2C:','CB48:','CB64:',
64    'CB80:','CB9C:','CBB8:','CBD4:','CBF0:','CC0C:','CC28:','CC44:',
65    'CC60:','CC7C:','CC98:','CCB4:','CCD0:','CCEC:','CD08:','CD24:',
66    'CD40:','CD5C:','CD78:','CD94:','CDB0:','CDCC:','CDE8:','CE04:',
67    'CE20:','CE3C:','CE58:','CE74:','CE90:','CEAC:','CEC8:','CEE4:',
68    'CF00:','CF1C:','CF38:','CF54:','CF70:','CF8C:','CFA8:','CFC4:',
69    'CFE0:','CFFC:','D018:','D034:','D050:','D06C:','D088:','D0A4:',
70    'D0C0:','D0DC:','D0F8:','D114:','D130:','D14C:','D168:','D184:',
71    'D1A0:','D1BC:','D1D8:','D1F4:','D210:','D22C:','D248:','D264:',
72    'D280:','D29C:','D2B8:','D2D4:','D2F0:','D30C:','D328:','D344:',
73    'D360:','D37C:','D398:','D3B4:','D3D0:','D3EC:','D408:','D424:',
74    'D440:','D45C:','D478:','D494:','D4B0:','D4CC:','D4E8:','D504:',
75    'D520:','D53C:','D558:','D574:','D590:','D5AC:','D5C8:','D5E4:',
76    'D600:','D61C:','D638:','D654:','D670:','D68C:','D6A8:','D6C4:',
77    'D6E0:','D6FC:','D718:','D734:','D750:','D76C:','D788:','D7A4:'
78    ); 
79
80
81 $nextchojung = shift(@chojung); # get first code point to find
82
83 while (<>) {
84    if (substr($nextchojung, 0, 5) eq substr($_, 0, 5)) {
85       print;  # this is one of the syllables we're seeking; print it
86       # Now get next Hangul Syllable to find; if no more, exit.
87       if ($#chojung < 0) {
88          exit;
89       }
90       else {
91          $nextchojung = shift(@chojung); # get next code point to find
92       }
93    }
94 }