First public contribution.
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #if !defined(__FONTCOMP_H__)
17 #define __FONTCOMP_H__
26 #else //!__MSVCDOTNET__
28 #endif //__MSVCDOTNET__
34 #define FONT_NAME_LEN 16
38 #define MAX_CHAR_WID 256
39 #define MAX_HEIGHT 256
40 #define MAX_LABEL_LENGTH 16 /* Max font label name */
41 #define MAX_LEN_IN 255 /* Max input line length */
42 #define MAXLINE 600 /* Max line length for writing to screen */
43 #define FONT_MAX_HEADER_LEN 128
44 #define P_FNAMESIZE 128 /* Maximum file name size */
74 struct LetterTableData
77 short int width; /* x16 in version 1*/
86 unsigned char rWid; /* Enclosing rectangle width */
87 unsigned char rHgt; /* Enclosing rectangle height */
99 short int xSize; /* 16 x Point size */
100 short int xRes; /* DPI */
103 unsigned char XHeight;
104 unsigned char CapHeight;
105 unsigned char Ascender;
107 unsigned char LineSpacing;
109 unsigned char UnderLineThickness;
110 unsigned char filler[7];
115 const int EMaxFontNameLength=256;
123 FcmCharHead *chr[MAX_CHARS];
124 char name[EMaxFontNameLength]; /* Font name */
125 char typeface[EMaxFontNameLength]; /* Font typeface */
127 int cell_height; /* Height of character set */
128 int nominal_ascent; /* Max ascent of normal (ASCII) characters */
129 int descent; /* Descent of characters below base line */
132 int n_chars; /* counts total number of characters defined */
133 unsigned int max_info_width; /* Max char width to put in info file */
134 unsigned short int flags;
135 unsigned short int special;
136 unsigned int ByteWid;
163 int Read(FontType aInputType);
164 int Init(char*,char*,char*);
165 void RemoveBlankSpace();
166 char* FontStore() const;
167 virtual int WriteFont()=0;
168 protected: // general information
172 protected: // font information
174 char* iWorkSpace; // misc. stuff
175 short int* iMapSpace;
177 unsigned int iHeaderDataLen;
178 unsigned char iHeaderData[FONT_MAX_HEADER_LEN];
187 FontRead(fstream& aFile,FontCompiler& aFontCompiler,Fxf* aFxf);
188 virtual int ReadFont()=0;
190 FontRead& operator=(const FontRead&);
193 FontCompiler* iFontCompiler;
197 class EffRead : public FontRead
203 EffRead(fstream& aFile,FontCompiler &aFontCompiler,Fxf* aFxf,short int* aMapSpace);
204 virtual int ReadFont();
206 EffRead& operator=(const EffRead&);
208 short int* iMapSpace;
211 class FscRead : public FontRead
217 FscRead(fstream& aFile,FontCompiler &aFontCompiler,Fxf* aFxf);
218 virtual int ReadFont();
220 FscRead& operator=(const FscRead&);
225 char* ScanLine(int& aLen);
226 int DoCom(int aSecondPass);