Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
my @ENCODING;
my @ID_LANG;
my %ID_Region;
BEGIN {
eval ("use Font::FreeType");
exitfunc(255, "libfont-freetype-perl is needed.") if ($@ ne '');
@ENCODING = qw(Symbol Unicode ShiftJIS GB2312 BIG5 WanSung Johab);
@ID_LANG =
qw(- Arabic Bulgarian Catalan Chinese Czech Danish German
Greek English Spanish Finnish French Hebrew Magyar Icelandic
Italian Japanese Korean Dutch Norwegian Polish Portuguese -
Romania Russian SerboCroatian Slovak Albanian Swedish Thai Turkish
? Indonesian Ukrainian Byelorussian Slovenian Estonian Latvian Lithuanian
- Persian Vietnamese Armenian Azerbaijan Basque - Macedonian
- - - - - - Afrikaans ?
? Hindi - - - - Malay Kazak
- Swahili - Uzbek TarTar Bengali Punjabi -
- Tamil - - - - - Sanskrit);
%ID_Region =
( 'Chinese' => 'Taiwan China HongKong Singapore Macau',
'SerboCroatian' => 'Croatian Serb.Roman Serb.Cyrillic',
'Azerbaijan' => 'Roman Cyrillic',
'Uzbek' => 'Roman Cyrillic',
);
}
sub get_standard_charset {
my $charset = shift;
my $i;
open(F, "$DEFOMA_TEST_DIR/etc/defoma/loc-cset.data") || return '';
while () {
my $line = $_;
chomp($line);
my @list = split(' ', $line);
next if (@list < 2);
$list[0] =~ s/\*/\.\*/g;
$list[0] =~ s/\?/\./g;
if ($charset =~ /^($list[0])$/) {
close F;
return $list[1];
}
}
close F;
return '';
}
sub freetype_init {
my $fontpath = shift;
my $facenum;
my $Face=Font::FreeType->new->face($fontpath);
$facenum=$Face->number_of_faces;
$facenum = 1 if ($facenum == 0);
return $facenum;
}
sub sethint_truetype {
my $font = shift;
my $fontfile = $font;
$fontfile =~ s/.*\///;
my $text;
my $facenum = freetype_init($font);
if ($facenum > 1) {
$text = < 1) ? "--FaceNum $facenum" : '';
for (my $j = 0; $j < $facenum; $j++) {
my $fname = ($facenum > 1) ? "$fontfile,face\#$j" : "$fontfile";
my $cnt;
my $Face=Font::FreeType->new->face($font, index => $j);
$cnt = 1; #One name
my %langs = ();
my @family_list = $Face->family_name;
my @subfamily_list = $Face->style_name;
my @psfontname_list = $Face->postscript_name;
my @encoding_list = ();
my @foundry_list = ();
$text = <', $text, @family_list,
'');
return if ($result != 0);
if (@subfamily_list > 1) {
$text = <',
"Choose $text.", @psfontname_list,
'');
return if ($result != 0);
my $foundry = '';
if (@foundry_list > 1) {
$foundry = input_menu_q("Input the Foundry of $fname manually.",
'', '[^ \t]', 1, '',
"Choose the Foundry of $fname.",
@foundry_list, '');
return if ($result != 0);
} elsif (@foundry_list == 1) {
$foundry = $foundry_list[0];
msgbox_q("Foundry of $fname is $foundry.");
} else {
$text = "No Foundry information is found in $fname.\n";
$text .= "Please input the Foundry manually.";
$foundry = input_menu_q($text, '', '[^ \t]', 1);
}
my $encoding;
if (@encoding_list > 1) {
$text = <> 11;
if ($lang_id > @ID_LANG || $ID_LANG[$lang_id] =~ /^[\?-]$/) {
$loc = sprintf("Unknown(0x%02x)", $lang_id);
} else {
$loc = $ID_LANG[$lang_id];
if (exists($ID_Region{"$loc"})) {
my @region = split(' ', $ID_Region{"$loc"});
$loc .= '-';
$loc .= $region[$region_id];
}
}
$location{$loc} = 1;
}
$text = <- or
* just format by this program.
EOF
;
my @list = keys(%location);
if (@list > 1) {
$loc = input_checklist_q('Modify the Locations if necessary.',
join(' ', @list), '.', 1, $text, @list);
return if ($result != 0);
} elsif (@list == 1) {
$loc = $list[0];
msgbox_q("Location of $fname is:\n $loc");
} else {
msgbox_q('No Language ID(used for Location hint) is found.');
$loc = '';
}
my %charset = ();
my $cset;
@list = split(' ', $loc);
foreach $i (@list) {
$cset = get_standard_charset($i);
if ($cset eq '') {
$text = <is_fixed_width) ? 'Fixed' : 'Variable';
my $shape = $slant;
$shape .= " $subfamily" if ($subfamily ne '');
$shape = input_shape($fname, $shape);
return if ($result != 0);
my $alias = input_alias($fname, '');
return if ($result != 0);
my $priority = input_priority($fname, 20);
return if ($result != 0);
my $m = ($j > 0) ? $j : '';
$hints .= " --Family$m $family --FontName$m $psfontname";
$hints .= " --Encoding$m $encoding";
$hints .= " --Location$m $loc" if ($loc =~ /\S/);
$hints .= " --Charset$m $cset" if ($cset =~ /\S/);
$hints .= " --GeneralFamily$m $generalfamily"
if ($generalfamily =~ /\S/);
$hints .= " --Weight$m $weight" if ($weight =~ /\S/);
$hints .= " --Width$m $width" if ($width =~ /\S/);
$hints .= " --Shape$m $shape" if ($shape =~ /\S/);
$hints .= " --Alias$m $alias" if ($alias =~ /\S/);
$hints .= " --Foundry$m $foundry" if ($foundry =~ /\S/);
$hints .= " --Priority$m $priority";
}
return $hints;
}
1;