--- a/gfxtools/Color/group/bld.inf Fri Apr 16 16:02:07 2010 +0300
+++ b/gfxtools/Color/group/bld.inf Mon May 03 13:28:15 2010 +0300
@@ -26,7 +26,7 @@
PRJ_MMPFILES
#if defined(TOOLS) || defined(CWTOOLS)
../group/Color.mmp
-gnumakefile ../group/convcolor.mk
+/* gnumakefile ../group/convcolor.mk */
#endif
// End of File
--- a/gfxtools/gditools/fontcomp/EFF.CPP Fri Apr 16 16:02:07 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,164 +0,0 @@
-/*
-* Copyright (c) 1997-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-#include "fontcomp.h"
-
-EffRead::EffRead(fstream& aFile,FontCompiler& aFontCompiler,Fxf* aFxf,short int* aMapSpace):
- FontRead(aFile,aFontCompiler,aFxf),
- iMapSpace(aMapSpace)
- {}
-
-int EffRead::ReadFont()
- {
- int count=0;
- int version=0;
- char* outbuffer[(MAX_CHAR_WID+7)>>3];
- int bitpos,len1,len2;
- int ReadSize,widToGo;
- int widthofi=0;
- int widthofM=0;
- FcmCharHead* pFxf;
- LetterTableData lettertabledata;
- LetterData letterdata;
- letterdata.blx = 0;
- letterdata.bly = 0;
- letterdata.rWid = 0;
- letterdata.rHgt = 0;
- int FileSize,FontNameOffs,VariousDataOffs,LetterOffs,LetterOffsBase,seekpos;
- unsigned short int* pDest;
- unsigned short int* pSrc;
- EffVariousData VariousData;
-
- char* inBuffer=new char[((MAX_CHAR_WID+7)>>3)*MAX_HEIGHT];
- if(!inBuffer) return(NoMemory);
- iInputFile.read((char*)&FileSize,4);
- iInputFile.read((char*)&FontNameOffs,4);
- iInputFile.read((char*)&VariousDataOffs,4);
- iInputFile.read((char*)&VariousDataOffs,4);
- iInputFile.read((char*)&LetterOffs,4);
- iInputFile.seekg(FontNameOffs);
-
- char tmpName[FONT_NAME_LEN+1];
- iInputFile.read(tmpName,FONT_NAME_LEN);
- tmpName[FONT_NAME_LEN]=0;
- strcpy(iFxf->name,tmpName);
- *(iFxf->typeface)=0;
-
- iInputFile.seekg(VariousDataOffs);
- iInputFile.read((char*)&VariousData,sizeof(VariousData));
- version=VariousData.version;
- if(version==0) version=1;
- if(version!=1 && version!=2) return(FileFormat);
- pFxf=new FcmCharHead[MAX_CHARS];
- for(count=0;count<sizeof(FcmCharHead)*MAX_CHARS;count++)
- ((char*)pFxf)[count]=0;
- int offset=0;
- int first=1;
- LetterOffsBase=LetterOffs;
- iFxf->descent= -VariousData.bly;
- iFxf->UlinePos= -VariousData.UnderLinePos-VariousData.UnderLineThickness;
- iFxf->UlineThickness=VariousData.UnderLineThickness;
- iFxf->nominal_ascent=(VariousData.Hgt/*+VariousData.LineSpacing*/)-iFxf->descent;
- iFxf->MaxChrWidth=0;
- iFxf->cell_height=VariousData.Hgt;
- for(unsigned int chNum=0;chNum<MAX_CHARS;chNum++)
- {
- if(iMapSpace)
- iInputFile.seekg((*(iMapSpace+chNum)<<2)+LetterOffsBase);
- else
- iInputFile.seekg(LetterOffs);
- iInputFile.read((char*)&lettertabledata,sizeof(LetterTableData));
- if(version==1)
- {
- lettertabledata.width>>=4;
- iInputFile.read((char*)&letterdata,sizeof(LetterData));
- LetterOffs+=sizeof(LetterData);
- }
- LetterOffs+=sizeof(LetterTableData);
- iFxf->chr[chNum]=0;
-// char 0 in EFF fonts have a garbage offset so ignore them.
-// if(letterdata.offset)
- if(lettertabledata.offset && chNum>0)
- {
- seekpos=LetterOffsBase+lettertabledata.offset;
- iInputFile.seekg(seekpos);
- if(version==2)
- iInputFile.read((char*)&letterdata,sizeof(LetterData));
- if(first)
- {
- iFxf->FirstChr=chNum;
- first=0;
- }
- iFxf->n_chars=chNum+1;
- iFxf->chr[chNum]=pFxf;
- pFxf->offset=offset;
- pFxf->xOffset=letterdata.blx;
- pFxf->yOffset=letterdata.rHgt+letterdata.bly;
- pFxf->width=letterdata.rWid;
- if(chNum=='i')
- widthofi=pFxf->width;
- if(chNum=='M')
- widthofM=pFxf->width;
- pFxf->ByteWid=((pFxf->width+15)>>3)&(~1);
- pFxf->height=letterdata.rHgt;
- pFxf->move=lettertabledata.width;
- int chWid=letterdata.rWid;
- if(chWid>iFxf->MaxChrWidth)
- iFxf->MaxChrWidth=chWid;
- ReadSize=(letterdata.rWid*letterdata.rHgt+7)>>3;
- iInputFile.read(inBuffer,ReadSize);
- bitpos=0;
- pSrc=(unsigned short int*)inBuffer;
- for(int i=0;i<letterdata.rHgt;i++)
- {
- pDest=(unsigned short int*)outbuffer;
- for(int j=0;j<pFxf->ByteWid;j+=2)
- {
- len1=16-bitpos;
- *pDest=(unsigned short int)((*pSrc)>>bitpos);
- widToGo=letterdata.rWid-(j<<3);
- if (len1>widToGo)
- {
- len1=widToGo;
- len2=0;
- }
- else
- {
- pSrc++;
- if ((len1+bitpos)>widToGo)
- len2=widToGo-len1;
- else
- len2=bitpos;
- if (len2)
- *pDest|= (*pSrc)<<(16-bitpos);
- }
- *pDest&=0xFFFF>>(16-len2-len1);
- bitpos=(bitpos+len1+len2)&0xF;
- pDest++;
- }
- memcpy(iFontCompiler->FontStore()+offset+pFxf->ByteWid*(letterdata.rHgt-i-1),outbuffer,pFxf->ByteWid);
- }
- offset+=pFxf->ByteWid*letterdata.rHgt;
- }
- pFxf++;
- }
- if(widthofi && widthofM)
- iFxf->iProportional=(widthofi!=widthofM);
- return(NoError);
- }
-
--- a/gfxtools/gditools/fontcomp/FONTCOMP.CPP Fri Apr 16 16:02:07 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,198 +0,0 @@
-/*
-* Copyright (c) 1997-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "fontcomp.h"
-
-FontCompiler::FontCompiler():
- iInputFile(),
- iOutputFile(),
- iFxf(NULL),
- iFontSpace(NULL),
- iWorkSpace(NULL),
- iMapSpace(NULL),
- iWorkSpaceSize(0),
- iHeaderDataLen(0),
- iHeaderData()
- {}
-
-int FontCompiler::Init(char* infile,char* outfile,char* mapfile)
- {
- if(mapfile)
- {
- iMapSpace=new short int[256];
- if(!iMapSpace) return(NoMemory);
-
-#ifdef __MSVCDOTNET__
- fstream tempfile(mapfile, ios::in | ios::binary);
-#else //!__MSVCDOTNET__
- fstream tempfile(mapfile, ios::in | ios::binary);
-#endif //__MSVCDOTNET__
-
- if(!tempfile.is_open())
- return(NoFile);
- tempfile.read((char*)iMapSpace,512);
- tempfile.close();
- }
- iOutputFile.open(outfile, ios::out);
-
-#ifdef __MSVCDOTNET__
- iInputFile.open(infile, ios::in | ios::binary);
-#else //!__MSVCDOTNET__
- iInputFile.open(infile, ios::in | ios::binary);
-#endif //__MSVCDOTNET__
-
- if(!(iOutputFile.is_open() && iInputFile.is_open()))
- return(NoFile);
- iFxf=new Fxf;
- if(!iFxf) return(NoMemory);
- iFxf->iBold=0;
- iFxf->iItalic=0;
- iFxf->iProportional=0;
- iFxf->iSerif=0;
- iFxf->iSymbol=0;
- iFxf->iUid=0;
- iFontSpace=new char[0x100000];
- if(!iFontSpace) return(NoMemory);
- return(NoError);
- }
-
-char* FontCompiler::FontStore() const
- {
- return(iFontSpace);
- }
-
-int FontCompiler::Read(FontType aInputType)
- {
- FontRead *read=NULL;
- switch(aInputType)
- {
- case EFontTypeFsc:
- read=new FscRead(iInputFile,*this,iFxf);
- break;
- case EFontTypeEff:
- read=new EffRead(iInputFile,*this,iFxf,iMapSpace);
- break;
- default:
- return(Parameter);
- }
- if(!read)
- return(NoMemory);
- int error=read->ReadFont();
- delete read;
- return(error);
- }
-
-void FontCompiler::RemoveBlankSpace()
- {
- int count=0;
- const int maxbytewidth=(MAX_CHAR_WID+15)>>3;
- unsigned char buf[maxbytewidth];
- unsigned char zbuf[maxbytewidth];
-
- for(count=0;count<maxbytewidth;count++)
- zbuf[count]=0;
- for(int chNum=iFxf->FirstChr;chNum<iFxf->n_chars;chNum++)
- {
- FcmCharHead *fChar=iFxf->chr[chNum];
- if(fChar)
- {
- int LastNonBlank=0;
- int TopCount=0;
- int MinLeftBlank=fChar->width;
- int MinRightBlank=0;
-
- // DEF102183: Graphics tools fail to build using MS VC8.
- int row;
- int x;
- for(row=0;row<fChar->height;)
- {
- memcpy(buf,iFontSpace+fChar->offset+fChar->ByteWid*row,fChar->ByteWid);
- unsigned char bit=1;
- unsigned char* pb=buf;
- for(x=0;x<MinLeftBlank;x++)
- {
- if ((*pb)&bit)
- {
- MinLeftBlank=x;
- break;
- }
- bit<<=1;
- if (bit==0)
- {
- bit=1;
- pb++;
- }
- }
- bit=(unsigned char)(1<<((fChar->width-1)%8));
- pb=&buf[((fChar->width-1)>>3)];
- for(x=fChar->width;x>MinRightBlank;x--)
- {
- if ((*pb)&bit)
- {
- MinRightBlank=x;
- break;
- }
- bit>>=1;
- if (bit==0)
- {
- bit= (unsigned char)0x80;
- pb--;
- }
- }
- row++;
- if(memcmp(zbuf,buf,fChar->ByteWid))
- {
- if (TopCount==0)
- TopCount=row; /* Count of blank rows at the top */
- LastNonBlank=row;
- }
- }
- if (TopCount==0)
- {
- fChar->height=0;
- fChar->width=0;
- fChar->xOffset=0;
- fChar->yOffset=0;
- }
- else
- {
- TopCount--;
- fChar->height=LastNonBlank-TopCount;
- fChar->width=MinRightBlank-MinLeftBlank;
- fChar->yOffset-=TopCount;
- fChar->offset+=TopCount*fChar->ByteWid;
- fChar->xOffset+=MinLeftBlank;
- if (MinLeftBlank)
- {
- int byte_step=MinLeftBlank/8;
- int bit_shift=MinLeftBlank%8;
- unsigned char mask=(unsigned char)(0xFF>>(7-((fChar->width-1)%8)));
- for(row=0;row<fChar->height;row++)
- {
- memcpy(buf,iFontSpace+fChar->offset+fChar->ByteWid*row,fChar->ByteWid);
- for(x=0;x<(fChar->ByteWid-byte_step);x++)
- buf[x]=(unsigned char)((buf[x+byte_step]>>bit_shift)+
- (buf[x+byte_step+1]<<(8-bit_shift)));
- buf[x-1]&=mask;
- memcpy(iFontSpace+fChar->offset+fChar->ByteWid*row,buf,fChar->ByteWid);
- }
- }
- }
- }
- }
- }
-
--- a/gfxtools/gditools/fontcomp/FONTCOMP.H Fri Apr 16 16:02:07 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,241 +0,0 @@
-/*
-* Copyright (c) 1997-2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-#if !defined(__FONTCOMP_H__)
-#define __FONTCOMP_H__
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#ifdef __MSVCDOTNET__
-#include <fstream>
-#include <iostream>
-using namespace std;
-#else //!__MSVCDOTNET__
-#include <fstream.h>
-#endif //__MSVCDOTNET__
-
-/**
-@internalComponent
-*/
-#define MAX_CHARS 256
-#define FONT_NAME_LEN 16
-/**
-@internalComponent
-*/
-#define MAX_CHAR_WID 256
-#define MAX_HEIGHT 256
-#define MAX_LABEL_LENGTH 16 /* Max font label name */
-#define MAX_LEN_IN 255 /* Max input line length */
-#define MAXLINE 600 /* Max line length for writing to screen */
-#define FONT_MAX_HEADER_LEN 128
-#define P_FNAMESIZE 128 /* Maximum file name size */
-/**
-@internalComponent
-*/
-enum Errors
- {
- NoError=0,
- NoMemory=-1,
- NoFile=-2,
- FileRead=-3,
- FileWrite=-4,
- FileFormat=-5,
- Parameter=-6
- };
-/**
-@internalComponent
-*/
-struct FcmCharHead
- {
- int xOffset;
- int yOffset;
- int width;
- int height;
- int move;
- int ByteWid;
- int offset;
- };
-/**
-@internalComponent
-*/
-struct LetterTableData
- {
- short int offset;
- short int width; /* x16 in version 1*/
- };
-/**
-@internalComponent
-*/
-struct LetterData
- {
- char blx;
- char bly;
- unsigned char rWid; /* Enclosing rectangle width */
- unsigned char rHgt; /* Enclosing rectangle height */
- };
-/**
-@internalComponent
-*/
-struct EffVariousData
- {
- short int version;
- short int blx;
- short int bly;
- short int Wid;
- short int Hgt;
- short int xSize; /* 16 x Point size */
- short int xRes; /* DPI */
- short int ySize;
- short int yRes;
- unsigned char XHeight;
- unsigned char CapHeight;
- unsigned char Ascender;
- char Descender;
- unsigned char LineSpacing;
- char UnderLinePos;
- unsigned char UnderLineThickness;
- unsigned char filler[7];
- };
-/**
-@internalComponent
-*/
-const int EMaxFontNameLength=256;
-
-class Fxf
-/**
-@internalComponent
-*/
- {
-public:
- FcmCharHead *chr[MAX_CHARS];
- char name[EMaxFontNameLength]; /* Font name */
- char typeface[EMaxFontNameLength]; /* Font typeface */
- int MaxChrWidth;
- int cell_height; /* Height of character set */
- int nominal_ascent; /* Max ascent of normal (ASCII) characters */
- int descent; /* Descent of characters below base line */
- int chr_seg;
- int FirstChr;
- int n_chars; /* counts total number of characters defined */
- unsigned int max_info_width; /* Max char width to put in info file */
- unsigned short int flags;
- unsigned short int special;
- unsigned int ByteWid;
- int UseWords;
- int UlinePos;
- int UlineThickness;
- int iBold;
- int iItalic;
- int iProportional;
- int iSerif;
- int iSymbol;
- unsigned int iUid;
- };
-/**
-@internalComponent
-*/
-enum FontType
- {
- EFontTypeFsc,
- EFontTypeEff
- };
-
-class FontCompiler
-/**
-@internalComponent
-*/
- {
-public:
- FontCompiler();
- int Read(FontType aInputType);
- int Init(char*,char*,char*);
- void RemoveBlankSpace();
- char* FontStore() const;
- virtual int WriteFont()=0;
-protected: // general information
- fstream iInputFile;
- fstream iOutputFile;
- Fxf* iFxf;
-protected: // font information
- char* iFontSpace;
- char* iWorkSpace; // misc. stuff
- short int* iMapSpace;
- int iWorkSpaceSize;
- unsigned int iHeaderDataLen;
- unsigned char iHeaderData[FONT_MAX_HEADER_LEN];
- };
-
-class FontRead
-/**
-@internalComponent
-*/
- {
-public:
- FontRead(fstream& aFile,FontCompiler& aFontCompiler,Fxf* aFxf);
- virtual int ReadFont()=0;
-private:
- FontRead& operator=(const FontRead&);
-protected:
- fstream& iInputFile;
- FontCompiler* iFontCompiler;
- Fxf* iFxf;
- };
-
-class EffRead : public FontRead
-/**
-@internalComponent
-*/
- {
-public:
- EffRead(fstream& aFile,FontCompiler &aFontCompiler,Fxf* aFxf,short int* aMapSpace);
- virtual int ReadFont();
-private:
- EffRead& operator=(const EffRead&);
-private:
- short int* iMapSpace;
- };
-
-class FscRead : public FontRead
-/**
-@internalComponent
-*/
- {
-public:
- FscRead(fstream& aFile,FontCompiler &aFontCompiler,Fxf* aFxf);
- virtual int ReadFont();
-private:
- FscRead& operator=(const FscRead&);
-private:
- int ReadLine();
- int Pass1();
- int Pass2();
- char* ScanLine(int& aLen);
- int DoCom(int aSecondPass);
-private:
- FcmCharHead *iChar;
- char iInputBuf[256];
- int iInputBufLen;
- char* iFileBuf;
- int iFileBufLen;
- int iFileBufPos;
- int iUnderHang;
- int iOverHang;
- };
-
-#endif
--- a/gfxtools/gditools/fontcomp/FSC.CPP Fri Apr 16 16:02:07 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,337 +0,0 @@
-/*
-* Copyright (c) 1997-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-#include "fontcomp.h"
-
-FscRead::FscRead(fstream& aFile,FontCompiler& aFontCompiler,Fxf* aFxf):
- FontRead(aFile,aFontCompiler,aFxf)
- {}
-
-int FscRead::DoCom(int aSecondPass)
-/*
-Takes a command and takes appropriate action
-Returns -ve if an error occured
- 0 for OKAY
- +ve number for new current character number
-*/
- {
- int ret=0,num=0,neg=0;
- int i=0;
- for (;i<iInputBufLen;i++)
- {
- char chr=iInputBuf[i];
- if (num==0 && chr=='-')
- neg=1;
- else if (chr>='0' && chr<='9')
- num=num*10+chr-'0';
- }
- if (neg)
- num= -num;
- if (iInputBuf[1]=='c')
- return(num);
- if (aSecondPass)
- ret=0;
- else switch(iInputBuf[1])
- {
- case 'd':
- iFxf->descent=num;
- break;
- case 'a':
- iFxf->nominal_ascent=num;
- break;
- case 'm':
- iFxf->max_info_width=num;
- break;
- case 'h':
- if ((iFxf->cell_height=num)>MAX_HEIGHT)
- ret=Parameter;
- if (iFxf->nominal_ascent==0)
- iFxf->nominal_ascent=iFxf->cell_height-iFxf->descent;
- break;
- case 'n': /* Font data label name */
- {
- int pos=0;
- while(iInputBuf[pos]!=' ')
- pos++;
- while(iInputBuf[pos]==' ')
- pos++;
- if(iInputBufLen-pos>FONT_NAME_LEN)
- return(FileFormat);
- memcpy(iFxf->name,&iInputBuf[pos],iInputBufLen-pos);
- (iFxf->name)[iInputBufLen-pos]=0;
- }
- break;
- case 't': /* Font data typeface */
- {
- int pos=0;
- while(iInputBuf[pos]!=' ')
- pos++;
- while(iInputBuf[pos]==' ')
- pos++;
- if(iInputBufLen-pos>FONT_NAME_LEN)
- return(FileFormat);
- memcpy(iFxf->typeface,&iInputBuf[pos],iInputBufLen-pos);
- (iFxf->typeface)[iInputBufLen-pos]=0;
- }
- break;
- case 'b':
- iFxf->iBold=1;
- break;
- case 'i':
- iFxf->iItalic=1;
- break;
- case 'f':
- // not a lot
- break;
- case 'v':
- iFxf->iUid=num;
- break;
- case 'o':
- iOverHang=num;
- break;
- case 'u':
- iUnderHang=num;
- break;
- default:
- ret=FileFormat;
- break;
- }
- return(ret);
- }
-
-char* FscRead::ScanLine(int& aLen)
-/* Scan the input line for the first '0' or '1' character and return a descriptor pointing to it,
-returns a zero length descriptor if not found.
-*/
- {
- aLen=0;
- if((iInputBuf[0]!='0' && iInputBuf[0]!='1') || iInputBufLen==0)
- return(NULL);
- while(iInputBuf[aLen]=='0' || iInputBuf[aLen]=='1')
- aLen++;
- return(iInputBuf);
- }
-
-
-int FscRead::ReadLine()
- {
- int pos=0;
- while(iFileBuf[iFileBufPos+pos]!='\n' && iFileBufPos+pos<iFileBufLen)
- pos++;
- if(iFileBufPos+pos==iFileBufLen) return(1);
- memcpy(iInputBuf,&iFileBuf[iFileBufPos],pos);
- iInputBufLen=pos-1;
- iFileBufPos+=pos+1;
- if(iFileBufPos>=iFileBufLen) return(1);
- return(0);
- }
-
-FontRead::FontRead(fstream& aFile,FontCompiler& aFontCompiler,Fxf* aFxf):
- iInputFile(aFile),
- iFontCompiler(&aFontCompiler),
- iFxf(aFxf)
- {
- }
-
-int FscRead::ReadFont()
- {
- iInputFile.seekg(0,ios::end);
- iFileBufLen=iInputFile.tellg();
- iInputFile.seekg(0);
- iFileBufPos=0;
- iFileBuf=new char[iFileBufLen];
- iInputFile.read(iFileBuf,iFileBufLen);
- int ret=Pass1();
- if(ret) return(ret);
- return(Pass2());
- }
-
-int FscRead::Pass1()
- {
- int n_row=0; // counts row in character picture
- int ret=0;
- int specChr=0;
- int isCharBody=0;
- int lastLine=0;
- int widthofi=0;
- int widthofM=0;
-
- iFxf->MaxChrWidth=0;
- iFxf->cell_height=0;
- iFxf->UlinePos=0;
- iFxf->UlineThickness=0;
- iFxf->nominal_ascent=0;
- iFxf->descent=0;
- iFxf->chr_seg=0;
- iFxf->FirstChr=0;
- iFxf->n_chars=0;
- iFxf->max_info_width=0;
- iFxf->flags=0;
- iFxf->special=0;
- iFxf->ByteWid=0;
- iFxf->UseWords=0;
- iFxf->iBold=0;
- iFxf->iItalic=0;
- iFxf->iProportional=0;
- iFxf->iSerif=0;
- iFxf->iSymbol=0;
- iFxf->iUid=0;
-
- iUnderHang=0;
- iOverHang=0;
- iChar=new FcmCharHead[MAX_CHARS];
- for(int letter=0;letter<MAX_CHARS;letter++)
- iFxf->chr[letter]=NULL;
-//**************************************************
-// First pass. Read header info & character widths *
-//**************************************************
- do
- {
- int width=0; // width of current character picture
-
- lastLine=ReadLine();
- isCharBody=0;
- if (iInputBufLen>0 && iInputBuf[0]=='*')
- {
- if ((ret=DoCom(0))<0)
- return(FileFormat);
- else if (ret)
- {
- for(;iFxf->n_chars<ret;iFxf->n_chars++)
- iFxf->chr[iFxf->n_chars]=NULL;
- specChr=iFxf->n_chars;
- }
- }
- else
- {
- int len=0;
- char* ptr=ScanLine(len);
- if (len)
- {
- isCharBody=1;
- if (iFxf->FirstChr<0)
- iFxf->FirstChr=iFxf->n_chars;
- if (n_row==0)
- {
- for (width=0;width<len && (ptr[width]=='0' || ptr[width]=='1');width++);
- if (iFxf->n_chars>255)
- return(FileFormat);
- iFxf->chr[iFxf->n_chars]=iChar;
- iFxf->n_chars++;
- iChar->xOffset= -iUnderHang;
- iChar->width=width;
- iChar->ByteWid=((iChar->width+15)>>3)&(~1);
- iChar->move=width-iUnderHang-iOverHang;
- if(iFxf->n_chars=='i')
- widthofi=iChar->move;
- else if(iFxf->n_chars=='M')
- widthofM=iChar->move;
- iUnderHang=0;
- iOverHang=0;
- if (width>iFxf->MaxChrWidth)
- iFxf->MaxChrWidth=width;
- }
- n_row++;
- }
- }
- if ((n_row!=0 && !isCharBody) || (lastLine && isCharBody))
- {
- if (n_row>iFxf->cell_height)
- return(FileFormat);
- iChar->height=n_row;
- iChar->yOffset=iFxf->cell_height-iFxf->descent;
- specChr++;
- n_row=0;
- width=0;
- iChar++;
- }
- } while(!lastLine);
- if (iFxf->cell_height==0)
- return(FileFormat);
- if(widthofi && widthofM)
- iFxf->iProportional=(widthofi!=widthofM);
- return(NoError);
- }
-
-int FscRead::Pass2()
-/******************************************************/
-/* Second pass. Read in actual picture data this time */
-/******************************************************/
- {
- unsigned int bit; // Used to set bits in pic
- int ret,chNum;
- int n_row; // counts row in character picture
- int offset=0;
- int isCharBody;
- int lastLine;
-
- iFileBufPos=0;
- n_row=0;
- chNum=0;
- do {
- lastLine=ReadLine();
- isCharBody=0;
- if (iInputBufLen>0 && iInputBuf[0]=='*')
- {
- if ((ret=DoCom(1))>0)
- {
- if (ret<chNum)
- return(FileFormat);
- chNum=ret;
- }
- }
- else
- {
- int len=0;
- char* ptr=ScanLine(len);
- if (len)
- {
- isCharBody=1;
- if (n_row==0)
- {
- iChar=iFxf->chr[chNum];
- chNum++;
- }
- unsigned short int* pDest=(unsigned short int*)(iFontCompiler->FontStore()+offset+iChar->ByteWid*n_row);
- bit=1;
- *pDest=0;
- for (int width=0;width<len && (ptr[width]=='0' || ptr[width]=='1');width++)
- {
- if (ptr[width]=='1')
- *pDest|=bit;
- if (bit==0x8000)
- {
- bit=1;
- pDest++;
- *pDest=0;
- }
- else
- bit<<=1;
- }
- n_row++;
- }
- }
- if ((n_row!=0 && !isCharBody) || (lastLine && isCharBody))
- {
- iChar->offset=offset;
- offset+=iChar->ByteWid*n_row;
- n_row=0;
- }
- } while(!lastLine);
- return(NoError);
- }
--- a/gfxtools/gditools/fontcomp/GDSFCOMP.CPP Fri Apr 16 16:02:07 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,238 +0,0 @@
-/*
-* Copyright (c) 1997-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-#include "gdsfcomp.h"
-#include "toolsver.h"
-
-#include <sstream>
-
-int GdsFontCompiler::WriteFont()
- {
- int index=0;
- index=WriteHeader();
- if(index<0) return(index);
- for(int ch=index;ch<iFxf->n_chars;ch++)
- WriteCharData(ch);
- WriteFooter();
- return(NoError);
- }
-
-int GdsFontCompiler::WriteHeader()
- {
- int mncw=0;
- for(char letter='A';letter<='Z';letter++)
- {
- FcmCharHead* fChar=iFxf->chr[letter];
- if(fChar)
- {
- int letterwidth=fChar->move;
- if(letterwidth>mncw)
- mncw=letterwidth;
- }
- }
- WriteFormattedData("FontBitmap ");
- WriteFormattedData(iFxf->name,1);
- WriteFormattedData("Uid ");
- WriteFormattedData(iFxf->iUid);
- if(iFxf->iBold)
- WriteFormattedData(" Bold");
- if(iFxf->iItalic)
- WriteFormattedData(" Italic");
- if(iFxf->iProportional)
- WriteFormattedData(" Proportional");
- if(iFxf->iSerif)
- WriteFormattedData(" Serif");
- if(iFxf->iSymbol)
- WriteFormattedData(" Symbol");
- WriteNewLine();
- WriteFormattedData("MaxNormalCharWidth ");
- WriteFormattedData(mncw,1);
- WriteFormattedData("CellHeight ");
- WriteFormattedData(iFxf->cell_height,1);
- WriteFormattedData("Ascent ");
- WriteFormattedData(iFxf->nominal_ascent,1);
-// WriteFormattedData("Uline ");
-// WriteFormattedData(iFxf->UlinePos,0);
-// WriteFormattedData(" ");
-// WriteFormattedData(iFxf->UlineThickness,1);
- int index=0;
- while(!iFxf->chr[index])
- index++;
- if(index>=iFxf->n_chars)
- return(FileFormat);
- WriteFormattedData("CodeSection ");
- WriteFormattedData(index,0);
- WriteFormattedData(":");
- WriteFormattedData(iFxf->n_chars-1,1);
- return(index);
- }
-
-void GdsFontCompiler::WriteFooter()
- {
- WriteFormattedData("EndCodeSection",1);
- WriteFormattedData("EndFontBitmap",1);
- WriteNewLine();
- }
-
-void GdsFontCompiler::WriteCharData(int charnum)
- {
- unsigned short int* pSrc;
- unsigned short int bit;
- char buf[10+MAX_CHAR_WID];
- unsigned short int srcBuf[(MAX_CHAR_WID+15)>>4];
-
- const FcmCharHead* fChar=iFxf->chr[charnum];
- WriteNewLine();
- WriteFormattedData("Char ");
- WriteFormattedData(charnum);
- if(fChar==NULL)
- {
- WriteNewLine();
- WriteFormattedData("EndChar",1);
- return;
- }
- WriteFormattedData(" Adjust ");
-
- int bitwid=fChar->move+(fChar->xOffset<0?-fChar->xOffset:0);
- const int ohang=fChar->move-fChar->xOffset-fChar->width;
- WriteFormattedData(fChar->xOffset);
- WriteFormattedData(" ");
- WriteFormattedData(ohang);
- bitwid+=ohang;
- if (charnum>31)
- {
- WriteFormattedData(" ! '");
- WriteFormattedData((char*)&charnum);
- WriteFormattedData("'");
- }
- WriteNewLine();
- if (fChar->width!=0)
- {
- WriteBlankLines(iFxf->cell_height-iFxf->descent-fChar->yOffset,fChar->width);
- for(int y=0;y<fChar->height;y++)
- {
- memcpy(srcBuf,iFontSpace+fChar->offset+y*fChar->ByteWid,fChar->ByteWid);
- pSrc=&srcBuf[0];
- bit=1;
- int pb=0;
- for(int i=0;i<fChar->width;i++)
- {
- buf[pb++]=((*pSrc)&bit)?SetPixel:BlankPixel;
- bit<<=1;
- if(!bit)
- {
- bit=1;
- pSrc++;
- }
- }
- buf[pb]=0;
- WriteFormattedData(buf,1);
- }
- WriteBlankLines(iFxf->descent+fChar->yOffset-fChar->height,fChar->width);
- }
- WriteFormattedData("EndChar",1);
- }
-
-void GdsFontCompiler::WriteBlankLines(int num,int width)
- {
- char buf[2+MAX_CHAR_WID+20];
- memset(&buf[0],BlankPixel,width);
- buf[width] ='\0';
- for(int i=0;i<num;i++)
- WriteFormattedData(buf,1);
- }
-
-void GdsFontCompiler::WriteFormattedData(const char* aData,int aNewLine)
- {
- if(aData)
- iOutputFile << aData;
- if(aNewLine)
- WriteNewLine();
- }
-
-void GdsFontCompiler::WriteFormattedData(int aNum,int aNewLine)
- {
- std::stringstream ss;
-
- ss << aNum;
-
- WriteFormattedData(ss.str().c_str(), aNewLine);
- }
-
-void GdsFontCompiler::WriteNewLine()
- {
- iOutputFile << "\n";
- }
-
-int main(int argc,char *argv[])
- {
- if(argc<3 || argc>5)
- {
- cout << "\n";
- cout << "FONTCOMP Version 0.01(" << version << ")\n";
- cout << "\n";
- cout << "USAGE: FONTCOMP srcfile destfile [/e [mapfile]|/f]\n";
- cout << "Where srcfile is the file to be processed,\n";
- cout << "destfile is the file to be created,\n";
- cout << "/e specifies EFF format (default) and /f\n";
- cout << "specifies FSC format. If the format is EFF then\n";
- cout << "the optional mapfile may be used for altenative\n";
- cout << "character sets.\n\n";
- return(0);
- }
- FontType type=EFontTypeEff;
- if(argc==4)
- if(argv[3][1]=='f' || argv[3][1]=='F')
- type=EFontTypeFsc;
- char* mapfile=NULL;
- if(argc==5) mapfile=argv[4];
- GdsFontCompiler fontcomp;
- int ret=fontcomp.Init(argv[1],argv[2],mapfile);
- if(ret==NoError)
- ret=fontcomp.Read(type);
- if(ret==NoError)
- fontcomp.RemoveBlankSpace();
- if(ret==NoError)
- ret=fontcomp.WriteFont();
- switch(ret)
- {
- case NoError:
- cout << "Success\n\n";
- break;
- case NoMemory:
- cout << "Out of memory\n\n";
- break;
- case NoFile:
- cout << "File does not exist\n\n";
- break;
- case FileRead:
- cout << "File read error\n\n";
- break;
- case FileWrite:
- cout << "File write error\n\n";
- break;
- case FileFormat:
- cout << "File has wrong format\n\n";
- break;
- case Parameter:
- cout << "Bad parameter\n\n";
- break;
- }
- return(ret);
- }
-
--- a/gfxtools/gditools/fontcomp/GDSFCOMP.H Fri Apr 16 16:02:07 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* Copyright (c) 1997-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-#if !defined(__GDSFCOMP_H__)
-#define __GDSFCOMP_H__
-#if !defined(__FONTCOMP_H__)
-#include "fontcomp.h"
-#endif
-/**
-@internalComponent
-*/
-const char BlankPixel = '.';
-const char SetPixel = '*';
-
-class GdsFontCompiler : public FontCompiler
-/**
-@internalComponent
-*/
- {
-public:
- int WriteFont();
-protected:
- int WriteHeader();
- void WriteFooter();
- void WriteCharData(int);
- void WriteBlankLines(int,int);
- void WriteFormattedData(const char*,int=0);
- void WriteFormattedData(int,int=0);
- void WriteNewLine();
- };
-#endif
--- a/gfxtools/gditools/group/DISTRIBUTION.POLICY Fri Apr 16 16:02:07 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-Category T
-OSD: Reference/Test Bitmap and font conversion utilities (GDITOOLS)
--- a/gfxtools/gditools/group/FONTCOMP.MMP Fri Apr 16 16:02:07 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-* Copyright (c) 1997-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include <platform_paths.hrh>
-
-TARGET fontcomp.exe
-
-TARGETTYPE exe
-
-USERINCLUDE ../inc
-USERINCLUDE ../fontcomp
-USERINCLUDE ../../../inc
-USERINCLUDE ../../inc
-
-MW_LAYER_SYSTEMINCLUDE
-
-SOURCEPATH ../fontcomp
-SOURCE eff.cpp fontcomp.cpp fsc.cpp gdsfcomp.cpp
-
-
-VENDORID 0x70000001
--- a/gfxtools/gditools/group/Makefile.bmconv Fri Apr 16 16:02:07 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-CXX = g++296
-CXXFLAGS = -x c++ -g -D __LINUX__ -I $(EPOCROOT)epoc32/include -I ../inc
-SOURCE = MAINFUNC.CPP BMTOPBM.CPP PBMCOMP.CPP PBMTOBM.CPP RGB.CPP UTILS.CPP
-BLDDIR = ../build-bmconv
-OBJECT = $(addprefix $(BLDDIR)/, $(notdir $(SOURCE:.CPP=.o)))
-TARGET = $(BLDDIR)/bmconv
-
-VPATH = ../bmconv
-
-_dummy := $(shell mkdir -p $(BLDDIR))
-
-all: $(TARGET)
-
-
-$(TARGET): $(OBJECT)
- $(CXX) $^ -o $@
-
-
-$(OBJECT): $(BLDDIR)/%.o: %.CPP
- $(CXX) $(CXXFLAGS) -c $< -o $@
-
-clean:
- rm -f $(OBJECT) $(TARGET)
- -rmdir $(BLDDIR)
-
-.PHONY: all clean
-
--- a/gfxtools/gditools/group/bld.inf Fri Apr 16 16:02:07 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* Copyright (c) 1999-2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-/**
-@file
-
-@SYMPurpose PC-side graphics tools (e.g. BMCONV etc.)
-*/
-
-
-PRJ_PLATFORMS
-
-TOOLS TOOLS2
-
-
-PRJ_EXPORTS
-
-../group/fontcomp.ipr /epoc32/engdoc/tools/fontcomp.ipr
-
-PRJ_MMPFILES
-
-#if (defined TOOLS ) || (defined TOOLS2)
-
-../group/fontcomp.mmp
-
-// NOTICE! Bmconv is moved to /s60/tools/platformtools/gfxtools/bmconv/group
-
-#endif
-
-
-PRJ_TESTMMPFILES
-
--- a/gfxtools/gditools/group/fontcomp.ipr Fri Apr 16 16:02:07 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-[purpose]
-
-Compiles FSC and EFF format fonts into font store files
-
-[categories]
-obsolete-development
-
-[files]
-tools\fontcomp.exe # compiler
-tools\fsc2bdf.exe # alternative - convert FSC font to BDF
-
-[owner]
-Runtime & Tools # GDITOOLS
-
-[IPR]
-Copyright (c) 2000 Symbian Ltd. All rights reserved.
-
--- a/gfxtools/gditools/inc/DISTRIBUTION.POLICY Fri Apr 16 16:02:07 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-Category T
-OSD: Reference/Test Bitmap and font conversion utilities (GDITOOLS)
--- a/gfxtools/gditools/inc/TOOLSVER.H Fri Apr 16 16:02:07 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
-* Copyright (c) 1997-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-#ifndef __TOOLSVER_H__
-#define __TOOLSVER_H__
-/**
-@internalComponent
-*/
-const int version=116;
-
-#endif
-
--- a/gfxtools/gditools/rom/gdi.iby Fri Apr 16 16:02:07 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef __GDI_IBY__
-#define __GDI_IBY__
-
-REM GDI - Abstract Graphics API
-
-#include <palette.iby> /* gdi is only user */
-
-file=ABI_DIR\BUILD_DIR\gdi.dll System\Libs\Gdi.dll
-file=ABI_DIR\BUILD_DIR\linebreak.dll System\Libs\linebreak.dll
-file=ABI_DIR\BUILD_DIR\lookuptable.dll System\Libs\lookuptable.dll
-
-#endif
--- a/gfxtools/group/bld.inf Fri Apr 16 16:02:07 2010 +0300
+++ b/gfxtools/group/bld.inf Mon May 03 13:28:15 2010 +0300
@@ -15,5 +15,4 @@
*
*/
-#include "../gditools/group/bld.inf"
#include "../Color/group/bld.inf"