os/textandloc/fontservices/referencefonts/group/fonts2.pl
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 #
     2 # Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 # All rights reserved.
     4 # This component and the accompanying materials are made available
     5 # under the terms of "Eclipse Public License v1.0"
     6 # which accompanies this distribution, and is available
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 #
     9 # Initial Contributors:
    10 # Nokia Corporation - initial contribution.
    11 #
    12 # Contributors:
    13 #
    14 # Description: 
    15 # Build font files
    16 #
    17 
    18 use Cwd;
    19 use File::Path;
    20 
    21 $dir = getcwd();
    22 chdir "..";
    23 $parentdir = getcwd();
    24 
    25 $bitmapdatadir="/bitmap/fntfiles";
    26 $bitmapdatadir = $parentdir . $bitmapdatadir;
    27 
    28 if (-e "$bitmapdatadir")
    29 { 
    30   #proceed with your code
    31 }
    32 else
    33 {
    34 	eval { mkpath($bitmapdatadir) };
    35 	if ($@) {
    36 	    print "Couldn't create $dir: $@";
    37   	} 
    38 }
    39 
    40 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");
    41 
    42 #Use binarycopy procedure defined below to copy the files instead if copy command.
    43 sub binaryCopy
    44 {
    45 	$numOfParams = @_;
    46 	my $buffer;
    47 	
    48 	open OUTF, ">$_[$numOfParams-1]" or die "\nCan't open $_[$numOfParams-1] for writing: $!\n";
    49 	binmode OUTF;
    50 
    51 	for($i=0;$i<$numOfParams-1;$i++)
    52 	{
    53 		open INF, $_[$i] or die "\nCan't open $_[$i] for reading: $!\n";	
    54 		binmode INF;
    55 		while	(
    56 			read (INF, $buffer, 65536)	# read in (up to) 64k chunks, write
    57 			and print OUTF $buffer	# exit if read or write fails
    58 			) {};
    59 			die "Problem copying: $!\n" if $!;
    60 			close INF or die "Can't close $_[$i]: $!\n";
    61 	}
    62 	close OUTF or die "Can't close $_[$numOfParams-1]: $!\n";
    63 }