Canvas::Text: add line-height property.
This commit is contained in:
@@ -36,6 +36,7 @@ namespace canvas
|
|||||||
|
|
||||||
void setFontResolution(int res);
|
void setFontResolution(int res);
|
||||||
void setCharacterAspect(float aspect);
|
void setCharacterAspect(float aspect);
|
||||||
|
void setLineHeight(float factor);
|
||||||
void setFill(const std::string& fill);
|
void setFill(const std::string& fill);
|
||||||
void setBackgroundColor(const std::string& fill);
|
void setBackgroundColor(const std::string& fill);
|
||||||
|
|
||||||
@@ -69,6 +70,12 @@ namespace canvas
|
|||||||
setCharacterSize(getCharacterHeight(), aspect);
|
setCharacterSize(getCharacterHeight(), aspect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
void Text::TextOSG::setLineHeight(float factor)
|
||||||
|
{
|
||||||
|
setLineSpacing(factor - 1);
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void Text::TextOSG::setFill(const std::string& fill)
|
void Text::TextOSG::setFill(const std::string& fill)
|
||||||
{
|
{
|
||||||
@@ -282,6 +289,7 @@ namespace canvas
|
|||||||
addStyle("character-aspect-ratio",
|
addStyle("character-aspect-ratio",
|
||||||
"numeric",
|
"numeric",
|
||||||
&TextOSG::setCharacterAspect, text);
|
&TextOSG::setCharacterAspect, text);
|
||||||
|
addStyle("line-height", "numeric", &TextOSG::setLineHeight, text);
|
||||||
addStyle("font-resolution", "numeric", &TextOSG::setFontResolution, text);
|
addStyle("font-resolution", "numeric", &TextOSG::setFontResolution, text);
|
||||||
addStyle("padding", "numeric", &TextOSG::setBoundingBoxMargin, text);
|
addStyle("padding", "numeric", &TextOSG::setBoundingBoxMargin, text);
|
||||||
// TEXT = 1 default
|
// TEXT = 1 default
|
||||||
|
|||||||
Reference in New Issue
Block a user