From 2961ba950392b3159af02a48881ba8d21c2262bc Mon Sep 17 00:00:00 2001 From: imiyazaki Date: Thu, 23 Mar 2006 04:17:48 +0000 Subject: [PATCH] guess where makefonts.pl and omegadb exist. --- chise2otf/u8j2otfk | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/chise2otf/u8j2otfk b/chise2otf/u8j2otfk index 2a1a7e3..ca6b20c 100755 --- a/chise2otf/u8j2otfk +++ b/chise2otf/u8j2otfk @@ -3,7 +3,8 @@ use strict; use vars qw(%AJ15 $idsdata_file $ids_start $font_start - $idc_regex $makefonts %ids + $idc_regex %ids + $omegadb_path $makefonts $u8j2otfk_dir $opt_kage $opt_ring $opt_comma $opt_period $opt_latin @@ -15,6 +16,35 @@ use utf8; use Encode; require 5.008; +$omegadb_path=""; # Check the path of omegadb, if needed. +$makefonts=""; # Check the path of makefonts.pl script, if needed. + +unless($omegadb_path){ + if(-w '/usr/local/share/chise/omega'){ + $omegadb_path='/usr/local/share/chise/omega'; + }elsif(-w '/usr/share/chise/omega'){ + $omegadb_path='/usr/share/chise/omega'; + }elsif(-w '/sw/share/chise/omega'){ + $omegadb_path='/sw/share/chise/omega'; + }elsif(-w '/usr/local/lib/chise/omega'){ + $omegadb_path='/usr/local/lib/chise/omega'; + }else{ + $omegadb_path="."; + } +} +$omegadb_path=~s!/$!!; + +$u8j2otfk_dir=""; +($u8j2otfk_dir=$0)=~s!^(.*)/.*$!$1!; + +unless($makefonts){ + if(-e "$u8j2otfk_dir/makefonts"){ + $makefonts="$u8j2otfk_dir/makefonts"; + }elsif(-e "/usr/local/share/texmf/omega/ocp/chise_rqd/chise/makefonts.pl"){ + $makefonts="/usr/local/share/texmf/omega/ocp/chise_rqd/chise/makefonts.pl"; + } +} + binmode(STDOUT,":encoding(euc-jp)"); &GetOptions("kage",\$opt_kage, @@ -54,8 +84,7 @@ if($opt_ring){ $AJ15{ṝ}='{\ifmmode \ucirc{\bar{r}}\else \ucirc{\={r}}\fi}'; } -$idsdata_file="/sw/share/chise/omega/idsdata.txt"; -$makefonts="/usr/local/share/texmf/omega/ocp/chise_rqd/chise/makefonts.pl"; +$idsdata_file="$omegadb_path/idsdata.txt"; $ids_start=0x00; $font_start=0; $idc_regex="\x{2ff0}-\x{2fff}"; -- 1.7.10.4