Inkscape
Vector Graphics Editor
|
#include <build-text.h>
Public Member Functions | |
TextContext (Document &doc, capypdf::DrawContext &ctx, bool soft_mask) | |
bool | set_text_style (std::shared_ptr< FontInstance > const &font, SPStyle *style) |
Set the text/font style, these are comment between clipping and painting. | |
void | set_paint_style (StyleMap const &map, SPStyle const *style, SPStyle const *context_style) |
Set the painting style, this is not applicable to clipping. | |
void | set_text_mode (CapyPDF_Text_Mode mode) |
void | render_text (Text::Layout const &layout, Text::Layout::Span const &span) |
Render the text span into the text context. | |
void | finalize () |
Protected Member Functions | |
std::optional< double > | get_softmask (double opacity) const |
Private Attributes | |
Document & | _doc |
capypdf::DrawContext & | _ctx |
capypdf::Text | _tx |
bool | _soft_mask |
Glib::ustring | last_font |
double | last_letter_spacing = 0 |
double | last_ca = 1.0 |
double | last_CA = 1.0 |
CapyPDF_Text_Mode | last_text_mode = CAPY_TEXT_FILL |
Definition at line 21 of file build-text.h.
Inkscape::Extension::Internal::PdfBuilder::TextContext::TextContext | ( | Document & | doc, |
capypdf::DrawContext & | ctx, | ||
bool | soft_mask | ||
) |
Definition at line 38 of file build-text.cpp.
void Inkscape::Extension::Internal::PdfBuilder::TextContext::finalize | ( | ) |
Definition at line 143 of file build-text.cpp.
|
protected |
Definition at line 46 of file build-text.cpp.
References _soft_mask.
Referenced by set_paint_style().
void Inkscape::Extension::Internal::PdfBuilder::TextContext::render_text | ( | Text::Layout const & | layout, |
Text::Layout::Span const & | span | ||
) |
Render the text span into the text context.
Definition at line 151 of file build-text.cpp.
References _tx, Geom::are_near(), delta, Geom::EPSILON, Inkscape::Text::Layout::Span::font, Inkscape::Text::Layout::glyphs(), Geom::Affine::inverse(), Geom::Affine::translation(), Inkscape::Extension::Internal::PdfBuilder::unicodeToUtf8(), Geom::X, and Geom::Y.
void Inkscape::Extension::Internal::PdfBuilder::TextContext::set_paint_style | ( | StyleMap const & | map, |
SPStyle const * | style, | ||
SPStyle const * | context_style | ||
) |
Set the painting style, this is not applicable to clipping.
Definition at line 79 of file build-text.cpp.
References _doc, _soft_mask, _tx, FILL, SPStyle::fill, SPStyle::fill_opacity, Inkscape::Extension::Internal::PdfBuilder::Document::generator(), Inkscape::Extension::Internal::PdfBuilder::get_linecap(), Inkscape::Extension::Internal::PdfBuilder::get_linejoin(), Inkscape::Extension::Internal::PdfBuilder::Document::get_paint(), get_softmask(), last_ca, last_CA, map, STROKE, SPStyle::stroke, STROKE_DASHARRAY, SPStyle::stroke_dasharray, SPStyle::stroke_dashoffset, STROKE_LINECAP, SPStyle::stroke_linecap, STROKE_LINEJOIN, SPStyle::stroke_linejoin, STROKE_MITERLIMIT, SPStyle::stroke_miterlimit, SPStyle::stroke_opacity, STROKE_WIDTH, SPStyle::stroke_width, and Inkscape::Extension::Internal::PdfBuilder::Document::style_to_transparency_mask().
void Inkscape::Extension::Internal::PdfBuilder::TextContext::set_text_mode | ( | CapyPDF_Text_Mode | mode | ) |
Definition at line 135 of file build-text.cpp.
References _tx, last_text_mode, and mode.
bool Inkscape::Extension::Internal::PdfBuilder::TextContext::set_text_style | ( | std::shared_ptr< FontInstance > const & | font, |
SPStyle * | style | ||
) |
Set the text/font style, these are comment between clipping and painting.
Definition at line 57 of file build-text.cpp.
References _doc, _tx, Inkscape::Extension::Internal::PdfBuilder::Document::get_font(), last_font, last_letter_spacing, and SPStyle::letter_spacing.
|
private |
Definition at line 37 of file build-text.h.
Referenced by finalize().
|
private |
Definition at line 36 of file build-text.h.
Referenced by set_paint_style(), and set_text_style().
|
private |
Definition at line 39 of file build-text.h.
Referenced by get_softmask(), and set_paint_style().
|
private |
Definition at line 38 of file build-text.h.
Referenced by finalize(), render_text(), set_paint_style(), set_text_mode(), and set_text_style().
|
private |
Definition at line 44 of file build-text.h.
Referenced by set_paint_style().
|
private |
Definition at line 45 of file build-text.h.
Referenced by set_paint_style().
|
private |
Definition at line 42 of file build-text.h.
Referenced by set_text_style().
|
private |
Definition at line 43 of file build-text.h.
Referenced by set_text_style().
|
private |
Definition at line 46 of file build-text.h.
Referenced by set_text_mode().