/*
*
- * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
+ * (C) Copyright IBM Corp. 1998-2015 - All Rights Reserved
*
*/
#define __LEFONTINSTANCE_H
#include "LETypes.h"
+/**
+ * \file
+ * \brief C++ API: Layout Engine Font Instance object
+ */
U_NAMESPACE_BEGIN
* and character mirroring - replacing a character which has both a left and a right
* hand form with the opposite form.
*
- * @draft ICU 2.2
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
class LECharMapper /* not : public UObject because this is an interface/mixin class */
{
public:
/**
* Destructor.
- * @draft ICU 2.4
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
- virtual inline ~LECharMapper() {};
+ virtual ~LECharMapper();
/**
* This method does the adjustments.
*
* @return the adjusted character
*
- * @stable ICU 2.8
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual LEUnicode32 mapChar(LEUnicode32 ch) const = 0;
};
* This is a forward reference to the class which holds the per-glyph
* storage.
*
- * @draft ICU 3.0
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
class LEGlyphStorage;
* methods with some default behavior such as returning constant values, or using the
* values from the first subfont.
*
- * @draft ICU 3.0
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
class U_LAYOUT_API LEFontInstance : public UObject
{
* This virtual destructor is here so that the subclass
* destructors can be invoked through the base class.
*
- * @stable ICU 2.8
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
- virtual inline ~LEFontInstance() {};
+ virtual ~LEFontInstance();
/**
* Get a physical font which can render the given text. For composite fonts,
* <code>this</code> and indicates that the entire string can be rendered.
*
* This method will return a valid <code>LEFontInstance</code> unless you
- * have passed illegal parameters, or an internal error has been encountered.
+ * have passed illegal parameters, or an internal error has been encountered.
* For composite fonts, it may return the warning <code>LE_NO_SUBFONT_WARNING</code>
* to indicate that the returned font may not be able to render all of
* the text. Whenever a valid font is returned, the <code>offset</code> parameter
*
* @see LEScripts.h
*
- * @draft ICU 2.6
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual const LEFontInstance *getSubFont(const LEUnicode chars[], le_int32 *offset, le_int32 limit, le_int32 script, LEErrorCode &success) const;
*
* Subclasses which represent composite fonts should always return <code>NULL</code>.
*
- * @param tableTag - the four byte table tag. (e.g. 'cmap')
- *
+ * @param tableTag - the four byte table tag. (e.g. 'cmap')
+ * @param length - ignored on entry, on exit will be the length of the table if known, or -1 if unknown.
* @return the address of the table in memory, or <code>NULL</code>
* if the table doesn't exist.
- *
- * @stable ICU 2.8
+ * @deprecated ICU 54. See {@link LayoutEngine}
*/
- virtual const void *getFontTable(LETag tableTag) const = 0;
+ virtual const void* getFontTable(LETag tableTag, size_t &length) const = 0;
/**
* This method is used to determine if the font can
*
* @return <code>TRUE</code> if the font can render ch.
*
- * @draft ICU 2.6
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual le_bool canDisplay(LEUnicode32 ch) const;
*
* @return the number of design units pre EM.
*
- * @stable ICU 2.8
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual le_int32 getUnitsPerEM() const = 0;
* @param count - the number of characters
* @param reverse - if <code>TRUE</code>, store the glyph indices in reverse order.
* @param mapper - the character mapper.
+ * @param filterZeroWidth - <code>TRUE</code> if ZWJ / ZWNJ characters should map to a glyph w/ no contours.
* @param glyphStorage - the object which contains the output glyph array
*
* @see LECharMapper
*
- * @draft ICU 3.0
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
+ */
+ virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, const LECharMapper *mapper, le_bool filterZeroWidth, LEGlyphStorage &glyphStorage) const;
+
+ /**
+ * This method maps a single character to a glyph index, using the
+ * font's character to glyph map. The default implementation of this
+ * method calls the mapper, and then calls <code>mapCharToGlyph(mappedCh)</code>.
+ *
+ * @param ch - the character
+ * @param mapper - the character mapper
+ * @param filterZeroWidth - <code>TRUE</code> if ZWJ / ZWNJ characters should map to a glyph w/ no contours.
+ *
+ * @return the glyph index
+ *
+ * @see LECharMapper
+ *
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
- virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, const LECharMapper *mapper, LEGlyphStorage &glyphStorage) const;
+ virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper, le_bool filterZeroWidth) const;
/**
* This method maps a single character to a glyph index, using the
*
* @see LECharMapper
*
- * @draft ICU 2.6
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper) const;
*
* @return the glyph index
*
- * @draft ICU 2.6
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch) const = 0;
* @param glyph - the glyph index
* @param advance - the X and Y pixel values will be stored here
*
- * @draft ICU 2.2
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const = 0;
*
* @return <code>TRUE</code> if the point coordinates could be stored.
*
- * @stable ICU 2.8
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual le_bool getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const = 0;
*
* @return the pixel width of the EM square
*
- * @stable ICU 2.8
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual float getXPixelsPerEm() const = 0;
*
* @return the pixel height of the EM square
*
- * @stable ICU 2.8
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual float getYPixelsPerEm() const = 0;
*
* @return points in the X direction
*
- * @draft ICU 2.6
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual float xUnitsToPoints(float xUnits) const;
*
* @return points in the Y direction
*
- * @draft ICU 2.6
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual float yUnitsToPoints(float yUnits) const;
* @param units - X and Y design units
* @param points - set to X and Y points
*
- * @draft ICU 2.6
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual void unitsToPoints(LEPoint &units, LEPoint &points) const;
*
* @return font design units in the X direction
*
- * @draft ICU 2.6
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual float xPixelsToUnits(float xPixels) const;
*
* @return font design units in the Y direction
*
- * @draft ICU 2.6
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual float yPixelsToUnits(float yPixels) const;
* @param pixels - X and Y pixel
* @param units - set to X and Y font design units
*
- * @draft ICU 2.6
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual void pixelsToUnits(LEPoint &pixels, LEPoint &units) const;
*
* @see transformFunits
*
- * @draft ICU 2.6
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual float getScaleFactorX() const = 0;
*
* @see transformFunits
*
- * @draft ICU 2.6
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual float getScaleFactorY() const = 0;
* @see getScaleFactorX
* @see getScaleFactorY
*
- * @draft ICU 2.6
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual void transformFunits(float xFunits, float yFunits, LEPoint &pixels) const;
*
* @return the floating point value
*
- * @stable ICU 2.8
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
- static float fixedToFloat(le_int32 fixed);
+ static inline float fixedToFloat(le_int32 fixed);
/**
* This is a convenience method used to convert
*
* @return the fixed point value
*
- * @stable ICU 2.8
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
- static le_int32 floatToFixed(float theFloat);
+ static inline le_int32 floatToFixed(float theFloat);
//
// These methods won't ever be called by the LayoutEngine,
* @return the font's ascent, in points. This value
* will always be positive.
*
- * @draft ICU 2.6
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual le_int32 getAscent() const = 0;
* @return the font's descent, in points. This value
* will always be positive.
*
- * @draft ICU 2.6
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual le_int32 getDescent() const = 0;
* @return the font's leading, in points. This value
* will always be positive.
*
- * @draft ICU 2.6
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual le_int32 getLeading() const = 0;
* @return the line height, in points. This vaule will
* always be positive.
*
- * @draft ICU 2.6
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual le_int32 getLineHeight() const;
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.
*
- * @draft ICU 2.6
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
virtual UClassID getDynamicClassID() const;
/**
* ICU "poor man's RTTI", returns a UClassID for this class.
*
- * @draft ICU 2.6
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
static UClassID getStaticClassID();
};
-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);
return (le_int32) (theFloat * 65536.0);
}
-inline le_int32 LEFontInstance::getLineHeight() const
-{
- return getAscent() + getDescent() + getLeading();
-}
-
U_NAMESPACE_END
#endif
-
-