Class TextRenderer
Constructors
(constructor)(_staticCanvas, _activeCanvas, _textWhizz, _zoom, _offset, _viewportHandler, _selectionStyle, _rgbColorParser, _canvasFactory)
Constructs a new instance of the TextRenderer class
Declaration
constructor(_staticCanvas: HTMLCanvasElement, _activeCanvas: HTMLCanvasElement, _textWhizz: typeof TextWhizz, _zoom: number, _offset: PointF, _viewportHandler: IViewportHandler, _selectionStyle: ITextSelectionStyleConfig, _rgbColorParser: IRgbColorParser, _canvasFactory: ICanvasFactory);
Parameters
Properties
_activeCanvas
Declaration
protected _activeCanvas: HTMLCanvasElement;
Property Value
| Type |
Description |
| HTMLCanvasElement |
|
_colorPreviewService
Declaration
protected _colorPreviewService: IColorPreviewService;
Property Value
_offset
Declaration
protected _offset: PointF;
Property Value
_rgbColorParser
Declaration
protected _rgbColorParser: IRgbColorParser;
Property Value
_scale
Declaration
protected get _scale(): number;
Property Value
_selectionStyle
Declaration
protected _selectionStyle: ITextSelectionStyleConfig;
Property Value
_staticCanvas
Declaration
protected _staticCanvas: HTMLCanvasElement;
Property Value
| Type |
Description |
| HTMLCanvasElement |
|
_textWhizz
Declaration
protected _textWhizz: typeof TextWhizz;
Property Value
| Type |
Description |
| typeof TextWhizz |
|
_viewportHandler
Declaration
protected _viewportHandler: IViewportHandler;
Property Value
_workspaceHeight
Declaration
protected _workspaceHeight: number;
Property Value
_workspaceWidth
Declaration
protected _workspaceWidth: number;
Property Value
_zoom
Declaration
Property Value
offset
Declaration
set offset(value: PointF);
Property Value
staticCanvasMargin
Declaration
static staticCanvasMargin: number;
Property Value
Methods
_colorToTextWhizz(color)
Declaration
protected _colorToTextWhizz(color: RgbColor): TextWhizz.Color;
Parameters
Returns
| Type |
Description |
| TextWhizz.Color |
|
_copyCanvas(source, size)
Declaration
protected _copyCanvas(source: HTMLCanvasElement, size: Size): HTMLCanvasElement;
Parameters
| Type |
Name |
Description |
| HTMLCanvasElement |
source |
|
| Size |
size |
|
Returns
| Type |
Description |
| HTMLCanvasElement |
|
_createCanvas(size)
Declaration
protected _createCanvas(size: Size): HTMLCanvasElement;
Parameters
| Type |
Name |
Description |
| Size |
size |
|
Returns
| Type |
Description |
| HTMLCanvasElement |
|
_getScaledBounds(bounds)
Declaration
protected _getScaledBounds(bounds: RectangleF): RectangleF;
Parameters
Returns
_getScaledBoundsWithoutRound(bounds)
Declaration
protected _getScaledBoundsWithoutRound(bounds: RectangleF): RectangleF;
Parameters
Returns
clearText()
Declaration
abstract clearText(): void;
Returns
drawSelection(handler, selection, transform, center, previewScale)
Declaration
abstract drawSelection(handler: TextWhizz.TextHandler, selection: TextWhizz.TextRange, transform: Transform, center: PointF, previewScale: number): void;
Parameters
| Type |
Name |
Description |
| TextWhizz.TextHandler |
handler |
|
| TextWhizz.TextRange |
selection |
|
| Transform |
transform |
|
| PointF |
center |
|
| number |
previewScale |
|
Returns
drawText(handler, transform, center, previewScale, opacity, clippingPath)
Declaration
abstract drawText(handler: TextWhizz.TextHandler, transform: Transform, center: PointF, previewScale: number, opacity: number, clippingPath: Path): void;
Parameters
| Type |
Name |
Description |
| TextWhizz.TextHandler |
handler |
|
| Transform |
transform |
|
| PointF |
center |
|
| number |
previewScale |
|
| number |
opacity |
|
| Path |
clippingPath |
|
Returns
getTextImage(handler, bounds, previewScale)
Declaration
abstract getTextImage(handler: TextWhizz.TextHandler, bounds: RectangleF, previewScale: number): HTMLCanvasElement;
Parameters
| Type |
Name |
Description |
| TextWhizz.TextHandler |
handler |
|
| RectangleF |
bounds |
|
| number |
previewScale |
|
Returns
| Type |
Description |
| HTMLCanvasElement |
|
renderTextImage(handler, imageContainer, imageContainerRect, itemHandlerCtx, opacityMultiplier, increaseImageRect)
Declaration
static renderTextImage(handler: BaseTextItemHandler | NewBaseTextItemHandler, imageContainer: ImageContainer, imageContainerRect: RectangleF, itemHandlerCtx: CanvasRenderingContext2D, opacityMultiplier: number, increaseImageRect: number): void;
Parameters
Returns
setWorkspaceSize(width, height)
Declaration
setWorkspaceSize(width: number, height: number): void;
Parameters
| Type |
Name |
Description |
| number |
width |
|
| number |
height |
|
Returns
setZoom(value)
Declaration
setZoom(value: number): void;
Parameters
| Type |
Name |
Description |
| number |
value |
|
Returns
transformText(handler, transform, center, previewScale, opacity, clippingPath)
Declaration
abstract transformText(handler: TextWhizz.TextHandler, transform: Transform, center: PointF, previewScale: number, opacity: number, clippingPath: Path): void;
Parameters
| Type |
Name |
Description |
| TextWhizz.TextHandler |
handler |
|
| Transform |
transform |
|
| PointF |
center |
|
| number |
previewScale |
|
| number |
opacity |
|
| Path |
clippingPath |
|
Returns