harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r548327 [2/2] - in /harmony/enhanced/classlib/trunk/modules/awt: ./ src/main/java/common/org/apache/harmony/awt/gl/font/fontlib/ src/main/native/fontlib/shared/ src/main/native/fontlib/shared/include/ src/main/native/fontlib/unix/ src/main/...
Date Mon, 18 Jun 2007 11:42:24 GMT
Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/T1Glyph.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/T1Glyph.h?view=diff&rev=548327&r1=548326&r2=548327
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/T1Glyph.h (original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/T1Glyph.h Mon
Jun 18 04:42:19 2007
@@ -31,17 +31,17 @@
 	Type1Map *_charStringMap;
 	Type1Map *_subrsMap;
 
-    float _relativeSize;
-    float _glyphBB[4]; 
+    ffloat _relativeSize;
+    ffloat _glyphBB[4]; 
 
-	void parseValueToOutline(EncodedValue *value, std::stack<float> *stack, Outline *out,
float *curX, float *curY, float relativeSize);
-	void countPoints(std::stack<float> *stack, EncodedValue *value, unsigned short *point,
unsigned short *command);
+	void parseValueToOutline(EncodedValue *value, std::stack<ffloat> *stack, Outline *out,
ffloat *curX, ffloat *curY, ffloat relativeSize);
+	void countPoints(std::stack<ffloat> *stack, EncodedValue *value, ufshort *point, ufshort
*command);
 
 public:
-	T1Glyph(Type1Map *charStringMap, Type1Map *subrsMap, unsigned short unicode, unsigned short
size, float relativeSize, float* fontBB);
+	T1Glyph(Type1Map *charStringMap, Type1Map *subrsMap, ufshort unicode, ufshort size, ffloat
relativeSize, ffloat* fontBB);
 	~T1Glyph();
 	Outline* getOutline(void);
-	float* getGlyphMetrics(void);
+	ffloat* getGlyphMetrics(void);
 };
 
 #endif //__TYPE_1_GLYPH_CLASS_H

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TTCurve.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TTCurve.cpp?view=diff&rev=548327&r1=548326&r2=548327
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TTCurve.cpp
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TTCurve.cpp
Mon Jun 18 04:42:19 2007
@@ -35,7 +35,7 @@
 	delete[] _flags;
 }
 
