sl@0: # sl@0: # Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: # All rights reserved. sl@0: # This component and the accompanying materials are made available sl@0: # under the terms of "Eclipse Public License v1.0" sl@0: # which accompanies this distribution, and is available sl@0: # at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: # sl@0: # Initial Contributors: sl@0: # Nokia Corporation - initial contribution. sl@0: # sl@0: # Contributors: sl@0: # sl@0: # Description: sl@0: # Build font files sl@0: # sl@0: sl@0: use Cwd; sl@0: use File::Path; sl@0: sl@0: $dir = getcwd(); sl@0: chdir ".."; sl@0: $parentdir = getcwd(); sl@0: sl@0: $bitmapdatadir="/bitmap/fntfiles"; sl@0: $bitmapdatadir = $parentdir . $bitmapdatadir; sl@0: sl@0: if (-e "$bitmapdatadir") sl@0: { sl@0: #proceed with your code sl@0: } sl@0: else sl@0: { sl@0: eval { mkpath($bitmapdatadir) }; sl@0: if ($@) { sl@0: print "Couldn't create $dir: $@"; sl@0: } sl@0: } sl@0: sl@0: system("fnttran bitmap/squashed.bdf bitmap/calc35.bdf bitmap/calc13.bdf bitmap/calc18.bdf bitmap/calcinv.bdf bitmap/digit35.bdf bitmap/agnsym11.bdf bitmap/agnsym16.bdf bitmap/eiksym15.bdf bitmap/base.gd $bitmapdatadir/eon14.gdr"); sl@0: sl@0: #Use binarycopy procedure defined below to copy the files instead if copy command. sl@0: sub binaryCopy sl@0: { sl@0: $numOfParams = @_; sl@0: my $buffer; sl@0: sl@0: open OUTF, ">$_[$numOfParams-1]" or die "\nCan't open $_[$numOfParams-1] for writing: $!\n"; sl@0: binmode OUTF; sl@0: sl@0: for($i=0;$i<$numOfParams-1;$i++) sl@0: { sl@0: open INF, $_[$i] or die "\nCan't open $_[$i] for reading: $!\n"; sl@0: binmode INF; sl@0: while ( sl@0: read (INF, $buffer, 65536) # read in (up to) 64k chunks, write sl@0: and print OUTF $buffer # exit if read or write fails sl@0: ) {}; sl@0: die "Problem copying: $!\n" if $!; sl@0: close INF or die "Can't close $_[$i]: $!\n"; sl@0: } sl@0: close OUTF or die "Can't close $_[$numOfParams-1]: $!\n"; sl@0: }