49
49
static void sp_flowtext_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const &transform, unsigned const flags);
50
50
static void sp_flowtext_print(SPItem *item, SPPrintContext *ctx);
51
51
static gchar *sp_flowtext_description(SPItem *item);
52
static void sp_flowtext_snappoints(SPItem const *item, std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs);
52
53
static NRArenaItem *sp_flowtext_show(SPItem *item, NRArena *arena, unsigned key, unsigned flags);
53
54
static void sp_flowtext_hide(SPItem *item, unsigned key);
98
99
item_class->bbox = sp_flowtext_bbox;
99
100
item_class->print = sp_flowtext_print;
100
101
item_class->description = sp_flowtext_description;
102
item_class->snappoints = sp_flowtext_snappoints;
101
103
item_class->show = sp_flowtext_show;
102
104
item_class->hide = sp_flowtext_hide;
373
375
Inkscape::Text::Layout const &layout = SP_FLOWTEXT(item)->layout;
374
376
int const nChars = layout.iteratorToCharIndex(layout.end());
375
if (SP_FLOWTEXT(item)->has_internal_frame())
376
return g_strdup_printf(ngettext("<b>Flowed text</b> (%d character)", "<b>Flowed text</b> (%d characters)", nChars), nChars);
378
return g_strdup_printf(ngettext("<b>Linked flowed text</b> (%d character)", "<b>Linked flowed text</b> (%d characters)", nChars), nChars);
378
char const *trunc = (layout.inputTruncated()) ? _(" [truncated]") : "";
380
if (SP_FLOWTEXT(item)->has_internal_frame()) {
381
return g_strdup_printf(ngettext("<b>Flowed text</b> (%d character%s)", "<b>Flowed text</b> (%d characters%s)", nChars), nChars, trunc);
383
return g_strdup_printf(ngettext("<b>Linked flowed text</b> (%d character%s)", "<b>Linked flowed text</b> (%d characters%s)", nChars), nChars, trunc);
387
static void sp_flowtext_snappoints(SPItem const *item, std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const */*snapprefs*/)
389
// Choose a point on the baseline for snapping from or to, with the horizontal position
390
// of this point depending on the text alignment (left vs. right)
391
Inkscape::Text::Layout const *layout = te_get_layout((SPItem *) item);
392
if (layout != NULL && layout->outputExists()) {
393
boost::optional<Geom::Point> pt = layout->baselineAnchorPoint();
395
p.push_back(Inkscape::SnapCandidatePoint((*pt) * sp_item_i2d_affine(item), Inkscape::SNAPSOURCE_TEXT_BASELINE, Inkscape::SNAPTARGET_TEXT_BASELINE));
381
400
static NRArenaItem *