ICU-3294 Fix AIX warnings, add EEF_BASELINE_IS_LOGICAL_END flag, test.

X-SVN-Rev: 17150
This commit is contained in:
Eric Mader 2005-01-21 18:36:02 +00:00
parent 76362869b3
commit b5be8f149a
3 changed files with 57 additions and 26 deletions

View File

@ -286,7 +286,7 @@ void GlyphIterator::setCursiveEntryPoint(LEPoint &entryPoint)
}
}
glyphPositionAdjustments->setEntryPoint(position, entryPoint);
glyphPositionAdjustments->setEntryPoint(position, entryPoint, baselineIsLogicalEnd());
}
void GlyphIterator::setCursiveExitPoint(LEPoint &exitPoint)
@ -301,7 +301,7 @@ void GlyphIterator::setCursiveExitPoint(LEPoint &exitPoint)
}
}
glyphPositionAdjustments->setExitPoint(position, exitPoint);
glyphPositionAdjustments->setExitPoint(position, exitPoint, baselineIsLogicalEnd());
}
void GlyphIterator::setCursiveGlyph()
@ -316,7 +316,7 @@ void GlyphIterator::setCursiveGlyph()
}
}
glyphPositionAdjustments->setCursiveGlyph(position);
glyphPositionAdjustments->setCursiveGlyph(position, baselineIsLogicalEnd());
}
le_bool GlyphIterator::filterGlyph(le_uint32 index) const

View File

