NovaSVG 0.11.5
An SVG library
Loading...
Searching...
No Matches
nova::svg::foreign_object_painter Class Referenceabstract

#include <foreign_object.h>

Public Member Functions

virtual ~foreign_object_painter ()=default
virtual void fill_rect (const vg::box &box_, const stb::color &color_)=0
virtual void fill_text (std::u32string_view text, const foreign_object_font &font_, float x, float y, const stb::color &color_, const text_squeeze &squeeze={})=0
 x, y: the left end of the baseline.
virtual void draw_image (const stb::image &image, const vg::box &dest)=0
 Straight (not premultiplied) RGBA, stretched to dest. For renderers that rasterize.
virtual foreign_object_font_metrics metrics (const foreign_object_font &font_) const =0
virtual float measure_text (std::u32string_view text, const foreign_object_font &font_) const =0

Detailed Description

What a renderer may draw with; implemented by the document over its canvas, in the foreignObject's coordinate system (user units, y down).

Definition at line 82 of file foreign_object.h.

Constructor & Destructor Documentation

◆ ~foreign_object_painter()

virtual nova::svg::foreign_object_painter::~foreign_object_painter ( )
virtualdefault

Member Function Documentation

◆ draw_image()

virtual void nova::svg::foreign_object_painter::draw_image ( const stb::image & image,
const vg::box & dest )
pure virtual

Straight (not premultiplied) RGBA, stretched to dest. For renderers that rasterize.

◆ fill_rect()

virtual void nova::svg::foreign_object_painter::fill_rect ( const vg::box & box_,
const stb::color & color_ )
pure virtual

◆ fill_text()

virtual void nova::svg::foreign_object_painter::fill_text ( std::u32string_view text,
const foreign_object_font & font_,
float x,
float y,
const stb::color & color_,
const text_squeeze & squeeze = {} )
pure virtual

x, y: the left end of the baseline.

◆ measure_text()

virtual float nova::svg::foreign_object_painter::measure_text ( std::u32string_view text,
const foreign_object_font & font_ ) const
pure virtual

◆ metrics()

virtual foreign_object_font_metrics nova::svg::foreign_object_painter::metrics ( const foreign_object_font & font_) const
pure virtual

The documentation for this class was generated from the following file: