head	1.3;
access;
symbols
	INIT:1.1.1.1 VENDOR:1.1.1;
locks; strict;
comment	@# @;


1.3
date	2011.06.05.10.25.42;	author wkpark;	state Exp;
branches;
next	1.2;

1.2
date	2008.07.02.11.51.23;	author wkpark;	state Exp;
branches;
next	1.1;

1.1
date	2004.08.10.16.05.55;	author wkpark;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2004.08.10.16.05.55;	author wkpark;	state Exp;
branches;
next	;


desc
@@


1.3
log
@[#316158]
 * fixed for the newest fontforge.
 * increse the offset of internal compsite jamos from 60000 to 80000
@
text
@#!/usr/bin/perl
# merge all jamo sfd fonts

#$numglyph=67137;
$numglyph=65537;

$DESC="This is the HLaTeX fonts made by Koaunghi Un. It originally used on the HLaTeX only. It contains all Hangul Syllables defined in the Unicode. It is converted to TrueType fonts with the FontForge";

$GPLSITE="http://korea.gnu.org/copyleft/gpl.ko.html";

$filename=$ARGV[0];
$FONTNAME=$ARGV[1];

$FULLNAME=$FONTNAME;
$FULLNAME=~ s/([a-z]{1})([A-Z]{1})/$1 $2/g;

$FAMILY=$FONTNAME;
$FAMILY=~ s/Bold//;
$FAMILY=~ s/Light//;

$WEIGHT="Regular";
$TTFWEIGHT=400;

$_=$FONTNAME;
$PSFONTNAME=$FONTNAME;
$PAN_WEIGHT= "6";
if ($FONTNAME=~ /Bold|Yet|Bom/) {
  $WEIGHT= "Bold";
  $PAN_WEIGHT= "8";
  $TTFWEIGHT=700;
  $PSFONTNAME=~ s/Bold/-Bold/;
} elsif ($FONTNAME=~ /Light/) {
  $WEIGHT= "Light";
  $TTFWEIGHT=300;
}

$PFM_FAMILY=33; # sans-serif
$PAN_FAMILY=2;
$STYLE=11;
$MONO=0;
if ($FONTNAME =~ /(Batang|Shinmun)/) {
  $PFM_FAMILY=17; # serif
  $PAN_FAMILY=4;
  $STYLE=11;
  #$PFM_FAMILY=49; # monospace
  #$PFM_FAMILY=65; # script
  #$PFM_FAMILY=81; # decorative
} elsif ($FONTNAME =~ /(Pen|Pilgi|Pilgia|Gungseo)/) {
  $STYLE=11;
  $PFM_FAMILY=65; # script
  $PAN_FAMILY=3;
} elsif ($FONTNAME =~ /(Yet|Graphic|Sora|Novel|Vada|Bom)/) {
  $PFM_FAMILY=81; # decorative
  $PAN_FAMILY=4;
  $STYLE=11;
} elsif ($FONTNAME =~ /(Taza)/) {
  $PFM_FAMILY=49; # monospace
  $PAN_FAMILY=4;
  $STYLE=11;
  $MONO=9;
}

print <<EOF;
SplineFontDB: 1.0
FontName: $FONTNAME
FullName: $FULLNAME
FamilyName: $FAMILY
Weight: $WEIGHT
TTFWeight: $TTFWEIGHT
TTFWidth: 5
Panose: $PAN_FAMILY $STYLE $PAN_WEIGHT $MONO 0 1 1 1 1 1
PfmFamily: $PFM_FAMILY
FSType: 12
LangName: 1033 "Copyright  1998-2004 by Koaunghi Un" "" "" "" "$FULLNAME" "Version 1.00" "$PSFONTNAME" "GNU is Not Unix" "Korean Tex Users Group" "Koaunghi Un" "$DESC" "http://www.ktug.or.kr" "http://www.ktug.or.kr" "GNU Public License" "$GPLSITE" "" "" "" "" "GNU is Not Unix"
LangName: 1042 "Copyright  1998-2004 by Koaunghi Un" "" "" "" "$FULLNAME" "Version 1.00" "$PSFONTNAME" "GNU is Not Unix" "Korean Tex Users Group" "Koaunghi Un" "$DESC" "http://www.ktug.or.kr" "http://www.ktug.or.kr" "GNU Public License" "$GPLSITE" "" "" "" "" "GNU is Not Unix"
WinInfo: 64 16 4
ItalicAngle: 0
UnderlinePosition: -200
UnderlineWidth: 50
Ascent: 800
Descent: 200
Encoding: unicode
DisplaySize: -24
AntiAlias: 1
BeginChars: $numglyph $numglyph
StartChar: .notdef
Encoding: 0 -1
Width: 1000
Flags: W
Fore 
166 666 m 25
 166 -75 l 25
 860 -75 l 25
 860 666 l 25
 166 666 l 25
96 732 m 1
 930 732 l 1
 930 -138 l 1
 96 -138 l 1
 96 732 l 1
EndSplineSet
EndChar
StartChar: uni0000
Encoding: 1 0
Width: 0
Flags: W
EndChar
StartChar: uni000D
Encoding: 13 13
Width: 0
Flags: W
EndChar
EOF

#@@list=('00','01','02','03','04','05')
@@list=split(/\s+/,`ls ${filename}1?`);
#@@list=('10','11','12','13','14','15','16','17');
#@@list=('20','21','22','23','24','25','26','27','28','29','30',
#'31','32','33','34','35','36','37','38');

#$enc=65535; # PUA start
$enc=80000;
$idx=0;
for $X (@@list) {
   @@map=split(/\s+/,$fontmap{$X});
   #print STDERR $fontmap{$X},"\n";
   #$fn=sprintf $filename,$X;
   open(SFD,$X) or die "can't open a sfd";
   $i=0;
   while(<SFD>) {
      if (/^StartChar: \.notdef/) { $char=0;}
      elsif (/^StartChar: /) { $char=1; printf "StartChar: jamo%04d\n",$idx++;}
      elsif ($char && /^EndChar/) { $char=0; print;}
      elsif ($char && /^Encoding: (\d+)\s/) {
         if ($1 > 255) {
            $char=0;
            next;
         }
         #$enc= hex $enc;
         #print "Encoding: ",$enc," ",$enc," ",$map[$i],"\n";
         #print "Encoding: -1 ",$enc,"\n";
         print "Encoding: ",($1 + $enc)," -1\n";
         #print "Encoding: ",$enc," ",$enc,"\n";
      }
      elsif (/^(Ligature:|EndChars|EndSplineFont)/) {}
#      elsif (/^(HStem:|VStem:)/) {}
      elsif ($char) { print $_;}
   }
   $enc+=256;
   close(SFD);
}

print "EndChars\nEndSplineFont\n";
@


1.2
log
@update scripts
@
text
@d122 1
a122 1
$enc=60000; # PUA start
@


1.1
log
@Initial revision
@
text
@d19 1
d32 3
d40 1
d48 1
a48 1
} elsif ($FONTNAME =~ /(Pen|Pilgi|Gungseo)/) {
d52 1
a52 1
} elsif ($FONTNAME =~ /(Yet|Graphic|Sora|Novel|Bom)/) {
d56 5
d71 1
a71 1
Panose: $PAN_FAMILY $STYLE $PAN_WEIGHT 0 0 1 1 1 1 1
d78 1
a78 1
UnderlinePosition: -100
d108 1
a108 1
StartChar: uni000d
d134 5
a138 1
      elsif ($char && /^Encoding: /) {
d142 1
a142 1
         print "Encoding: ",$enc," -1\n";
a143 1
         $enc++;
d149 1
@


1.1.1.1
log
@Import
@
text
@@