@ -46,25 +46,25 @@ const LEPoint *GlyphPositionAdjustments::getExitPoint(le_int32 index, LEPoint &e
return fEntryExitPoints[index].getExitPoint(exitPoint);
}
void GlyphPositionAdjustments::setEntryPoint(le_int32 index, LEPoint &newEntryPoint)
void GlyphPositionAdjustments::setEntryPoint(le_int32 index, LEPoint &newEntryPoint, le_bool baselineIsLogicalEnd)
{
CHECK_ALLOCATE_ARRAY(fEntryExitPoints, EntryExitPoint, fGlyphCount);
fEntryExitPoints[index].setEntryPoint(newEntryPoint);
fEntryExitPoints[index].setEntryPoint(newEntryPoint, baselineIsLogicalEnd);
}
void GlyphPositionAdjustments::setExitPoint(le_int32 index, LEPoint &newExitPoint)
void GlyphPositionAdjustments::setExitPoint(le_int32 index, LEPoint &newExitPoint, le_bool baselineIsLogicalEnd)
{
CHECK_ALLOCATE_ARRAY(fEntryExitPoints, EntryExitPoint, fGlyphCount);
fEntryExitPoints[index].setExitPoint(newExitPoint);
fEntryExitPoints[index].setExitPoint(newExitPoint, baselineIsLogicalEnd);
}
void GlyphPositionAdjustments::setCursiveGlyph(le_int32 index)
void GlyphPositionAdjustments::setCursiveGlyph(le_int32 index, le_bool baselineIsLogicalEnd)
{
CHECK_ALLOCATE_ARRAY(fEntryExitPoints, EntryExitPoint, fGlyphCount);
fEntryExitPoints[index].setCursiveGlyph();
fEntryExitPoints[index].setCursiveGlyph(baselineIsLogicalEnd);
}
void GlyphPositionAdjustments::applyCursiveAdjustments(LEGlyphStorage &glyphStorage, le_bool rightToLeft, const LEFontInstance *fontInstance)
@ -76,9 +76,13 @@ void GlyphPositionAdjustments::applyCursiveAdjustments(LEGlyphStorage &glyphStor
le_int32 start = 0, end = fGlyphCount, dir = 1;
le_int32 firstExitPoint = -1, lastExitPoint = -1;
LEPoint entryAnchor, exitAnchor, pixels;
LEGlyphID lastExitGlyphID;
LEGlyphID lastExitGlyphID = 0;
float baselineAdjustment = 0;
// This removes a possible warning about
// using exitAnchor before it's been initialized.
exitAnchor.fX = exitAnchor.fY = 0;
if (rightToLeft) {
start = fGlyphCount - 1;
end = -1;
@ -122,7 +126,7 @@ void GlyphPositionAdjustments::applyCursiveAdjustments(LEGlyphStorage &glyphStor
lastExitGlyphID = glyphID;
} else {
if (/*baselineIsLogicalEnd &&*/ firstExitPoint >= 0 && lastExitPoint >= 0) {
if (baselineIsLogicalEnd(i) && firstExitPoint >= 0 && lastExitPoint >= 0) {
le_int32 limit = lastExitPoint + dir;
for (le_int32 j = firstExitPoint; j != limit; j += dir) {

View File

@ -67,19 +67,21 @@ private:
~EntryExitPoint();
le_bool isCursiveGlyph() const;
le_bool baselineIsLogicalEnd() const;
LEPoint *getEntryPoint(LEPoint &entryPoint) const;
LEPoint *getExitPoint(LEPoint &exitPoint) const;
void setEntryPoint(LEPoint &newEntryPoint);
void setExitPoint(LEPoint &newExitPoint);
void setCursiveGlyph();
void setEntryPoint(LEPoint &newEntryPoint, le_bool baselineIsLogicalEnd);
void setExitPoint(LEPoint &newExitPoint, le_bool baselineIsLogicalEnd);
void setCursiveGlyph(le_bool baselineIsLogicalEnd);
private:
enum EntryExitFlags
{
EEF_HAS_ENTRY_POINT = 0x80000000L,
EEF_HAS_EXIT_POINT = 0x40000000L,
EEF_IS_CURSIVE_GLYPH = 0x20000000L
EEF_HAS_ENTRY_POINT = 0x80000000L,
EEF_HAS_EXIT_POINT = 0x40000000L,
EEF_IS_CURSIVE_GLYPH = 0x20000000L,
EEF_BASELINE_IS_LOGICAL_END = 0x10000000L
};
le_uint32 fFlags;
@ -99,6 +101,7 @@ public:
le_bool hasCursiveGlyphs() const;
le_bool isCursiveGlyph(le_int32 index) const;
le_bool baselineIsLogicalEnd(le_int32 index) const;
const LEPoint *getEntryPoint(le_int32 index, LEPoint &entryPoint) const;
const LEPoint *getExitPoint(le_int32 index, LEPoint &exitPoint) const;
@ -122,9 +125,9 @@ public:
void adjustXAdvance(le_int32 index, float xAdjustment);
void adjustYAdvance(le_int32 index, float yAdjustment);
void setEntryPoint(le_int32 index, LEPoint &newEntryPoint);
void setExitPoint(le_int32 index, LEPoint &newExitPoint);
void setCursiveGlyph(le_int32 index);
void setEntryPoint(le_int32 index, LEPoint &newEntryPoint, le_bool baselineIsLogicalEnd);
void setExitPoint(le_int32 index, LEPoint &newExitPoint, le_bool baselineIsLogicalEnd);
void setCursiveGlyph(le_int32 index, le_bool baselineIsLogicalEnd);
void applyCursiveAdjustments(LEGlyphStorage &glyphStorage, le_bool rightToLeft, const LEFontInstance *fontInstance);
};
@ -134,6 +137,11 @@ inline le_bool GlyphPositionAdjustments::isCursiveGlyph(le_int32 index) const
return fEntryExitPoints != NULL && fEntryExitPoints[index].isCursiveGlyph();
}
inline le_bool GlyphPositionAdjustments::baselineIsLogicalEnd(le_int32 index) const
{
return fEntryExitPoints != NULL && fEntryExitPoints[index].baselineIsLogicalEnd();
}
inline float GlyphPositionAdjustments::getXPlacement(le_int32 index) const
{
return fAdjustments[index].getXPlacement();
@ -313,21 +321,40 @@ inline le_bool GlyphPositionAdjustments::EntryExitPoint::isCursiveGlyph() const
return (fFlags & EEF_IS_CURSIVE_GLYPH) != 0;
}
inline void GlyphPositionAdjustments::EntryExitPoint::setEntryPoint(LEPoint &newEntryPoint)
inline le_bool GlyphPositionAdjustments::EntryExitPoint::baselineIsLogicalEnd() const
{
fFlags |= (EEF_HAS_ENTRY_POINT | EEF_IS_CURSIVE_GLYPH);
return (fFlags & EEF_BASELINE_IS_LOGICAL_END) != 0;
}
inline void GlyphPositionAdjustments::EntryExitPoint::setEntryPoint(LEPoint &newEntryPoint, le_bool baselineIsLogicalEnd)
{
if (baselineIsLogicalEnd) {
fFlags |= (EEF_HAS_ENTRY_POINT | EEF_IS_CURSIVE_GLYPH | EEF_BASELINE_IS_LOGICAL_END);
} else {
fFlags |= (EEF_HAS_ENTRY_POINT | EEF_IS_CURSIVE_GLYPH);
}
fEntryPoint = newEntryPoint;
}
inline void GlyphPositionAdjustments::EntryExitPoint::setExitPoint(LEPoint &newExitPoint)
inline void GlyphPositionAdjustments::EntryExitPoint::setExitPoint(LEPoint &newExitPoint, le_bool baselineIsLogicalEnd)
{
fFlags |= (EEF_HAS_EXIT_POINT | EEF_IS_CURSIVE_GLYPH);
if (baselineIsLogicalEnd) {
fFlags |= (EEF_HAS_EXIT_POINT | EEF_IS_CURSIVE_GLYPH | EEF_BASELINE_IS_LOGICAL_END);
} else {
fFlags |= (EEF_HAS_EXIT_POINT | EEF_IS_CURSIVE_GLYPH);
}
fExitPoint = newExitPoint;
}
inline void GlyphPositionAdjustments::EntryExitPoint::setCursiveGlyph()
inline void GlyphPositionAdjustments::EntryExitPoint::setCursiveGlyph(le_bool baselineIsLogicalEnd)
{
fFlags |= EEF_IS_CURSIVE_GLYPH;
if (baselineIsLogicalEnd) {
fFlags |= (EEF_IS_CURSIVE_GLYPH | EEF_BASELINE_IS_LOGICAL_END);
} else {
fFlags |= EEF_IS_CURSIVE_GLYPH;
}
}
U_NAMESPACE_END