else
{
for (int aLineIt = 0; aLineIt < myLinesNb; aLineIt++)
- aMaxLineWidth = Max (aMaxLineWidth, getLineWidth (aLineIt));
+ aMaxLineWidth = Max (aMaxLineWidth, LineWidth (aLineIt));
}
}
else
{
// the next symbol is on the next row either by '\n' or by wrapping
- Standard_ShortReal aLineWidth = getLineWidth (LineIndex (theIndex));
+ Standard_ShortReal aLineWidth = LineWidth (LineIndex (theIndex));
theBndBox.Left = aLeftCorner.x();
switch (myAlignX)
{
}
// =======================================================================
-// function : getLineWidth
+// function : LineWidth
// purpose :
// =======================================================================
-Standard_ShortReal Font_TextFormatter::getLineWidth (const Standard_Integer theIndex) const
+Standard_ShortReal Font_TextFormatter::LineWidth (const Standard_Integer theIndex) const
{
if (theIndex < 0)
return 0;
return theIndex == 0 ? myNewLines[0] : myNewLines[theIndex] - myNewLines[theIndex -1];
if (theIndex == myNewLines.Length()) // the last line
- return myPen.x() - getLineWidth (theIndex - 1);
+ return myPen.x() - LineWidth (theIndex - 1);
return 0;
}
Standard_ShortReal LineHeight (const Standard_Integer theIndex) const
{ return theIndex == 0 ? myAscender : myLineSpacing; }
+ //!< Returns width of a line
+ Standard_EXPORT Standard_ShortReal LineWidth (const Standard_Integer theIndex) const;
+
//! Returns true if the symbol by the index is '\n'. The width of the symbol is zero.
Standard_EXPORT Standard_Boolean IsLFSymbol (const Standard_Integer theIndex) const;
//!< Returns true if the symbol is CR, BEL, FF, NP, BS or VT
Standard_EXPORT static Standard_Boolean IsCommandSymbol (const Standard_Utf32Char& theSymbol);
-protected:
- //!< Returns width of a line
- Standard_ShortReal getLineWidth (const Standard_Integer theIndex) const;
-
DEFINE_STANDARD_RTTIEXT (Font_TextFormatter, Standard_Transient)
protected: //! @name class auxiliary methods