X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fvisual-model-impl.h;h=eebbe18c1108ab97d7b473c709eee6e7913cf8b9;hp=673156b83ea8a7a857374f86cdb0eb175fe4abd7;hb=4bc73f2e78812b262f09830bb2b1d87034f34496;hpb=aea5add7a82f4bd507d31526074238f2b641fcd8 diff --git a/dali-toolkit/internal/text/visual-model-impl.h b/dali-toolkit/internal/text/visual-model-impl.h index 673156b..eebbe18 100644 --- a/dali-toolkit/internal/text/visual-model-impl.h +++ b/dali-toolkit/internal/text/visual-model-impl.h @@ -26,9 +26,11 @@ #include // INTERNAL INCLUDES +#include #include #include #include +#include #include // DEVEL INCLUDES @@ -142,6 +144,15 @@ public: Length& numberOfLines) const; /** + * @brief Retrieves the line index where the glyph is laid-out. + * + * @param[in] glyphIndex The glyph's index. + * + * @return The line index. + */ + LineIndex GetLineOfGlyph(GlyphIndex glyphIndex); + + /** * @brief Retrieves the lines where the given range of glyphs is laid out. * * The size of the @p lines buffer needs to be big enough to copy the @p numberOfLines. @@ -172,9 +183,9 @@ public: * @param[in] index Index of the first underline run to be copied. * @param[in] numberOfRuns Number of underline runs to be copied. */ - void GetUnderlineRuns(GlyphRun* underlineRuns, - UnderlineRunIndex index, - Length numberOfRuns) const; + void GetUnderlineRuns(UnderlinedGlyphRun* underlineRuns, + UnderlineRunIndex index, + Length numberOfRuns) const; // Size interface @@ -552,6 +563,30 @@ public: * @return Returns the override height for a strikethrough, 0 indicates that font metrics will determine the height */ float GetStrikethroughHeight() const; + /** + * @brief Set the override used for character spacing. + * + * @note A positive value will make the characters far apart (expanded) and a negative value will bring them closer (condensed). + * + * @param[in] characterSpacing The character spacing. + */ + void SetCharacterSpacing(float characterSpacing); + + /** + * @brief Retrieves the characterSpacing. + * + * @note A positive value will make the characters far apart (expanded) and a negative value will bring them closer (condensed). + * + * @return Returns the characterSpacing. + */ + const float GetCharacterSpacing() const; + + /** + * @brief Retrieves the Glyphs to Characters Array. + * + * @return The GlyphsToCharacters. + */ + const Vector& GetGlyphsToCharacters() const; /** * @brief Retrieves the strikethrough runs. @@ -571,6 +606,20 @@ public: */ Length GetNumberOfStrikethroughRuns() const; + /** + * @brief Retrieves the number of character-spacing glyph runs. + * + * @return The number of character-spacing glyph runs. + */ + Length GetNumberOfCharacterSpacingGlyphRuns() const; + + /** + * @brief Retrieves the reference for character-spacing glyph runs. + * + * @return The reference for character-spacing glyph runs. + */ + const Vector& GetCharacterSpacingGlyphRuns() const; + protected: /** * @brief A reference counted object may only be deleted by calling Unreference(). @@ -590,34 +639,35 @@ private: VisualModel& operator=(const VisualModel& handle); public: - Vector mGlyphs; ///< For each glyph, the font's id, glyph's index within the font and glyph's metrics. - Vector mGlyphsToCharacters; ///< For each glyph, the index of the first character. - Vector mCharactersToGlyph; ///< For each character, the index of the first glyph. - Vector mCharactersPerGlyph; ///< For each glyph, the number of characters that form the glyph. - Vector mGlyphsPerCharacter; ///< For each character, the number of glyphs that are shaped. - Vector mGlyphPositions; ///< For each glyph, the position. - Vector mLines; ///< The laid out lines. - Vector mUnderlineRuns; ///< Runs of glyphs that are underlined. - Vector mColors; ///< Colors of the glyphs. - Vector mColorIndices; ///< Indices to the vector of colors for each glyphs. - Vector mBackgroundColors; ///< Background colors of the glyphs. - Vector mBackgroundColorIndices; ///< Indices to the vector of background colors for each glyphs. - Vector4 mTextColor; ///< The text color - Vector4 mShadowColor; ///< Color of drop shadow - Vector4 mUnderlineColor; ///< Color of underline - Vector4 mOutlineColor; ///< Color of outline - Vector4 mBackgroundColor; ///< Color of text background - Vector4 mStrikethroughColor; ///< Color of text background - Size mControlSize; ///< The size of the UI control. - Vector2 mShadowOffset; ///< Offset for drop shadow, 0 indicates no shadow - float mUnderlineHeight; ///< Fixed height for underline to override font metrics. - float mStrikethroughHeight; ///< Fixed height for strikethrough to override font metrics. - Text::Underline::Type mUnderlineType; ///< The type of the underline. - float mDashedUnderlineWidth; ///< The width of the dashes of the dashed underline. - float mDashedUnderlineGap; ///< The gap between the dashes of the dashed underline. - float mShadowBlurRadius; ///< Blur radius of shadow, 0 indicates no blur. - uint16_t mOutlineWidth; ///< Width of outline. - Vector mStrikethroughRuns; ///< Runs of glyphs that have strikethrough. + Vector mGlyphs; ///< For each glyph, the font's id, glyph's index within the font and glyph's metrics. + Vector mGlyphsToCharacters; ///< For each glyph, the index of the first character. + Vector mCharactersToGlyph; ///< For each character, the index of the first glyph. + Vector mCharactersPerGlyph; ///< For each glyph, the number of characters that form the glyph. + Vector mGlyphsPerCharacter; ///< For each character, the number of glyphs that are shaped. + Vector mGlyphPositions; ///< For each glyph, the position. + Vector mLines; ///< The laid out lines. + Vector mUnderlineRuns; ///< Runs of glyphs that are underlined. + Vector mColors; ///< Colors of the glyphs. + Vector mColorIndices; ///< Indices to the vector of colors for each glyphs. + Vector mBackgroundColors; ///< Background colors of the glyphs. + Vector mBackgroundColorIndices; ///< Indices to the vector of background colors for each glyphs. + Vector4 mTextColor; ///< The text color + Vector4 mShadowColor; ///< Color of drop shadow + Vector4 mUnderlineColor; ///< Color of underline + Vector4 mOutlineColor; ///< Color of outline + Vector4 mBackgroundColor; ///< Color of text background + Vector4 mStrikethroughColor; ///< Color of text background + Size mControlSize; ///< The size of the UI control. + Vector2 mShadowOffset; ///< Offset for drop shadow, 0 indicates no shadow + float mUnderlineHeight; ///< Fixed height for underline to override font metrics. + float mStrikethroughHeight; ///< Fixed height for strikethrough to override font metrics. + Text::Underline::Type mUnderlineType; ///< The type of the underline. + float mDashedUnderlineWidth; ///< The width of the dashes of the dashed underline. + float mDashedUnderlineGap; ///< The gap between the dashes of the dashed underline. + float mShadowBlurRadius; ///< Blur radius of shadow, 0 indicates no blur. + uint16_t mOutlineWidth; ///< Width of outline. + Vector mStrikethroughRuns; ///< Runs of glyphs that have strikethrough. + Vector mCharacterSpacingRuns; ///< Runs of glyphs that have character-spacing. private: Size mNaturalSize; ///< Size of the text with no line wrapping. @@ -640,6 +690,7 @@ public: bool mMarkupProcessorEnabled : 1; ///< Markup-processor enabled flag HyphenInfo mHyphen; ///< Contains hyphen glyph info & the character index to draw hyphen after. bool mStrikethroughEnabled : 1; ///< Strikethrough enabled flag + float mCharacterSpacing; ///< Contains the value of the character spacing. }; } // namespace Text