mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 19:51:58 +01:00
add Page::setTTFont
This commit is contained in:
@@ -203,7 +203,11 @@ public:
|
||||
/// Sets the font.
|
||||
|
||||
void setFont(const std::string& fontName, float size, const std::string& encoding = "");
|
||||
/// Sets the font.
|
||||
/// Sets the font. The name must be a valid Base14 PDF internal font.
|
||||
|
||||
void setTTFont(const std::string& name, float size, const std::string& encoding = "UTF-8", bool embed = true);
|
||||
/// Sets the external true type font. Name must be a valid path to .ttf file.
|
||||
/// If embed is tru, font will be embedded int othe document.
|
||||
|
||||
float textWidth(const std::string& text);
|
||||
/// Returns the width of the supplied text.
|
||||
|
||||
@@ -108,8 +108,13 @@ float Page::textWidth(const std::string& text)
|
||||
|
||||
void Page::setFont(const std::string& name, float size, const std::string& encoding)
|
||||
{
|
||||
Font font(&_pDocument->handle(), HPDF_GetFont(_pDocument->handle(), name.c_str(), encoding.empty() ? 0 : encoding.c_str()));
|
||||
setFont(font, size);
|
||||
setFont(_pDocument->font(name, encoding), size);
|
||||
}
|
||||
|
||||
|
||||
void Page::setTTFont(const std::string& name, float size, const std::string& encoding, bool embed)
|
||||
{
|
||||
setFont(_pDocument->font(_pDocument->loadTTFont(name, embed), encoding), size);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user