-int TTCurve::add(float x, float y, unsigned char flag)
+fint TTCurve::add(ffloat x, ffloat y, ufchar flag)
 {
 	_len +=2;
 	
@@ -44,13 +44,13 @@
 	else if (flag != 0)
 		_outlineCommandsNumb++;
 
-	float* tmpC = _coords;
-	unsigned char* tmpF = _flags;
+	ffloat* tmpC = _coords;
+	ufchar* tmpF = _flags;
 
-	_coords = new float[_len];
-	_flags = new unsigned char[(_len+1)/2];
+	_coords = new ffloat[_len];
+	_flags = new ufchar[(_len+1)/2];
 
-	memcpy(_coords,tmpC,(_len-2)*sizeof(float));
+	memcpy(_coords,tmpC,(_len-2)*sizeof(ffloat));
     _coords[_len-2] = x;
 	_coords[_len-1] = y;
     

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TTCurve.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TTCurve.h?view=diff&rev=548327&r1=548326&r2=548327
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TTCurve.h (original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TTCurve.h Mon
Jun 18 04:42:19 2007
@@ -21,6 +21,8 @@
 #ifndef __CURVE_H__
 #define __CURVE_H__
 
+#include "TypeDefinition.h"
+
 enum{OPEN_FLAG=1, FLAG_ONCURVE=2};
 
 class TTCurve
@@ -30,12 +32,12 @@
 	TTCurve();
 	~TTCurve();
 
-	float* _coords;
-    unsigned char* _flags;
-	unsigned short _len;
-	unsigned short _outlineCommandsNumb;
+	ffloat* _coords;
+    ufchar* _flags;
+	ufshort _len;
+	ufshort _outlineCommandsNumb;
 
-	int add(float x, float y, unsigned char flag);
+	fint add(ffloat x, ffloat y, ufchar flag);
 
 };
 

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TTFont.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TTFont.cpp?view=diff&rev=548327&r1=548326&r2=548327
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TTFont.cpp
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TTFont.cpp
Mon Jun 18 04:42:19 2007
@@ -21,7 +21,7 @@
 #include "TTFont.h"
 #include "Tables.h"
 
-TTFont::TTFont(char* pathToFile):Font()
+TTFont::TTFont(fchar* pathToFile):Font()
 {
 	_pathToFile=pathToFile;
 	_glyphOffsets.offsets = NULL;
@@ -36,14 +36,14 @@
 	parseCmapTable(_ttfile, &_tableEncode); 
 	parseMaxpTable(_ttfile, &_numGlyphs);
 	parseHeadTable(_ttfile, _boundingBox, &(_glyphOffsets.format), &_unitsPerEm);
-	for (int i=0; i<4; i++)
-		_boundingBox[i]/=(float)(_unitsPerEm);
+	for (fint i=0; i<4; i++)
+		_boundingBox[i]/=(ffloat)(_unitsPerEm);
 	parseLocaTable(_ttfile, &(_glyphOffsets), _numGlyphs);
 	parseHheaTable(_ttfile, &_numOfHMetrics, &_ascent, &_descent, &_externalLeading);
 
-	_ascent/=(float)(_unitsPerEm);
+	_ascent/=(ffloat)(_unitsPerEm);
 	_descent = ((_descent>0)?_descent:(-_descent))/_unitsPerEm;
-	_externalLeading/=(float)(_unitsPerEm);
+	_externalLeading/=(ffloat)(_unitsPerEm);
 
 	parseHmtxTable(_ttfile, _numOfHMetrics, &_hMetrics);
 	fclose(_ttfile);
@@ -52,45 +52,45 @@
 TTFont::~TTFont(void)
 {
 	delete[] _glyphOffsets.offsets;
-	delete[] (int*)(_tableEncode.TableEncode);
+	delete[] (fint*)(_tableEncode.TableEncode);
 	delete[] _psName;
 	delete[] _hMetrics;
 }
 
-Glyph* TTFont::createGlyph(unsigned short unicode, unsigned short size) 
+Glyph* TTFont::createGlyph(ufshort unicode, ufshort size) 
 {
 	TTGlyph *gl = new TTGlyph(this, unicode, size);
 	if (gl->_index < _numOfHMetrics)
-		gl->_advanceX = _hMetrics[gl->_index].adwance_width*(float)(size)/(float)(_unitsPerEm);
+		gl->_advanceX = _hMetrics[gl->_index].adwance_width*(ffloat)(size)/(ffloat)(_unitsPerEm);
 	else
-		gl->_advanceX = _hMetrics[_numOfHMetrics-1].adwance_width*(float)(size)/(float)(_unitsPerEm);
+		gl->_advanceX = _hMetrics[_numOfHMetrics-1].adwance_width*(ffloat)(size)/(ffloat)(_unitsPerEm);
 	gl->_advanceY = 0;
 	return gl;
 }
 
-unsigned short TTFont::getGlyphIndex(unsigned short symb)
+ufshort TTFont::getGlyphIndex(ufshort symb)
 {
-	unsigned short index = 0;
+	ufshort index = 0;
 
 	if (_tableEncode.format == 0)
 	{
-		unsigned char* te = (unsigned char*)_tableEncode.TableEncode;
+		ufchar* te = (ufchar*)_tableEncode.TableEncode;
 		index = te[symb];
 	
 	}else if (_tableEncode.format == 4)
 	{
-		unsigned short segCountX2;
-		unsigned short segCount;
-//		unsigned short search_range;     
-//		unsigned short entry_selector;   
-//		unsigned short range_shift;     
-		unsigned short* end_count;
-		unsigned short* start_count;
-		unsigned short* idDelta;
-		unsigned short* idRangeOffset;
-		unsigned short reservedPad;      
-		unsigned short* te = (unsigned short*)(_tableEncode.TableEncode);
-		int i;
+		ufshort segCountX2;
+		ufshort segCount;
+//		ufshort search_range;     
+//		ufshort entry_selector;   
+//		ufshort range_shift;     
+		ufshort* end_count;
+		ufshort* start_count;
+		ufshort* idDelta;
+		ufshort* idRangeOffset;
+		ufshort reservedPad;      
+		ufshort* te = (ufshort*)(_tableEncode.TableEncode);
+		fint i;
 
 		segCountX2 = te[0];
 		segCount = segCountX2/2;
@@ -117,14 +117,14 @@
 	return index;
 }
 
-unsigned short TTFont::getUnicodeByIndex(unsigned short ind)
+ufshort TTFont::getUnicodeByIndex(ufshort ind)
 {
-	unsigned short symb = 0;
+	ufshort symb = 0;
 
 	if (_tableEncode.format == 0)
 	{
-		unsigned char* te = (unsigned char*)_tableEncode.TableEncode;
-		for (unsigned short i = 0; i<=_numGlyphs; i++)
+		ufchar* te = (ufchar*)_tableEncode.TableEncode;
+		for (ufshort i = 0; i<=_numGlyphs; i++)
 		{
 			if (ind = te[i]) 
 			{
@@ -135,15 +135,15 @@
 	}else 
 	if (_tableEncode.format == 4)
 	{
-		unsigned short segCountX2;
-		unsigned short segCount;
-		unsigned short* end_count;
-		unsigned short* start_count;
-		unsigned short* idDelta;
-		unsigned short* idRangeOffset;
-		unsigned short reservedPad;      
-		unsigned short* te = (unsigned short*)(_tableEncode.TableEncode);
-		int i;
+		ufshort segCountX2;
+		ufshort segCount;
+		ufshort* end_count;
+		ufshort* start_count;
+		ufshort* idDelta;
+		ufshort* idRangeOffset;
+		ufshort reservedPad;      
+		ufshort* te = (ufshort*)(_tableEncode.TableEncode);
+		fint i;
 
 		segCountX2 = te[0];
 		segCount = segCountX2/2;
@@ -156,10 +156,10 @@
 		for (i=0;i<segCount;i++)
 		{
 			if (idRangeOffset[i] != 0)
-				for (int j=0; j< _numGlyphs; j++)
+				for (fint j=0; j< _numGlyphs; j++)
 				{
 					if (ind - idDelta[i] == idRangeOffset[j] )
-						symb = (unsigned short)(&idRangeOffset[j] - idRangeOffset[i]/2 + start_count[i]
- &idRangeOffset[i]);
+						symb = (ufshort)(&idRangeOffset[j] - idRangeOffset[i]/2 + start_count[i] - &idRangeOffset[i]);
 				}
 			else
 				symb = (ind - idDelta[i]) % 65536;
@@ -173,27 +173,27 @@
 	return symb;
 }
 
-wchar_t* TTFont::getPSName()
+fwchar_t* TTFont::getPSName()
 {
 	return _psName;
 }
 
-float* TTFont::getLineMetrics()
+ffloat* TTFont::getLineMetrics()
 {
 //printf("reading file...\n");
 	_ttfile = fopen(_pathToFile,"rb");
 	
-	float* ret = new float[8];
+	ffloat* ret = new ffloat[8];
 	ret[0] = _ascent;
 	ret[1] = _descent;
     ret[2] = _externalLeading;
 
-	short uOffset, uThickness;
+	fshort uOffset, uThickness;
 
 //printf("parsing POST table...\n");
     parsePostTable(_ttfile, &uOffset, &uThickness);
-	ret[3] = (float)uThickness/(float)(_unitsPerEm);
-	ret[4] = (float)uOffset/(float)(_unitsPerEm);
+	ret[3] = (ffloat)uThickness/(ffloat)(_unitsPerEm);
+	ret[4] = (ffloat)uOffset/(ffloat)(_unitsPerEm);
 
 //printf("parsing OS2 table...\n");	
 	parseOs2Table(_ttfile, &_strikeOutSize, &_strikeOutOffset);
@@ -201,7 +201,7 @@
 	ret[5] = _strikeOutSize;
 	ret[6] = _strikeOutOffset;
 
-	float width = _boundingBox[3]-_boundingBox[1];
+	ffloat width = _boundingBox[3]-_boundingBox[1];
 	ret[7] = (width>0)?width:(-width);
 	
 	fclose(_ttfile);
@@ -209,9 +209,9 @@
 	return ret;
 }
 
-bool TTFont::canDisplay(unsigned short c)
+bool TTFont::canDisplay(ufshort c)
 {
-	unsigned short index = getGlyphIndex(c);
+	ufshort index = getGlyphIndex(c);
 #ifdef WIN32
 	bool isComposite = isCompositeGlyph(_ttfile, _glyphOffsets, _numGlyphs, index);
 	if (index == 0 || index >= _numGlyphs || isComposite)
@@ -226,7 +226,7 @@
 /* *************** */
 /* TTGlyph methods */
 /* *************** */
-TTGlyph::TTGlyph(TTFont* font, unsigned short unicode, unsigned short size):Glyph() 
+TTGlyph::TTGlyph(TTFont* font, ufshort unicode, ufshort size):Glyph() 
 {
 	_ttfont = font;
 	_unicode = unicode;
@@ -239,7 +239,7 @@
 
 	_ttfont->_ttfile = fopen(_ttfont->_pathToFile,"rb");
 	_index = _ttfont->getGlyphIndex(_unicode);
-	parseGlyphData(_ttfont->_ttfile, _ttfont->_glyphOffsets,_ttfont->_numGlyphs,_index,
_curve, _boundingRect, (float)_size/(float)(_ttfont->_unitsPerEm));
+	parseGlyphData(_ttfont->_ttfile, _ttfont->_glyphOffsets,_ttfont->_numGlyphs,_index,
_curve, _boundingRect, (ffloat)_size/(ffloat)(_ttfont->_unitsPerEm));
     fclose(_ttfont->_ttfile);
 }
 
@@ -248,8 +248,8 @@
 	delete _curve;
 }
 
-float* TTGlyph::getGlyphMetrics(void){
-	float* gMetrics = new float[6];
+ffloat* TTGlyph::getGlyphMetrics(void){
+	ffloat* gMetrics = new ffloat[6];
 
 	gMetrics[0]=_advanceX;
 	gMetrics[1]=_advanceY;
@@ -265,7 +265,7 @@
 {
 	Outline* outline = new Outline(_curve->_len,_curve->_outlineCommandsNumb); 
 
-	for (int i = 0; i<_curve->_len; i+=2)
+	for (fint i = 0; i<_curve->_len; i+=2)
 	{
 		switch(_curve->_flags[i/2])
 		{

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TTFont.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TTFont.h?view=diff&rev=548327&r1=548326&r2=548327
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TTFont.h (original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TTFont.h Mon
Jun 18 04:42:19 2007
@@ -25,23 +25,24 @@
 #include "Glyph.h"
 #include "Outline.h"
 #include "TTCurve.h"
+#include "TypeDefinition.h"
 
 typedef struct
 {
-	short format; //format of the 'loca' table
-	unsigned long* offsets;
+	fshort format; //format of the 'loca' table
+	uflong* offsets;
 } GlyphOffsets;
 
 typedef struct
 {
-	short format;
+	fshort format;
 	void* TableEncode;
 } TableEncode;
 
 typedef struct
 {
-	unsigned short adwance_width;
-	short lsb;
+	ufshort adwance_width;
+	fshort lsb;
 }HMetrics;
 
 class TTGlyph;
@@ -50,48 +51,48 @@
 {
 friend class TTGlyph;
 private:
-	char* _pathToFile; // path to font file
-	wchar_t *_psName; // postscript name of font
+	fchar* _pathToFile; // path to font file
+	fwchar_t *_psName; // postscript name of font
 	GlyphOffsets _glyphOffsets; //glyphs offsets in font file
 	TableEncode _tableEncode; // table with indexes of glyphs
-	unsigned short _unitsPerEm; //size of em-square
-	unsigned short _numOfHMetrics; // for 'hmtx' table
+	ufshort _unitsPerEm; //size of em-square
+	ufshort _numOfHMetrics; // for 'hmtx' table
 	HMetrics* _hMetrics; // horizontal metrics for all glyphs
 	FILE* _ttfile;
 
-	unsigned short getGlyphIndex(unsigned short symb);
-	unsigned short getUnicodeByIndex(unsigned short ind);
-//	friend unsigned short TTGlyph::getGlyphIndex(unsigned short symb);
-//	friend int TTGlyph::initialize();
+	ufshort getGlyphIndex(ufshort symb);
+	ufshort getUnicodeByIndex(ufshort ind);
+//	friend ufshort TTGlyph::getGlyphIndex(ufshort symb);
+//	friend fint TTGlyph::initialize();
 
 public:
-	TTFont(char* pathToFile);
+	TTFont(fchar* pathToFile);
 	~TTFont(void);
 	
-	Glyph* createGlyph(unsigned short unicode, unsigned short size);
-	wchar_t* getPSName();
-	float* getLineMetrics(); 
-	bool canDisplay(unsigned short c);
+	Glyph* createGlyph(ufshort unicode, ufshort size);
+	fwchar_t* getPSName();
+	ffloat* getLineMetrics(); 
+	bool canDisplay(ufshort c);
 
-//	float* GetExtraMetrics();
+//	ffloat* GetExtraMetrics();
 };
 
 
 class TTGlyph : public Glyph {
 private:
 	TTFont* _ttfont;			
-	unsigned short _index; 
+	ufshort _index; 
 	TTCurve* _curve;
-	short _boundingRect[4]; 
+	fshort _boundingRect[4]; 
 
 	
-	friend Glyph* TTFont::createGlyph(unsigned short unicode, unsigned short size);
+	friend Glyph* TTFont::createGlyph(ufshort unicode, ufshort size);
 
 public:
-	TTGlyph(TTFont *font, unsigned short unicode, unsigned short size);
+	TTGlyph(TTFont *font, ufshort unicode, ufshort size);
 	~TTGlyph();
 	Outline* getOutline(void);
-	float* getGlyphMetrics(void);
+	ffloat* getGlyphMetrics(void);
 };
 
 #endif //__TTFONT_H__

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/Tables.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/Tables.h?view=diff&rev=548327&r1=548326&r2=548327
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/Tables.h (original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/Tables.h Mon
Jun 18 04:42:19 2007
@@ -24,6 +24,7 @@
 
 #include "TTCurve.h"
 #include "TTFont.h"
+#include "TypeDefinition.h"
 
 #define CMAP_TABLE "cmap"   /* character to glyph mapping   */
 #define GLYF_TABLE "glyf"   /* glyph data                   */
@@ -51,7 +52,7 @@
 #define BIG5_ENCODING 3
 #define PRC_ENCODING 4
 
-typedef long Fixed;
+typedef flong Fixed;
 typedef long long LONGDT;
 
 typedef enum
@@ -72,50 +73,50 @@
 
 /* From Win GDI 
 typedef struct { 
-  unsigned char bFamilyType; 
-  unsigned char bSerifStyle; 
-  unsigned char bWeight; 
-  unsigned char bProportion; 
-  unsigned char bContrast; 
-  unsigned char bStrokeVariation; 
-  unsigned char bArmStyle; 
-  unsigned char bLetterform; 
-  unsigned char bMidline; 
-  unsigned char bXHeight; 
+  ufchar bFamilyType; 
+  ufchar bSerifStyle; 
+  ufchar bWeight; 
+  ufchar bProportion; 
+  ufchar bContrast; 
+  ufchar bStrokeVariation; 
+  ufchar bArmStyle; 
+  ufchar bLetterform; 
+  ufchar bMidline; 
+  ufchar bXHeight; 
 } PANOSE; */
 
 typedef struct
 {
     Fixed version;
-    unsigned short num_tables;
-    unsigned short search_range;
-    unsigned short entry_selector;
-    unsigned short range_shift;
+    ufshort num_tables;
+    ufshort search_range;
+    ufshort entry_selector;
+    ufshort range_shift;
 } Table_Offset;
 
 typedef struct
 {
-    char    tag[4];
-    unsigned long   checkSum;
-    unsigned long   offset;
-    unsigned long   length;
+    fchar    tag[4];
+    uflong   checkSum;
+    uflong   offset;
+    uflong   length;
 } Table_Directory;
 
 typedef struct
 {
-    unsigned short platformID;
-    unsigned short encodingID;
-    unsigned short languageID;
-    unsigned short nameID;
-    unsigned short string_length;
-    unsigned short string_offset;
+    ufshort platformID;
+    ufshort encodingID;
+    ufshort languageID;
+    ufshort nameID;
+    ufshort string_length;
+    ufshort string_offset;
 } Name_Entry;
 
 typedef struct 
 {
-    unsigned short format;
-    unsigned short num_name_records;
-    unsigned short storage_offset;
+    ufshort format;
+    ufshort num_name_records;
+    ufshort storage_offset;
     Name_Entry name_record[1];
 } Table_name; 
 
@@ -123,20 +124,20 @@
 typedef struct
 {
     Fixed  version;
-    unsigned short numGlyphs; // number of Glyphs
-    unsigned short maxPoints;
-    unsigned short maxContours;
-    unsigned short maxCompositePoints;
-    unsigned short maxCompositeContours;
-    unsigned short maxZones;
-    unsigned short maxTwilightPoints;
-    unsigned short maxStorage;
-    unsigned short maxFunctionDefs;
-    unsigned short maxInstructionDefs;
-    unsigned short maxStackElements;
-    unsigned short maxSizeOfInstructions;
-    unsigned short maxComponentElements;
-    unsigned short maxComponentDepth;
+    ufshort numGlyphs; // number of Glyphs
+    ufshort maxPoints;
+    ufshort maxContours;
+    ufshort maxCompositePoints;
+    ufshort maxCompositeContours;
+    ufshort maxZones;
+    ufshort maxTwilightPoints;
+    ufshort maxStorage;
+    ufshort maxFunctionDefs;
+    ufshort maxInstructionDefs;
+    ufshort maxStackElements;
+    ufshort maxSizeOfInstructions;
+    ufshort maxComponentElements;
+    ufshort maxComponentDepth;
 } Table_maxp;
 
 /* TrueType Font Header table */
@@ -144,92 +145,92 @@
 {
     Fixed table_version;
     Fixed font_revision;
-    unsigned long checksum_adjust;
-    unsigned long magic_number;
-    unsigned short flags;
-    unsigned short units_per_EM;
+    uflong checksum_adjust;
+    uflong magic_number;
+    ufshort flags;
+    ufshort units_per_EM;
 	LONGDT created;
 	LONGDT modified;
-    short xMin;
-    short yMin;
-    short xMax;
-    short yMax;
-    unsigned short mac_style;
-    unsigned short lowest_rec_PPEM;
-    short font_direction;
-    short index_to_loc_format;  // format of 'loca' table
-    short glyph_data_format;
+    fshort xMin;
+    fshort yMin;
+    fshort xMax;
+    fshort yMax;
+    ufshort mac_style;
+    ufshort lowest_rec_PPEM;
+    fshort font_direction;
+    fshort index_to_loc_format;  // format of 'loca' table
+    fshort glyph_data_format;
 } Table_head;
 
 typedef struct
 {
     Fixed table_version;
-	short ascender;	             /* typographic ascent */
-	short descender;             /* typographic descent */
-	short line_gap;              /* typographic line gap */
-	unsigned short advance_width_max;    /* Maximum advance width value in ‘hmtx’ table */
-	short min_left_sidebearing;
-	short min_right_sidebearing; /* Min(aw - lsb - (xMax - xMin)) */
-	short xMaxExtent;            /* Max(lsb + (xMax - xMin)) */
-	short caret_slope_rise;
-	short caret_slope_run;
-	short first_reserved;
-	short second_reserved;
-	short third_reserved;
-	short fourth_reserved;
-	short fifth_reserved;
-    short metric_data_format;
-	unsigned short number_of_hMetrics;
+	fshort ascender;	             /* typographic ascent */
+	fshort descender;             /* typographic descent */
+	fshort line_gap;              /* typographic line gap */
+	ufshort advance_width_max;    /* Maximum advance width value in ‘hmtx’ table */
+	fshort min_left_sidebearing;
+	fshort min_right_sidebearing; /* Min(aw - lsb - (xMax - xMin)) */
+	fshort xMaxExtent;            /* Max(lsb + (xMax - xMin)) */
+	fshort caret_slope_rise;
+	fshort caret_slope_run;
+	fshort first_reserved;
+	fshort second_reserved;
+	fshort third_reserved;
+	fshort fourth_reserved;
+	fshort fifth_reserved;
+    fshort metric_data_format;
+	ufshort number_of_hMetrics;
 } Table_hhea;
 
 typedef struct
 {
-	unsigned short table_version;
-	short xAvgCharWidth;
-	unsigned short usWeightClass;
-	unsigned short usWidthClass;
-	short fsType;
-	short ySubscriptXSize;
-	short ySubscriptYSize;
-	short ySubscriptXOffset;
-	short ySubscriptYOffset;
-	short ySuperscriptXSize;
-	short ySuperscriptYSize;
-	short ySuperscriptXOffset;
-	short ySuperscriptYOffset;
-	short yStrikeoutSize;
-	short yStrikeoutPosition;
-	short sFamilyClass;
+	ufshort table_version;
+	fshort xAvgCharWidth;
+	ufshort usWeightClass;
+	ufshort usWidthClass;
+	fshort fsType;
+	fshort ySubscriptXSize;
+	fshort ySubscriptYSize;
+	fshort ySubscriptXOffset;
+	fshort ySubscriptYOffset;
+	fshort ySuperscriptXSize;
+	fshort ySuperscriptYSize;
+	fshort ySuperscriptXOffset;
+	fshort ySuperscriptYOffset;
+	fshort yStrikeoutSize;
+	fshort yStrikeoutPosition;
+	fshort sFamilyClass;
 //	PANOSE panose;
-	unsigned char panose[10];
-	unsigned long ulUnicodeRange1;
-	unsigned long ulUnicodeRange2;
-	unsigned long ulUnicodeRange3;
-	unsigned long ulUnicodeRange4;
-	unsigned char achVendID[4];
-	unsigned short fsSelection;
-	unsigned short usFirstCharIndex;
-	unsigned short usLastCharIndex;
-	unsigned short sTypoAscender;
-	unsigned short sTypoDescender;
-	unsigned short sTypoLineGap;
-	unsigned short sWinAscent;
-	unsigned short sWinDescent;
-	unsigned long ulCodePageRange1;
-	unsigned long ulCodePageRange2;
+	ufchar panose[10];
+	uflong ulUnicodeRange1;
+	uflong ulUnicodeRange2;
+	uflong ulUnicodeRange3;
+	uflong ulUnicodeRange4;
+	ufchar achVendID[4];
+	ufshort fsSelection;
+	ufshort usFirstCharIndex;
+	ufshort usLastCharIndex;
+	ufshort sTypoAscender;
+	ufshort sTypoDescender;
+	ufshort sTypoLineGap;
+	ufshort sWinAscent;
+	ufshort sWinDescent;
+	uflong ulCodePageRange1;
+	uflong ulCodePageRange2;
 } Table_os2;
 
 typedef struct
 {
-	unsigned short platform;	 //identifier of platform
-	unsigned short encodingID;	 //identifier fo encoding
-	unsigned long  table_offset; //offset of the encoding table	
+	ufshort platform;	 //identifier of platform
+	ufshort encodingID;	 //identifier fo encoding
+	uflong  table_offset; //offset of the encoding table	
 } Cmap_Entry;
 
 typedef struct
 {
-	unsigned short table_version;       // =0
-    unsigned short numSubTables;        //number subtables
+	ufshort table_version;       // =0
+    ufshort numSubTables;        //number subtables
 	Cmap_Entry tableHeaders[1]; //headers of subtables
 } Table_cmap;
 
@@ -237,78 +238,78 @@
 {
     Fixed format; //format type
 	Fixed italic_angle;
-	short underlineOffset;
-	short underlineThickness;
-	unsigned long isFixedPitch;
-	unsigned long minMemType42;
-	unsigned long maxMemType42;
-	unsigned long minMemType1;
-	unsigned long maxMemType1;
+	fshort underlineOffset;
+	fshort underlineThickness;
+	uflong isFixedPitch;
+	uflong minMemType42;
+	uflong maxMemType42;
+	uflong minMemType1;
+	uflong maxMemType1;
 } Table_post;
 
 /* first part of the encoding table identical for all format of them */
 typedef struct
 {
-	unsigned short format;
-	unsigned short length; //length in bytes
-	unsigned short version;
+	ufshort format;
+	ufshort length; //length in bytes
+	ufshort version;
 } Table_encode_header;
 
 /*
 typedef struct
 {
-	unsigned short format; // =0,2,4,6
-	unsigned short length; // size
-	unsigned short version;
-	unsigned char map[256];
+	ufshort format; // =0,2,4,6
+	ufshort length; // size
+	ufshort version;
+	ufchar map[256];
 } Table_encode_0;
 
 
 typedef struct
 {
-//	unsigned short segCountX2;       // 2 x segCount
-	unsigned short search_range;     // 2 x (2**floor(log_2(segCount)))
-	unsigned short entry_selector;   // log_2(search_range/2)
-	unsigned short range_shift;      // 2 x segCount - search_range
-	unsigned short end_count[1];     // end characterCode for each segment, last =0xFFFF, length
= segCount
-	unsigned short reservedPad;      // = 0
-	unsigned short start_count[1];   // Start character code for each segment, length = segCount
-	unsigned short idDelta[1];       // Delta for all character codes in segment, length = segCount
-    unsigned short idRangeOffset[1]; // Offsets into glyphIdArray or 0, length = segCount
-	unsigned short glyphIdArray[];  // Glyph index array (arbitrary length)
+//	ufshort segCountX2;       // 2 x segCount
+	ufshort search_range;     // 2 x (2**floor(log_2(segCount)))
+	ufshort entry_selector;   // log_2(search_range/2)
+	ufshort range_shift;      // 2 x segCount - search_range
+	ufshort end_count[1];     // end characterCode for each segment, last =0xFFFF, length =
segCount
+	ufshort reservedPad;      // = 0
+	ufshort start_count[1];   // Start character code for each segment, length = segCount
+	ufshort idDelta[1];       // Delta for all character codes in segment, length = segCount
+    ufshort idRangeOffset[1]; // Offsets into glyphIdArray or 0, length = segCount
+	ufshort glyphIdArray[];  // Glyph index array (arbitrary length)
 } Table_encode_4;
 */
 
 typedef struct
 {
-	short number_of_contours; // <0 for composite glyph
-    short xMin;
-	short yMin;
-	short xMax;
-	short yMax;
+	fshort number_of_contours; // <0 for composite glyph
+    fshort xMin;
+	fshort yMin;
+	fshort xMax;
+	fshort yMax;
 } Glyph_header;
 
-template<short n> // n = number_of_contours from Glyph_header
+template<fshort n> // n = number_of_contours from Glyph_header
 struct SimpleGlyphDescription
 {
-    unsigned short endPtsOfContours[n];
-	unsigned short instruction_length;
-//	unsigned char instructions[instruction_length];
-//	unsigned char flags[n];
-//	unsigned char(short) xCoordinates[n];
-//	unsigned char(short) yCoordinates[n];
+    ufshort endPtsOfContours[n];
+	ufshort instruction_length;
+//	ufchar instructions[instruction_length];
+//	ufchar flags[n];
+//	ufchar(fshort) xCoordinates[n];
+//	ufchar(fshort) yCoordinates[n];
 };
 
-int parseCmapTable(FILE* tt_file, TableEncode* te);
-int parseNameTable(FILE* tt_file, wchar_t** familyName, wchar_t** psName, StyleName* fontStyle);
-int parseHeadTable(FILE* tt_file, float* bbox, short* format, unsigned short* unitsPerEm);
-int parseHheaTable(FILE* tt_file, unsigned short* numOfHMetrics, float* ascent, float* descent,
float* lineGap);
-int parseMaxpTable(FILE* tt_file, unsigned short *numGlyphs);
-int parseLocaTable(FILE* tt_file, GlyphOffsets* gOffsets, unsigned short numGlyphs);
-int parseOs2Table(FILE* tt_file, float* strikeOutSize, float* strikeOutOffset);
-int parsePostTable(FILE* tt_file, short* uOffset, short* uThickness);
-int parseGlyphData(FILE* tt_file, const GlyphOffsets gO, unsigned short numGlyphs, unsigned
short glyphIndex, TTCurve *curve, short* bRect, float transform);
-int parseHmtxTable(FILE* tt_file, unsigned short numOfHMetrics, HMetrics** hm);
-bool isCompositeGlyph(FILE* tt_file, const GlyphOffsets gO, unsigned short numGlyphs, unsigned
short glyphIndex);
+fint parseCmapTable(FILE* tt_file, TableEncode* te);
+fint parseNameTable(FILE* tt_file, fwchar_t** familyName, fwchar_t** psName, StyleName* fontStyle);
+fint parseHeadTable(FILE* tt_file, ffloat* bbox, fshort* format, ufshort* unitsPerEm);
+fint parseHheaTable(FILE* tt_file, ufshort* numOfHMetrics, ffloat* ascent, ffloat* descent,
ffloat* lineGap);
+fint parseMaxpTable(FILE* tt_file, ufshort *numGlyphs);
+fint parseLocaTable(FILE* tt_file, GlyphOffsets* gOffsets, ufshort numGlyphs);
+fint parseOs2Table(FILE* tt_file, ffloat* strikeOutSize, ffloat* strikeOutOffset);
+fint parsePostTable(FILE* tt_file, fshort* uOffset, fshort* uThickness);
+fint parseGlyphData(FILE* tt_file, const GlyphOffsets gO, ufshort numGlyphs, ufshort glyphIndex,
TTCurve *curve, fshort* bRect, ffloat transform);
+fint parseHmtxTable(FILE* tt_file, ufshort numOfHMetrics, HMetrics** hm);
+bool isCompositeGlyph(FILE* tt_file, const GlyphOffsets gO, ufshort numGlyphs, ufshort glyphIndex);
 
 #endif

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/Type1Structs.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/Type1Structs.h?view=diff&rev=548327&r1=548326&r2=548327
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/Type1Structs.h
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/Type1Structs.h
Mon Jun 18 04:42:19 2007
@@ -25,51 +25,52 @@
 #include <map>
 #include "EncodedValue.h"
 #include "AGL.h"
+#include "TypeDefinition.h"
 
-typedef std::map<const unsigned short, EncodedValue*> Type1Map;
+typedef std::map<const ufshort, EncodedValue*> Type1Map;
 
-typedef std::map<unsigned short, unsigned short> Type1GlyphCodeMap;
+typedef std::map<ufshort, ufshort> Type1GlyphCodeMap;
 
-typedef std::map<unsigned short, char*> Type1AFMMap;
+typedef std::map<ufshort, fchar*> Type1AFMMap;
 
 typedef enum DecodeStateTag {HEADER, PRIVATE_DIR, SUBRS_MASSIVE, CHAR_STRING} DecodeState;
 
-typedef std::map<const char*, const unsigned short> Type1CharMap;//inner glyph number
-- unicode
+typedef std::map<const fchar*, const ufshort> Type1CharMap;//inner glyph number --
unicode
 
-static const unsigned short MAX_STR_LENGHT = 1024;
-static const unsigned short C1 = 52845;
-static const unsigned short C2 = 22719;
-static const unsigned short DEF_R_EXEC = 55665;
-static const unsigned short DEF_LENIV = 4;
-static const unsigned short DEF_R_CHARSTRING = 4330;
-
-static const unsigned char CH_STR_HSTEM = 1;
-static const unsigned char CH_STR_VSTEM = 3;
-static const unsigned char CH_STR_VMOVETO = 4;
-static const unsigned char CH_STR_RLINETO = 5;
-static const unsigned char CH_STR_HLINETO = 6;
-static const unsigned char CH_STR_VLINETO = 7;
-static const unsigned char CH_STR_RRCURVETO = 8;
-static const unsigned char CH_STR_CLOSEPATH = 9;
-static const unsigned char CH_STR_CALLSUBR = 10;
-static const unsigned char CH_STR_RETURN = 11;
-static const unsigned char CH_STR_ESCAPE = 12;
-static const unsigned char CH_STR_HSBW = 13;
-static const unsigned char CH_STR_ENDCHAR = 14;
-static const unsigned char CH_STR_RMOVETO = 21;
-static const unsigned char CH_STR_HMOVETO = 22;
-static const unsigned char CH_STR_VHCURVETO = 30;
-static const unsigned char CH_STR_HVCURVETO = 31;
-
-static const unsigned char CH_STR_ESCAPE_DOTSECTION = 0;
-static const unsigned char CH_STR_ESCAPE_VSTEM3 = 1;
-static const unsigned char CH_STR_ESCAPE_HSTEM3 = 2;
-static const unsigned char CH_STR_ESCAPE_SEAC = 6;
-static const unsigned char CH_STR_ESCAPE_SBW = 7;
-static const unsigned char CH_STR_ESCAPE_DIV = 12;
-static const unsigned char CH_STR_ESCAPE_CALLOTHERSUBR = 16;
-static const unsigned char CH_STR_ESCAPE_POP = 17;
-static const unsigned char CH_STR_ESCAPE_SETCURRENTPOINT = 33;
+static const ufshort MAX_STR_LENGHT = 1024;
+static const ufshort C1 = 52845;
+static const ufshort C2 = 22719;
+static const ufshort DEF_R_EXEC = 55665;
+static const ufshort DEF_LENIV = 4;
+static const ufshort DEF_R_CHARSTRING = 4330;
+
+static const ufchar CH_STR_HSTEM = 1;
+static const ufchar CH_STR_VSTEM = 3;
+static const ufchar CH_STR_VMOVETO = 4;
+static const ufchar CH_STR_RLINETO = 5;
+static const ufchar CH_STR_HLINETO = 6;
+static const ufchar CH_STR_VLINETO = 7;
+static const ufchar CH_STR_RRCURVETO = 8;
+static const ufchar CH_STR_CLOSEPATH = 9;
+static const ufchar CH_STR_CALLSUBR = 10;
+static const ufchar CH_STR_RETURN = 11;
+static const ufchar CH_STR_ESCAPE = 12;
+static const ufchar CH_STR_HSBW = 13;
+static const ufchar CH_STR_ENDCHAR = 14;
+static const ufchar CH_STR_RMOVETO = 21;
+static const ufchar CH_STR_HMOVETO = 22;
+static const ufchar CH_STR_VHCURVETO = 30;
+static const ufchar CH_STR_HVCURVETO = 31;
+
+static const ufchar CH_STR_ESCAPE_DOTSECTION = 0;
+static const ufchar CH_STR_ESCAPE_VSTEM3 = 1;
+static const ufchar CH_STR_ESCAPE_HSTEM3 = 2;
+static const ufchar CH_STR_ESCAPE_SEAC = 6;
+static const ufchar CH_STR_ESCAPE_SBW = 7;
+static const ufchar CH_STR_ESCAPE_DIV = 12;
+static const ufchar CH_STR_ESCAPE_CALLOTHERSUBR = 16;
+static const ufchar CH_STR_ESCAPE_POP = 17;
+static const ufchar CH_STR_ESCAPE_SETCURRENTPOINT = 33;
 
 //#define GLYPH_OUTLINE_CREATE_DEBUG
 

Added: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.cpp?view=auto&rev=548327
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.cpp
(added)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.cpp
Mon Jun 18 04:42:19 2007
@@ -0,0 +1,29 @@
+#include "TypeDefinition.h"
+
+fint fwcslen(fwchar_t* str)
+{
+	fint counter=0;
+	fwchar_t* tmpstr = str;
+	while(*tmpstr != 0)
+	{
+		tmpstr++;
+		counter++;
+	}
+	return counter;
+}
+
+fint fwcscmp(fwchar_t* str1, fwchar_t* str2)
+{
+	fwchar_t* tmpstr1 = str1; 
+	fwchar_t* tmpstr2 = str2;
+	while(*tmpstr1 != 0 || *tmpstr2 !=0)
+	{
+        if (*tmpstr1 != *tmpstr2)
+			return -1;
+
+		tmpstr1++;
+		tmpstr2++;
+	}
+
+	return 0;
+}
\ No newline at end of file

Propchange: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.h?view=auto&rev=548327
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.h
(added)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.h
Mon Jun 18 04:42:19 2007
@@ -0,0 +1,35 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+#ifndef __TYPEDEFINITION_H__
+#define __TYPEDEFINITION_H__
+
+typedef int fint;
+typedef long flong;
+typedef unsigned long uflong;
+typedef double fdouble;
+typedef float ffloat;
+typedef unsigned char ufchar;
+typedef char fchar;
+typedef unsigned short ufshort;
+typedef short fshort;
+typedef unsigned short fwchar_t;
+
+fint fwcslen(fwchar_t* str);
+fint fwcscmp(fwchar_t* str1, fwchar_t* str2);
+
+#endif

Propchange: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/fljni.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/fljni.cpp?view=diff&rev=548327&r1=548326&r2=548327
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/fljni.cpp (original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/fljni.cpp Mon
Jun 18 04:42:19 2007
@@ -31,24 +31,24 @@
 JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_font_fontlib_FLFontManager_initManager
 (JNIEnv *env, jobject obj) {
 
-//    jboolean iscopy;
+    //jboolean iscopy;
 
     //printf("getting fonts...\n");
-    Environment::getAllFonts();
+    //Environment::getAllFonts();
     //printf("fonts added\n");
-#ifdef WIN32    
-	//char *nativePath = (char *)(env->GetStringUTFChars(path, &iscopy));
+//#ifdef WIN32    
+	//fchar *nativePath = (fchar *)(env->GetStringUTFChars(path, &iscopy));
 
     //Environment::addPath(nativePath);
 
 	//env->ReleaseStringUTFChars(path, nativePath);
-#endif 
+//#endif 
 
 
     fontClass = env->FindClass("java/awt/Font");
     outlineClass = env->FindClass("org/apache/harmony/awt/gl/font/fontlib/FLOutline");
   
     fontConstructor = env->GetMethodID(fontClass, "<init>", "(Ljava/lang/String;II)V");
-    setOutline = env->GetMethodID(outlineClass, "setOutline", "([B[F)V");
+    setOutline = env->GetMethodID(outlineClass, "setOutline", "([B[F)V");    
 }
 
 /*
@@ -59,7 +59,7 @@
 JNIEXPORT jobjectArray JNICALL Java_org_apache_harmony_awt_gl_font_fontlib_FLFontManager_getAllFontsNative
 (JNIEnv *env, jobject obj) {
 
-    Environment::getAllFonts();
+    Environment::getAllFonts();    
 
     if (Environment::_length == 0) return NULL;
 
@@ -69,23 +69,23 @@
 
     FontHeader *fh = Environment::getAllFonts();
 
-    for (unsigned short i = 0; i < Environment::_length; i ++){
-#ifndef WIN32
-        unsigned short fName[wcslen((wchar_t *)fh->_familyName)];
-	for(unsigned short a = 0; a<wcslen(fh->_familyName); a++){
-		fName[a]=(unsigned short)(fh->_familyName[a]);
-	}
-#endif
+    for (ufshort i = 0; i < Environment::_length; i ++){
+/*#ifndef WIN32
+		ufshort fName[fwcslen((fwchar_t *)fh->_familyName)];
+		for(ufshort a = 0; a<fwcslen(fh->_familyName); a++){
+			fName[a]=(ufshort)(fh->_familyName[a]);
+		}
+#endif*/
 
         env->SetObjectArrayElement(fonts, i, env->NewObject(
             fontClass, 
             fontConstructor, 
-#ifdef WIN32
-	    env->NewString((jchar *)fh->_familyName, (jsize) wcslen((wchar_t *)fh->_familyName)),
-#else
-            env->NewString((jchar*)fName, (jsize) wcslen((wchar_t *)fh->_familyName)),
-#endif
-            (jint) (char) fh->_style,
+//#ifdef WIN32
+	    env->NewString((jchar *)fh->_familyName, (jsize) fwcslen((fwchar_t *)fh->_familyName)),
+/*#else
+            env->NewString((jchar*)fName, (jsize) fwcslen((fwchar_t *)fh->_familyName)),
+#endif*/
+            (jint) (fchar) fh->_style,
             (jint) 1
             ));
         fh = fh->_nextHeader;
@@ -95,24 +95,25 @@
 }
 
 JNIEXPORT jobject JNICALL Java_org_apache_harmony_awt_gl_font_fontlib_FLFontManager_addFont
-(JNIEnv *env, jobject obj, jstring fontPath, jint type) {
+(JNIEnv *env, jobject obj, jstring fontPath, jint type) {    
+
     jboolean iscopy;
 
     fontClass = env->FindClass("java/awt/Font");
 
-	char *nativePath = (char *)(env->GetStringUTFChars(fontPath, &iscopy));
+	fchar *nativePath = (fchar *)(env->GetStringUTFChars(fontPath, &iscopy));
     
     FontHeader *fh = Environment::addFile(nativePath, (FontType)type);
 
-	env->ReleaseStringUTFChars(fontPath, nativePath);
+	env->ReleaseStringUTFChars(fontPath, nativePath);    
 
     if (fh == NULL) return NULL;
 
     return env->NewObject(
             fontClass, 
             fontConstructor, 
-            env->NewString((jchar *)fh->_familyName, (jsize) wcslen((wchar_t *)fh->_familyName)),
-            (jint) (char) fh->_style,
+            env->NewString((jchar *)fh->_familyName, (jsize) fwcslen((fwchar_t *)fh->_familyName)),
+            (jint) (fchar) fh->_style,
             (jint) 1
             );
 }
@@ -136,9 +137,9 @@
 (JNIEnv *env, jobject obj, jstring fontName, jint style) {
     jboolean iscopy;
 
-	//char *getenv( const char *name );	
+	//fchar *getenv( const fchar *name );	
 
-	char *tName = (char *)(env->GetStringUTFChars(fontName, &iscopy));
+	fchar *tName = (fchar *)(env->GetStringUTFChars(fontName, &iscopy));
 			
 	Font *font = createFont(tName, (StyleName) style);
 
@@ -151,7 +152,7 @@
 	#ifdef WIN32
     return (jlong) font;
     #else
-    return (jlong) (long) font;
+    return (jlong) (flong) font;
     #endif
 }
 
@@ -165,15 +166,15 @@
     #ifdef WIN32
     Font *font = (Font *) ptr;
     #else
-    Font *font = (Font *) (long)ptr;
+    Font *font = (Font *) (flong)ptr;
     #endif
 
     jfloatArray metrics = env->NewFloatArray((jsize) FONT_METRICS_QUANTITY);
-    float *buffer = (float *)env->GetPrimitiveArrayCritical(metrics, NULL);
+    ffloat *buffer = (ffloat *)env->GetPrimitiveArrayCritical(metrics, NULL);
 
 //printf("getting line metrics...\n");
-    float *lineMetrics;
-    memcpy(buffer, lineMetrics = font->getLineMetrics(), FONT_METRICS_QUANTITY * sizeof(float));
+    ffloat *lineMetrics;
+    memcpy(buffer, lineMetrics = font->getLineMetrics(), FONT_METRICS_QUANTITY * sizeof(ffloat));
 //printf("line metrics gotten");
 
     delete[] lineMetrics;
@@ -193,12 +194,12 @@
     #ifdef WIN32
     Font *font = (Font *) ptr;
     #else
-    Font *font = (Font *) (long)ptr;
+    Font *font = (Font *) (flong)ptr;
     #endif
 
-    wchar_t *psName = font->getPSName();
+    fwchar_t *psName = font->getPSName();
 
-    return env->NewString((jchar *) psName, (jsize) wcslen(psName));
+    return env->NewString((jchar *) psName, (jsize) fwcslen(psName));
 }
 
 /*
@@ -211,7 +212,7 @@
     #ifdef WIN32
     Font *font = (Font *) ptr;
     #else
-    Font *font = (Font *) (long)ptr;
+    Font *font = (Font *) (flong)ptr;
     #endif    
 
     return (jint) font->getMissingGlyphCode();
@@ -222,10 +223,10 @@
     #ifdef WIN32
     Font *font = (Font *) ptr;
     #else
-    Font *font = (Font *) (long)ptr;
+    Font *font = (Font *) (flong)ptr;
     #endif
 
-    return (jchar) font->getUnicodeByIndex((unsigned short) index);
+    return (jchar) font->getUnicodeByIndex((ufshort) index);
 }
 
 /*
@@ -238,7 +239,7 @@
     #ifdef WIN32
     delete (Font *) ptr;
     #else
-    delete (Font *) (long) ptr;
+    delete (Font *) (flong) ptr;
     #endif
 }
 
@@ -252,10 +253,10 @@
     #ifdef WIN32
     Font *font = (Font *) ptr;
     #else
-    Font *font = (Font *) (long)ptr;
+    Font *font = (Font *) (flong)ptr;
     #endif
 
-    return font->canDisplay((unsigned short)ch);
+    return font->canDisplay((ufshort)ch);
 }
 
 /*
@@ -268,14 +269,14 @@
     #ifdef WIN32
     Glyph *glyph = (Glyph *) ptr;
     #else
-    Glyph *glyph = (Glyph *) (long)ptr;
+    Glyph *glyph = (Glyph *) (flong)ptr;
     #endif
 
 
     jfloatArray metrics = env->NewFloatArray((jsize) GLYPH_METRICS_QUANTITY);
-    float *buffer = (float *)env->GetPrimitiveArrayCritical(metrics, NULL);
+    ffloat *buffer = (ffloat *)env->GetPrimitiveArrayCritical(metrics, NULL);
 
-    memcpy(buffer, glyph->getGlyphMetrics(), GLYPH_METRICS_QUANTITY * sizeof(float));
+    memcpy(buffer, glyph->getGlyphMetrics(), GLYPH_METRICS_QUANTITY * sizeof(ffloat));
 
     env->ReleasePrimitiveArrayCritical(metrics, buffer, 0);
 
@@ -291,10 +292,10 @@
 (JNIEnv *env, jobject obj, jchar ch, jint size, jlong ptr) {
     #ifdef WIN32
     Font *font = (Font *) ptr;
-    return (jlong) font->getGlyph((unsigned short) ch, (unsigned short) size);
+    return (jlong) font->getGlyph((ufshort) ch, (ufshort) size);
     #else
-    Font *font = (Font *) (long)ptr;
-    return (jlong) (long) font->getGlyph((unsigned short) ch, (unsigned short) size);
+    Font *font = (Font *) (flong)ptr;
+    return (jlong) (flong) font->getGlyph((ufshort) ch, (ufshort) size);
     #endif
 }
 
@@ -308,7 +309,7 @@
     #ifdef WIN32
     Glyph *glyph = (Glyph *) ptr;
     #else
-    Glyph *glyph = (Glyph *) (long)ptr;
+    Glyph *glyph = (Glyph *) (flong)ptr;
     #endif    
 
     Outline* out = glyph->getOutline(); 
@@ -316,7 +317,7 @@
     out->trim();
 
     jbyteArray commands = env->NewByteArray((jsize) out->getCommandLength());
-    unsigned char *native_buffer = (unsigned char *)env->GetPrimitiveArrayCritical(commands,
NULL);
+    ufchar *native_buffer = (ufchar *)env->GetPrimitiveArrayCritical(commands, NULL);
 
     memcpy(native_buffer, out->_commands, out->getCommandLength());
 
@@ -324,9 +325,9 @@
 
 
     jfloatArray points = env->NewFloatArray((jsize) out->getPointsLength());
-    float *buffer = (float *)env->GetPrimitiveArrayCritical(points, NULL);
+    ffloat *buffer = (ffloat *)env->GetPrimitiveArrayCritical(points, NULL);
 
-    memcpy(buffer, out->_points, out->getPointsLength() * sizeof(float));
+    memcpy(buffer, out->_points, out->getPointsLength() * sizeof(ffloat));
 
     env->ReleasePrimitiveArrayCritical(points, buffer, 0);
 

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/include/fljni.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/include/fljni.h?view=diff&rev=548327&r1=548326&r2=548327
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/include/fljni.h
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/include/fljni.h
Mon Jun 18 04:42:19 2007
@@ -24,6 +24,7 @@
 #include "org_apache_harmony_awt_gl_font_fontlib_FLFontPeer.h"
 
 #include "Environment.h"
+#include "TypeDefinition.h"
 #include "Font.h"
 
 //#include <stdlib.h>

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/unix/makefile?view=diff&rev=548327&r1=548326&r2=548327
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/unix/makefile (original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/unix/makefile Mon
Jun 18 04:42:19 2007
@@ -16,7 +16,7 @@
 include $(HY_HDK)/build/make/defines.mk
 
 CFLAGS += -fpic
-INCLUDES += -I$(SHARED)common -I$(SHAREDSUB)include -I$(PNG_DIR)
+INCLUDES += -I$(SHARED)common -I$(SHAREDSUB)include
 
 BUILDFILES = \
   $(SHAREDSUB)fljni.o \
@@ -29,10 +29,14 @@
   $(SHAREDSUB)T1Font.o \
   $(SHAREDSUB)T1Glyph.o \
   $(SHAREDSUB)TTCurve.o \
-  $(SHAREDSUB)TTFont.o
+  $(SHAREDSUB)TTFont.o \
+  $(SHAREDSUB)TypeDefinition.o
+
+ifneq ($(HY_ZIP_API),true)
+MDLLIBFILES += $(LIBPATH)libhyzip.a $(DLLPATH)libhyzlib$(HY_LINKLIB_SUFFIX)
+endif
 
 MDLLIBFILES += \
-	$(LIBPATH)libhyzip.a $(DLLPATH)libhyzlib.so \
 	$(LIBPATH)libhypool.a $(LIBPATH)libhyfdlibm.a $(LIBPATH)libvmi.so
 
 OSLIBS += $(STDCLIBS)

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/windows/makefile?view=diff&rev=548327&r1=548326&r2=548327
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/windows/makefile (original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/windows/makefile Mon
Jun 18 04:42:19 2007
@@ -34,7 +34,8 @@
   $(SHAREDSUB)T1Font.obj \
   $(SHAREDSUB)T1Glyph.obj \
   $(SHAREDSUB)TTCurve.obj \
-  $(SHAREDSUB)TTFont.obj
+  $(SHAREDSUB)TTFont.obj \
+  $(SHAREDSUB)TypeDefinition.obj
 
 VIRTFILES = $(LIBBASE).res
 SYSLIBFILES = ws2_32.lib Iphlpapi.lib



Mime
View raw message