type1 (из cp1251 в koi8-r) (rus X font type1 convert script)
Ключевые слова: rus, X, font, type1, convert, script, (найти похожие документы)
_ RU.LINUX (2:5077/15.22) ___________________________________________ RU.LINUX _
From : Boris Tobotras 2:5020/510 09 Apr 99 08:52:40
Subj : type1 (из cp1251 в koi8-r)
________________________________________________________________________________
>>>>> "Alexander" == Alexander V Sulima writes:
Alexander> Hi! Есть кучтка type1 фонтов для, извините, виндов. И хочется
Alexander> их попереконвертить в koi8-r. Смутно припоминаю, что была такая
Alexander> утилита, кинулся поискать и не нашел. Может выручит кто ? А
Alexander> может есть и другой путь, более правильный ?
t1utils плюс вот такой скрипт имени Лелика Корчагина:
#!/usr/bin/perl
my %srccodes =
(
'', 0,
'', 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,
'space', 32,
'exclam', 33,
'quotedbl', 34,
'numbersign', 35,
'dollar', 36,
'percent', 37,
'ampersand', 38,
'quotesingle', 39,
'parenleft', 40,
'parenright', 41,
'asterisk', 42,
'plus', 43,
'comma', 44,
'hyphenminus', 45,
'period', 46,
'slash', 47,
'zero', 48,
'one', 49,
'two', 50,
'three', 51,
'four', 52,
'five', 53,
'six', 54,
'seven', 55,
'eight', 56,
'nine', 57,
'colon', 58,
'semicolon', 59,
'less', 60,
'equal', 61,
'greater', 62,
'question', 63,
'at', 64,
'A', 65,
'B', 66,
'C', 67,
'D', 68,
'E', 69,
'F', 70,
'G', 71,
'H', 72,
'I', 73,
'J', 74,
'K', 75,
'L', 76,
'M', 77,
'N', 78,
'O', 79,
'P', 80,
'Q', 81,
'R', 82,
'S', 83,
'T', 84,
'U', 85,
'V', 86,
'W', 87,
'X', 88,
'Y', 89,
'Z', 90,
'bracketleft', 91,
'backslash', 92,
'bracketright', 93,
'asciicircum', 94,
'underscore', 95,
'grave', 96,
'a', 97,
'b', 98,
'c', 99,
'd', 100,
'e', 101,
'f', 102,
'g', 103,
'h', 104,
'i', 105,
'j', 106,
'k', 107,
'l', 108,
'm', 109,
'n', 110,
'o', 111,
'p', 112,
'q', 113,
'r', 114,
's', 115,
't', 116,
'u', 117,
'v', 118,
'w', 119,
'x', 120,
'y', 121,
'z', 122,
'braceleft', 123,
'bar', 124,
'braceright', 125,
'asciitilde', 126,
'', 127,
'afii10051', 128,
'afii10052', 129,
'quotesinglbase', 130,
'afii10100', 131,
'quotedblbase', 132,
'ellipsis', 133,
'dagger', 134,
'daggerdbl', 135,
'circumflex', 136,
'perthousand', 137,
'afii10058', 138,
'quilsinglleft', 139,
'afii10059', 140,
'afii10061', 141,
'afii10060', 142,
'afii10145', 143,
'afii10099', 144,
'quoteleft', 145,
'quoteright', 146,
'quotedblleft', 147,
'quotedblright', 148,
'bullet', 149,
'endash', 150,
'emdash', 151,
'tilde', 152,
'trademark', 153,
'afii10106', 154,
'quilsinglright', 155,
'afii10107', 156,
'afii10109', 157,
'afii10108', 158,
'afii10193', 159,
'', 160,
'afii10062', 161,
'afii10110', 162,
'afii10057', 163,
'currency', 164,
'afii10050', 165,
'brokenbar', 166,
'section', 167,
'afii10023', 168,
'copyright', 169,
'afii10053', 170,
'guillemotleft', 171,
'logicalnot', 172,
'hyphen', 173,
'registered', 174,
'afii10056', 175,
'degree', 176,
'plusminus', 177,
'afii10055', 178,
'afii10103', 179,
'afii10098', 180,
'mu', 181,
'paragraph', 182,
'periodcentered', 183,
'afii10071', 184,
'numero', 185,
'afii10101', 186,
'guillemotright', 187,
'afii10105', 188,
'afii10054', 189,
'afii10102', 190,
'afii10104', 191,
'afii10096', 192,
'afii10065', 193,
'afii10066', 194,
'afii10088', 195,
'afii10069', 196,
'afii10070', 197,
'afii10086', 198,
'afii10068', 199,
'afii10087', 200,
'afii10074', 201,
'afii10075', 202,
'afii10076', 203,
'afii10077', 204,
'afii10078', 205,
'afii10079', 206,
'afii10080', 207,
'afii10081', 208,
'afii10097', 209,
'afii10082', 210,
'afii10083', 211,
'afii10084', 212,
'afii10085', 213,
'afii10072', 214,
'afii10067', 215,
'afii10094', 216,
'afii10093', 217,
'afii10073', 218,
'afii10090', 219,
'afii10095', 220,
'afii10091', 221,
'afii10089', 222,
'afii10092', 223,
'afii10048', 224,
'afii10017', 225,
'afii10018', 226,
'afii10040', 227,
'afii10021', 228,
'afii10022', 229,
'afii10038', 230,
'afii10020', 231,
'afii10039', 232,
'afii10026', 233,
'afii10027', 234,
'afii10028', 235,
'afii10029', 236,
'afii10030', 237,
'afii10031', 238,
'afii10032', 239,
'afii10033', 240,
'afii10049', 241,
'afii10034', 242,
'afii10035', 243,
'afii10036', 244,
'afii10037', 245,
'afii10024', 246,
'afii10019', 247,
'afii10046', 248,
'afii10045', 249,
'afii10025', 250,
'afii10042', 251,
'afii10047', 252,
'afii10043', 253,
'afii10041', 254,
'afii10044', 255
);
my @isonames =
(
'', # 0
'', # 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
'space', # 32
'exclam', # 33
'quotedbl', # 34
'numbersign', # 35
'dollar', # 36
'percent', # 37
'ampersand', # 38
'quoteright', # 39
'parenleft', # 40
'parenright', # 41
'asterisk', # 42
'plus', # 43
'comma', # 44
'minus', # 45
'period', # 46
'slash', # 47
'zero', # 48
'one', # 49
'two', # 50
'three', # 51
'four', # 52
'five', # 53
'six', # 54
'seven', # 55
'eight', # 56
'nine', # 57
'colon', # 58
'semicolon', # 59
'less', # 60
'equal', # 61
'greater', # 62
'question', # 63
'at', # 64
'A', # 65
'B', # 66
'C', # 67
'D', # 68
'E', # 69
'F', # 70
'G', # 71
'H', # 72
'I', # 73
'J', # 74
'K', # 75
'L', # 76
'M', # 77
'N', # 78
'O', # 79
'P', # 80
'Q', # 81
'R', # 82
'S', # 83
'T', # 84
'U', # 85
'V', # 86
'W', # 87
'X', # 88
'Y', # 89
'Z', # 90
'bracketleft', # 91
'backslash', # 92
'bracketright', # 93
'asciicircum', # 94
'underscore', # 95
'quoteleft', # 96
'a', # 97
'b', # 98
'c', # 99
'd', # 100
'e', # 101
'f', # 102
* Message split, to be continued *
--- Gnus v5.5/XEmacs 20.3 - "London"
* Origin: Linux inside (2:5020/510@fidonet)
_ RU.LINUX (2:5077/15.22) ___________________________________________ RU.LINUX _
From : Boris Tobotras 2:5020/510 09 Apr 99 08:52:40
Subj : [part 2] Re: type1
________________________________________________________________________________
* Continuation 1 of a split message *
'g', # 103
'h', # 104
'i', # 105
'j', # 106
'k', # 107
'l', # 108
'm', # 109
'n', # 110
'o', # 111
'p', # 112
'q', # 113
'r', # 114
's', # 115
't', # 116
'u', # 117
'v', # 118
'w', # 119
'x', # 120
'y', # 121
'z', # 122
'braceleft', # 123
'bar', # 124
'braceright', # 125
'asciitilde', # 126
'', # 127
'chr128', # 128
'chr129', # 129
'chr130', # 130
'chr131', # 131
'quotedblbase', # 132
'chr133', # 133
'dagger', # 134
'daggerdbl', # 135
'circumflex', # 136
'chr137', # 137
'chr138', # 138
'chr139', # 139
'chr140', # 140
'chr141', # 141
'chr142', # 142
'chr143', # 143
'chr144', # 144
'quoteleft', # 145
'quoteright', # 146
'quotedblleft', # 147
'quotedblright', # 148
'chr149', # 149
'endash', # 150
'emdash', # 151
'tilde', # 152
'chr153', # 153
'chr154', # 154
'chr155', # 155
'chr156', # 156
'chr157', # 157
'chr158', # 158
'chr159', # 159
'', # 160
'chr161', # 161
'chr162', # 162
'chr163', # 163
'currency', # 164
'chr165', # 165
'brokenbar', # 166
'section', # 167
'dieresis', # 168
'copyright', # 169
'chr170', # 170
'guillemotleft', # 171
'logicalnot', # 172
'hyphen', # 173
'registered', # 174
'chr175', # 175
'degree', # 176
'plusminus', # 177
'chr178', # 178
'chr179', # 179
'chr180', # 180
'mu', # 181
'paragraph', # 182
'periodcentered', # 183
'cedilla', # 184
'chr185', # 185
'chr186', # 186
'guillemotright', # 187
'chr188', # 188
'chr189', # 189
'chr190', # 190
'chr191', # 191
'Agrave', # 192
'Aacute', # 193
'Acircumflex', # 194
'Atilde', # 195
'Adieresis', # 196
'Aring', # 197
'AE', # 198
'Ccedilla', # 199
'Egrave', # 200
'Eacute', # 201
'Ecircumflex', # 202
'Edieresis', # 203
'Igrave', # 204
'Iacute', # 205
'Icircumflex', # 206
'Idieresis', # 207
'Eth', # 208
'Ntilde', # 209
'Ograve', # 210
'Oacute', # 211
'Ocircumflex', # 212
'Otilde', # 213
'Odieresis', # 214
'multiply', # 215
'Oslash', # 216
'Ugrave', # 217
'Uacute', # 218
'Ucircumflex', # 219
'Udieresis', # 220
'Yacute', # 221
'Thorn', # 222
'germandbls', # 223
'agrave', # 224
'aacute', # 225
'acircumflex', # 226
'atilde', # 227
'adieresis', # 228
'aring', # 229
'ae', # 230
'ccedilla', # 231
'egrave', # 232
'eacute', # 233
'ecircumflex', # 234
'edieresis', # 235
'igrave', # 236
'iacute', # 237
'icircumflex', # 238
'idieresis', # 239
'eth', # 240
'ntilde', # 241
'ograve', # 242
'oacute', # 243
'ocircumflex', # 244
'otilde', # 245
'odieresis', # 246
'divide', # 247
'oslash', # 248
'ugrave', # 249
'uacute', # 250
'ucircumflex', # 251
'udieresis', # 252
'yacute', # 253
'thorn', # 254
'ydieresis' # 255
);
my @win2koi = (
0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007,
0010, 0011, 0012, 0013, 0014, 0015, 0016, 0017,
0020, 0021, 0022, 0023, 0024, 0025, 0026, 0027,
0030, 0031, 0032, 0033, 0034, 0035, 0036, 0037,
0040, 0041, 0042, 0043, 0044, 0045, 0046, 0047,
0050, 0051, 0052, 0053, 0054, 0055, 0056, 0057,
0060, 0061, 0062, 0063, 0064, 0065, 0066, 0067,
0070, 0071, 0072, 0073, 0074, 0075, 0076, 0077,
0100, 0101, 0102, 0103, 0104, 0105, 0106, 0107,
0110, 0111, 0112, 0113, 0114, 0115, 0116, 0117,
0120, 0121, 0122, 0123, 0124, 0125, 0126, 0127,
0130, 0131, 0132, 0133, 0134, 0135, 0136, 0137,
0140, 0141, 0142, 0143, 0144, 0145, 0146, 0147,
0150, 0151, 0152, 0153, 0154, 0155, 0156, 0157,
0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167,
0170, 0171, 0172, 0173, 0174, 0175, 0176, 0177,
0200, 0201, 0202, 0203, 0204, 0205, 0206, 0207,
0210, 0211, 0212, 0213, 0214, 0215, 0216, 0217,
0220, 0221, 0222, 0223, 0224, 0225, 0226, 0227,
0230, 0231, 0232, 0233, 0234, 0235, 0236, 0237,
0240, 0241, 0242, 0245, 0243, 0250, 0263, 0251,
0252, 0264, 0253, 0254, 0255, 0256, 0257, 0267,
0260, 0261, 0262, 0266, 0246, 0265, 0270, 0271,
0244, 0272, 0273, 0274, 0275, 0276, 0247, 0277,
0341, 0342, 0367, 0347, 0344, 0345, 0366, 0372,
0351, 0352, 0353, 0354, 0355, 0356, 0357, 0360,
0362, 0363, 0364, 0365, 0346, 0350, 0343, 0376,
0373, 0375, 0377, 0371, 0370, 0374, 0340, 0361,
0301, 0302, 0327, 0307, 0304, 0305, 0326, 0332,
0311, 0312, 0313, 0314, 0315, 0316, 0317, 0320,
0322, 0323, 0324, 0325, 0306, 0310, 0303, 0336,
0333, 0335, 0337, 0331, 0330, 0334, 0300, 0321
);
sub convert
{
my $old = shift;
if ( $names{$old} ) {
$names{$old};
} else {
$old;
}
}
require 'getopts.pl';
Getopts( 'b' );
if ( opendir( D, "." ) ) {
foreach $file ( readdir( D ) ) {
if ( $file =~ /\.INF$/ ) {
( $group = $file ) =~ s/\.INF$//;
$fontname = `fromdos < $file | grep FontName`;
chop $fontname; $fontname =~ s/[^\(]+\(([^\)]+)\).*/$1/;
print $fontname, "\n";
if ( open( SRC, "t1disasm $group.PFB 2>/dev/null |" ) ) {
if ( defined $opt_b ) {
$b = '-b';
$ext = 'pfb';
} else {
$b = '';
$ext = 'pfa';
}
if ( open( DST, "| t1asm $b > $fontname.$ext 2>/dev/null" ) ) {
while ( <SRC> ) {
chop;
if ( /^dup\s+(\d+)\s+([^\s]+)\s+put/ ) {
if ( $1 >= 0xC0 ) {
$c = $win2koi[ $1 ];
} else {
$c = $1;
}
print DST "dup ", $c, " /", $isonames[ $c ], "
put\n";
} elsif ( /^\/([^\s]+)\s+\{\s*$/ ) {
print DST "/", $isonames[ $srccodes{ $1 } ], "
{\n";
} else {
print DST $_, "\n";
}
}
close DST;
}
close SRC;
}
if ( open( SRC, "fromdos < $group.AFM |" ) ) {
if ( open( DST, ">$fontname.afm" ) ) {
while ( <SRC> ) {
chop;
if (
/^\s*C\s+(\d+)\s*;\s*WX\s+(\d+)\s*;\s*N\s+([^\s]+)\s*;\s*B(.*)/ ) {
if ( $1 >= 0xC0 ) {
$c = $win2koi[ $1 ];
} else {
$c = $1;
}
$w = $2;
$n = $isonames[ $c ];
$b = $4;
print DST "C $c ; WX $w ; N $n ; B $b", "\n";
} elsif ( /^\s*KPX\s+([^\s]+)\s+([^\s]+)\s+(.*)/ ) {
print DST "KPX ", $isonames[ $srccodes{ $1 } ], "
", $isonames[ $srccodes{ $2 } ], " ", $3, "\n";
} else {
print DST $_, "\n";
}
}
close DST;
} else {
die $!;
}
close SRC;
} else {
die $!;
}
}
}
}
--
Best regards, -- Boris.
Much of the excitement we get out of our work is that we don't really
know what we are doing. -- E. Dijkstra
--- Gnus v5.5/XEmacs 20.3 - "London"
* Origin: Linux inside (2:5020/510@fidonet)