#define DALI_TOOLKIT_TEXT_GLYPH_METRICS_HELPER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace Toolkit
{
-
namespace Text
{
-
/**
* @brief Some characters can be shaped in more than one glyph.
* This struct is used to retrieve metrics from these group of glyphs.
struct GlyphMetrics
{
GlyphMetrics()
- : fontId( 0u ),
- fontHeight( 0.f ),
- width( 0.f ),
- advance( 0.f ),
- ascender( 0.f ),
- xBearing( 0.f )
- {}
+ : fontId(0u),
+ fontHeight(0.f),
+ width(0.f),
+ advance(0.f),
+ ascender(0.f),
+ xBearing(0.f)
+ {
+ }
~GlyphMetrics()
- {}
+ {
+ }
FontId fontId; ///< The font id of the glyphs.
float fontHeight; ///< The font's height of those glyphs.
- float width; ///< The sum of all the widths of all the glyphs.
+ float width; ///< The width of the group.
float advance; ///< The sum of all the advances of all the glyphs.
float ascender; ///< The font's ascender.
- float xBearing; ///< The x bearing of the first glyph.
+ float xBearing; ///< The x bearing of the group.
};
/**
*
* @return The number of glyphs of the group.
*/
-Length GetNumberOfGlyphsOfGroup( GlyphIndex glyphIndex,
- GlyphIndex lastGlyphPlusOne,
- const Length* const charactersPerGlyphBuffer );
+Length GetNumberOfGlyphsOfGroup(GlyphIndex glyphIndex,
+ GlyphIndex lastGlyphPlusOne,
+ const Length* const charactersPerGlyphBuffer);
/**
* @brief Get some glyph's metrics of a group of glyphs formed as a result of shaping one character.
* @param[in] glyphsBuffer The glyphs buffer.
* @param[in] metrics Used to access metrics from FontClient.
*/
-void GetGlyphsMetrics( GlyphIndex glyphIndex,
- Length numberOfGlyphs,
- GlyphMetrics& glyphMetrics,
- const GlyphInfo* const glyphsBuffer,
- MetricsPtr& metrics );
+void GetGlyphsMetrics(GlyphIndex glyphIndex,
+ Length numberOfGlyphs,
+ GlyphMetrics& glyphMetrics,
+ const GlyphInfo* const glyphsBuffer,
+ MetricsPtr& metrics);
} // namespace Text