Inkscape
Vector Graphics Editor
|
#include <Layout-TNG-Scanline-Maker.h>
Classes | |
struct | ScanRun |
Public Member Functions | |
virtual | ~ScanlineMaker ()=default |
virtual std::vector< ScanRun > | makeScanline (Layout::FontMetrics const &line_height)=0 |
Returns a list of chunks on the current line which can fit text with the given properties. | |
virtual void | completeLine ()=0 |
Indicates that the caller has successfully filled the current line and hence that the next call to makeScanline() should return lines on the next lower line. | |
virtual double | yCoordinate ()=0 |
Returns the y coordinate of the top of the scanline that will be returned by the next call to makeScanline(). | |
virtual void | setNewYCoordinate (double new_y)=0 |
Forces an arbitrary change in the stored y coordinate of the object. | |
virtual bool | canExtendCurrentScanline (Layout::FontMetrics const &line_height)=0 |
Tests whether the caller can fit a new line with the given metrics into exactly the space returned by the previous call to makeScanline(). | |
virtual void | setLineHeight (Layout::FontMetrics const &line_height)=0 |
Sets current line block height. | |
private to Layout.
Generates lists of chunks within a shape.
This is the abstract base class for taking a given shape and scanning through it line-by-line to get the horizontal extents of each chunk for a line of a given height. There are two specialisations: One for real shapes and one that turns off wrapping by simulating an infinite shape. In due course there will be a further specialisation to optimise for the common case where the shape is a rectangle.
Definition at line 33 of file Layout-TNG-Scanline-Maker.h.
|
virtualdefault |
|
pure virtual |
Tests whether the caller can fit a new line with the given metrics into exactly the space returned by the previous call to makeScanline().
This saves the caller from having to discard its wrapping solution and starting at the beginning of the line again when a larger font is seen. The metrics given here are considered to be the ones that are being used now, and hence is the line advance height used by completeLine().
Implemented in Inkscape::Text::Layout::InfiniteScanlineMaker, and Inkscape::Text::Layout::ShapeScanlineMaker.
|
pure virtual |
Indicates that the caller has successfully filled the current line and hence that the next call to makeScanline() should return lines on the next lower line.
There is no error return, the next call to makeScanline() will give an error if there is no more space.
Implemented in Inkscape::Text::Layout::InfiniteScanlineMaker, and Inkscape::Text::Layout::ShapeScanlineMaker.
|
pure virtual |
Returns a list of chunks on the current line which can fit text with the given properties.
It is up to the caller to discard any chunks which are too narrow for its needs. This function may change the y coordinate between calls if the new height too big to fit in the space remaining in this shape. Returns an empty vector if there is no space left in the current shape.
Implemented in Inkscape::Text::Layout::InfiniteScanlineMaker, and Inkscape::Text::Layout::ShapeScanlineMaker.
|
pure virtual |
Sets current line block height.
Call before completeLine() to correct for actually used line height (in case some chunks with larger font-size rolled back).
Implemented in Inkscape::Text::Layout::InfiniteScanlineMaker, and Inkscape::Text::Layout::ShapeScanlineMaker.
|
pure virtual |
Forces an arbitrary change in the stored y coordinate of the object.
The next call to makeScanline() will return runs whose top is at the new coordinate.
Implemented in Inkscape::Text::Layout::InfiniteScanlineMaker, and Inkscape::Text::Layout::ShapeScanlineMaker.
|
pure virtual |
Returns the y coordinate of the top of the scanline that will be returned by the next call to makeScanline().
Implemented in Inkscape::Text::Layout::InfiniteScanlineMaker, and Inkscape::Text::Layout::ShapeScanlineMaker.