ICU-3979 Fix compiler warnings.
X-SVN-Rev: 19527
This commit is contained in:
parent
035d116c8b
commit
ca9fcb4e10
@ -1,7 +1,7 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 1999-2005, International Business Machines
|
||||
* Copyright (C) 1999-2006, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
@ -20,6 +20,16 @@ U_NAMESPACE_BEGIN
|
||||
|
||||
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(LEFontInstance)
|
||||
|
||||
LECharMapper::~LECharMapper()
|
||||
{
|
||||
// nothing to do.
|
||||
}
|
||||
|
||||
LEFontInstance::~LEFontInstance()
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
const LEFontInstance *LEFontInstance::getSubFont(const LEUnicode chars[], le_int32 *offset, le_int32 limit,
|
||||
le_int32 script, LEErrorCode &success) const
|
||||
{
|
||||
@ -86,5 +96,54 @@ LEGlyphID LEFontInstance::mapCharToGlyph(LEUnicode32 ch, const LECharMapper *map
|
||||
|
||||
return mapCharToGlyph(mappedChar);
|
||||
}
|
||||
|
||||
le_bool LEFontInstance::canDisplay(LEUnicode32 ch) const
|
||||
{
|
||||
return LE_GET_GLYPH(mapCharToGlyph(ch)) != 0;
|
||||
}
|
||||
|
||||
float LEFontInstance::xUnitsToPoints(float xUnits) const
|
||||
{
|
||||
return (xUnits * getXPixelsPerEm()) / (float) getUnitsPerEM();
|
||||
}
|
||||
|
||||
float LEFontInstance::yUnitsToPoints(float yUnits) const
|
||||
{
|
||||
return (yUnits * getYPixelsPerEm()) / (float) getUnitsPerEM();
|
||||
}
|
||||
|
||||
void LEFontInstance::unitsToPoints(LEPoint &units, LEPoint &points) const
|
||||
{
|
||||
points.fX = xUnitsToPoints(units.fX);
|
||||
points.fY = yUnitsToPoints(units.fY);
|
||||
}
|
||||
|
||||
float LEFontInstance::xPixelsToUnits(float xPixels) const
|
||||
{
|
||||
return (xPixels * getUnitsPerEM()) / (float) getXPixelsPerEm();
|
||||
}
|
||||
|
||||
float LEFontInstance::yPixelsToUnits(float yPixels) const
|
||||
{
|
||||
return (yPixels * getUnitsPerEM()) / (float) getYPixelsPerEm();
|
||||
}
|
||||
|
||||
void LEFontInstance::pixelsToUnits(LEPoint &pixels, LEPoint &units) const
|
||||
{
|
||||
units.fX = xPixelsToUnits(pixels.fX);
|
||||
units.fY = yPixelsToUnits(pixels.fY);
|
||||
}
|
||||
|
||||
void LEFontInstance::transformFunits(float xFunits, float yFunits, LEPoint &pixels) const
|
||||
{
|
||||
pixels.fX = xUnitsToPoints(xFunits) * getScaleFactorX();
|
||||
pixels.fY = yUnitsToPoints(yFunits) * getScaleFactorY();
|
||||
}
|
||||
|
||||
le_int32 LEFontInstance::getLineHeight() const
|
||||
{
|
||||
return getAscent() + getDescent() + getLeading();
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/*
|
||||
*
|
||||
* (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved
|
||||
* (C) Copyright IBM Corp. 1998-2006 - All Rights Reserved
|
||||
*
|
||||
*/
|
||||
|
||||
@ -32,7 +32,7 @@ public:
|
||||
* Destructor.
|
||||
* @stable ICU 3.2
|
||||
*/
|
||||
virtual inline ~LECharMapper() {};
|
||||
virtual ~LECharMapper();
|
||||
|
||||
/**
|
||||
* This method does the adjustments.
|
||||
@ -88,7 +88,7 @@ public:
|
||||
*
|
||||
* @stable ICU 2.8
|
||||
*/
|
||||
virtual inline ~LEFontInstance() {};
|
||||
virtual ~LEFontInstance();
|
||||
|
||||
/**
|
||||
* Get a physical font which can render the given text. For composite fonts,
|
||||
@ -181,7 +181,7 @@ public:
|
||||
*
|
||||
* @stable ICU 3.2
|
||||
*/
|
||||
virtual inline le_bool canDisplay(LEUnicode32 ch) const;
|
||||
virtual le_bool canDisplay(LEUnicode32 ch) const;
|
||||
|
||||
/**
|
||||
* This method returns the number of design units in
|
||||
@ -324,7 +324,7 @@ public:
|
||||
*
|
||||
* @stable ICU 3.2
|
||||
*/
|
||||
virtual inline float xUnitsToPoints(float xUnits) const;
|
||||
virtual float xUnitsToPoints(float xUnits) const;
|
||||
|
||||
/**
|
||||
* This method converts font design units in the
|
||||
@ -336,7 +336,7 @@ public:
|
||||
*
|
||||
* @stable ICU 3.2
|
||||
*/
|
||||
virtual inline float yUnitsToPoints(float yUnits) const;
|
||||
virtual float yUnitsToPoints(float yUnits) const;
|
||||
|
||||
/**
|
||||
* This method converts font design units to points.
|
||||
@ -346,7 +346,7 @@ public:
|
||||
*
|
||||
* @stable ICU 3.2
|
||||
*/
|
||||
virtual inline void unitsToPoints(LEPoint &units, LEPoint &points) const;
|
||||
virtual void unitsToPoints(LEPoint &units, LEPoint &points) const;
|
||||
|
||||
/**
|
||||
* This method converts pixels in the
|
||||
@ -358,7 +358,7 @@ public:
|
||||
*
|
||||
* @stable ICU 3.2
|
||||
*/
|
||||
virtual inline float xPixelsToUnits(float xPixels) const;
|
||||
virtual float xPixelsToUnits(float xPixels) const;
|
||||
|
||||
/**
|
||||
* This method converts pixels in the
|
||||
@ -370,7 +370,7 @@ public:
|
||||
*
|
||||
* @stable ICU 3.2
|
||||
*/
|
||||
virtual inline float yPixelsToUnits(float yPixels) const;
|
||||
virtual float yPixelsToUnits(float yPixels) const;
|
||||
|
||||
/**
|
||||
* This method converts pixels to font design units.
|
||||
@ -380,7 +380,7 @@ public:
|
||||
*
|
||||
* @stable ICU 3.2
|
||||
*/
|
||||
virtual inline void pixelsToUnits(LEPoint &pixels, LEPoint &units) const;
|
||||
virtual void pixelsToUnits(LEPoint &pixels, LEPoint &units) const;
|
||||
|
||||
/**
|
||||
* Get the X scale factor from the font's transform. The default
|
||||
@ -422,7 +422,7 @@ public:
|
||||
*
|
||||
* @stable ICU 3.2
|
||||
*/
|
||||
virtual inline void transformFunits(float xFunits, float yFunits, LEPoint &pixels) const;
|
||||
virtual void transformFunits(float xFunits, float yFunits, LEPoint &pixels) const;
|
||||
|
||||
/**
|
||||
* This is a convenience method used to convert
|
||||
@ -512,49 +512,6 @@ public:
|
||||
|
||||
};
|
||||
|
||||
inline le_bool LEFontInstance::canDisplay(LEUnicode32 ch) const
|
||||
{
|
||||
return LE_GET_GLYPH(mapCharToGlyph(ch)) != 0;
|
||||
}
|
||||
|
||||
inline float LEFontInstance::xUnitsToPoints(float xUnits) const
|
||||
{
|
||||
return (xUnits * getXPixelsPerEm()) / (float) getUnitsPerEM();
|
||||
}
|
||||
|
||||
inline float LEFontInstance::yUnitsToPoints(float yUnits) const
|
||||
{
|
||||
return (yUnits * getYPixelsPerEm()) / (float) getUnitsPerEM();
|
||||
}
|
||||
|
||||
inline void LEFontInstance::unitsToPoints(LEPoint &units, LEPoint &points) const
|
||||
{
|
||||
points.fX = xUnitsToPoints(units.fX);
|
||||
points.fY = yUnitsToPoints(units.fY);
|
||||
}
|
||||
|
||||
inline float LEFontInstance::xPixelsToUnits(float xPixels) const
|
||||
{
|
||||
return (xPixels * getUnitsPerEM()) / (float) getXPixelsPerEm();
|
||||
}
|
||||
|
||||
inline float LEFontInstance::yPixelsToUnits(float yPixels) const
|
||||
{
|
||||
return (yPixels * getUnitsPerEM()) / (float) getYPixelsPerEm();
|
||||
}
|
||||
|
||||
inline void LEFontInstance::pixelsToUnits(LEPoint &pixels, LEPoint &units) const
|
||||
{
|
||||
units.fX = xPixelsToUnits(pixels.fX);
|
||||
units.fY = yPixelsToUnits(pixels.fY);
|
||||
}
|
||||
|
||||
inline void LEFontInstance::transformFunits(float xFunits, float yFunits, LEPoint &pixels) const
|
||||
{
|
||||
pixels.fX = xUnitsToPoints(xFunits) * getScaleFactorX();
|
||||
pixels.fY = yUnitsToPoints(yFunits) * getScaleFactorY();
|
||||
}
|
||||
|
||||
inline float LEFontInstance::fixedToFloat(le_int32 fixed)
|
||||
{
|
||||
return (float) (fixed / 65536.0);
|
||||
@ -565,11 +522,6 @@ inline le_int32 LEFontInstance::floatToFixed(float theFloat)
|
||||
return (le_int32) (theFloat * 65536.0);
|
||||
}
|
||||
|
||||
inline le_int32 LEFontInstance::getLineHeight() const
|
||||
{
|
||||
return getAscent() + getDescent() + getLeading();
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
||||
#endif
|
||||
|
||||
|
@ -335,3 +335,52 @@ le_bool PortableFontInstance::getGlyphPoint(LEGlyphID /*glyph*/, le_int32 /*poin
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
le_int32 PortableFontInstance::getUnitsPerEM() const
|
||||
{
|
||||
return fUnitsPerEM;
|
||||
};
|
||||
|
||||
le_uint32 PortableFontInstance::getFontChecksum() const
|
||||
{
|
||||
return fFontChecksum;
|
||||
}
|
||||
|
||||
le_int32 PortableFontInstance::getAscent() const
|
||||
{
|
||||
return fAscent;
|
||||
}
|
||||
|
||||
le_int32 PortableFontInstance::getDescent() const
|
||||
{
|
||||
return fDescent;
|
||||
}
|
||||
|
||||
le_int32 PortableFontInstance::getLeading() const
|
||||
{
|
||||
return fLeading;
|
||||
}
|
||||
|
||||
LEGlyphID PortableFontInstance::mapCharToGlyph(LEUnicode32 ch) const
|
||||
{
|
||||
return fCMAPMapper->unicodeToGlyph(ch);
|
||||
}
|
||||
|
||||
float PortableFontInstance::getXPixelsPerEm() const
|
||||
{
|
||||
return fPointSize;
|
||||
};
|
||||
|
||||
float PortableFontInstance::getYPixelsPerEm() const
|
||||
{
|
||||
return fPointSize;
|
||||
};
|
||||
|
||||
float PortableFontInstance::getScaleFactorX() const
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
float PortableFontInstance::getScaleFactorY() const
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 1999-2005, International Business Machines
|
||||
* Copyright (C) 1999-2006, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
@ -77,59 +77,32 @@ public:
|
||||
|
||||
virtual void deleteNameString(const char *name) const;
|
||||
|
||||
virtual le_int32 getUnitsPerEM() const
|
||||
{
|
||||
return fUnitsPerEM;
|
||||
};
|
||||
virtual le_int32 getUnitsPerEM() const;
|
||||
|
||||
virtual le_uint32 getFontChecksum() const
|
||||
{
|
||||
return fFontChecksum;
|
||||
}
|
||||
virtual le_uint32 getFontChecksum() const;
|
||||
|
||||
virtual le_int32 getAscent() const
|
||||
{
|
||||
return fAscent;
|
||||
}
|
||||
virtual le_int32 getAscent() const;
|
||||
|
||||
virtual le_int32 getDescent() const
|
||||
{
|
||||
return fDescent;
|
||||
}
|
||||
virtual le_int32 getDescent() const;
|
||||
|
||||
virtual le_int32 getLeading() const
|
||||
{
|
||||
return fLeading;
|
||||
}
|
||||
virtual le_int32 getLeading() const;
|
||||
|
||||
virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch) const
|
||||
{
|
||||
return fCMAPMapper->unicodeToGlyph(ch);
|
||||
}
|
||||
//virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper, le_bool filterZeroWidth) const;
|
||||
//virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper) const;
|
||||
|
||||
virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch) const;
|
||||
|
||||
virtual void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const;
|
||||
|
||||
virtual le_bool getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const;
|
||||
|
||||
float getXPixelsPerEm() const
|
||||
{
|
||||
return fPointSize;
|
||||
};
|
||||
float getXPixelsPerEm() const;
|
||||
|
||||
float getYPixelsPerEm() const
|
||||
{
|
||||
return fPointSize;
|
||||
};
|
||||
float getYPixelsPerEm() const;
|
||||
|
||||
float getScaleFactorX() const
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
float getScaleFactorX() const;
|
||||
|
||||
float getScaleFactorY() const
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
float getScaleFactorY() const;
|
||||
|
||||
};
|
||||
|
||||
|
@ -62,6 +62,51 @@ void SimpleFontInstance::getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) cons
|
||||
advance.fY = 0;
|
||||
}
|
||||
|
||||
le_int32 SimpleFontInstance::getUnitsPerEM() const
|
||||
{
|
||||
return 2048;
|
||||
};
|
||||
|
||||
le_int32 SimpleFontInstance::getAscent() const
|
||||
{
|
||||
return fAscent;
|
||||
}
|
||||
|
||||
le_int32 SimpleFontInstance::getDescent() const
|
||||
{
|
||||
return fDescent;
|
||||
}
|
||||
|
||||
le_int32 SimpleFontInstance::getLeading() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
LEGlyphID SimpleFontInstance::mapCharToGlyph(LEUnicode32 ch) const
|
||||
{
|
||||
return (LEGlyphID) ch;
|
||||
}
|
||||
|
||||
float SimpleFontInstance::getXPixelsPerEm() const
|
||||
{
|
||||
return fPointSize;
|
||||
};
|
||||
|
||||
float SimpleFontInstance::getYPixelsPerEm() const
|
||||
{
|
||||
return fPointSize;
|
||||
};
|
||||
|
||||
float SimpleFontInstance::getScaleFactorX() const
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
float SimpleFontInstance::getScaleFactorY() const
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
le_bool SimpleFontInstance::getGlyphPoint(LEGlyphID /*glyph*/, le_int32 /*pointNumber*/, LEPoint &/*point*/) const
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -37,54 +37,30 @@ public:
|
||||
|
||||
virtual const void *getFontTable(LETag tableTag) const;
|
||||
|
||||
virtual le_int32 getUnitsPerEM() const
|
||||
{
|
||||
return 2048;
|
||||
};
|
||||
virtual le_int32 getUnitsPerEM() const;
|
||||
|
||||
virtual le_int32 getAscent() const
|
||||
{
|
||||
return fAscent;
|
||||
}
|
||||
virtual le_int32 getAscent() const;
|
||||
|
||||
virtual le_int32 getDescent() const
|
||||
{
|
||||
return fDescent;
|
||||
}
|
||||
virtual le_int32 getDescent() const;
|
||||
|
||||
virtual le_int32 getLeading() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
virtual le_int32 getLeading() const;
|
||||
|
||||
virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch) const
|
||||
{
|
||||
return (LEGlyphID) ch;
|
||||
}
|
||||
//virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper, le_bool filterZeroWidth) const;
|
||||
//virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper) const;
|
||||
|
||||
virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch) const;
|
||||
|
||||
virtual void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const;
|
||||
|
||||
virtual le_bool getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const;
|
||||
|
||||
float getXPixelsPerEm() const
|
||||
{
|
||||
return fPointSize;
|
||||
};
|
||||
float getXPixelsPerEm() const;
|
||||
|
||||
float getYPixelsPerEm() const
|
||||
{
|
||||
return fPointSize;
|
||||
};
|
||||
float getYPixelsPerEm() const;
|
||||
|
||||
float getScaleFactorX() const
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
float getScaleFactorX() const;
|
||||
|
||||
float getScaleFactorY() const
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
float getScaleFactorY() const;
|
||||
|
||||
};
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
#include "unicode/uclean.h"
|
||||
#include "unicode/ucnv.h"
|
||||
#include "unicode/uchar.h"
|
||||
#include "unicode/unistr.h"
|
||||
#include "unicode/uscript.h"
|
||||
@ -860,8 +859,6 @@ int main(int argc, char* argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
fprintf(stdout, "Default charset for this run is %s\n", ucnv_getDefaultName());
|
||||
|
||||
addAllTests(&root);
|
||||
nerrors = processArgs(root, argc, argv);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user