Back to Website
Show / Hide Table of Contents

Class TextRenderer

Package: @aurigma/design-atoms

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
Type Name Description
HTMLCanvasElement _staticCanvas
HTMLCanvasElement _activeCanvas
typeof TextWhizz _textWhizz
number _zoom
PointF _offset
IViewportHandler _viewportHandler
ITextSelectionStyleConfig _selectionStyle
IRgbColorParser _rgbColorParser
ICanvasFactory _canvasFactory

Properties

_activeCanvas

Declaration
protected _activeCanvas: HTMLCanvasElement;
Property Value
Type Description
HTMLCanvasElement

_colorPreviewService

Declaration
protected _colorPreviewService: IColorPreviewService;
Property Value
Type Description
IColorPreviewService

_offset

Declaration
protected _offset: PointF;
Property Value
Type Description
PointF

_rgbColorParser

Declaration
protected _rgbColorParser: IRgbColorParser;
Property Value
Type Description
IRgbColorParser

_scale

Declaration
protected get _scale(): number;
Property Value
Type Description
number

_selectionStyle

Declaration
protected _selectionStyle: ITextSelectionStyleConfig;
Property Value
Type Description
ITextSelectionStyleConfig

_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
Type Description
IViewportHandler

_workspaceHeight

Declaration
protected _workspaceHeight: number;
Property Value
Type Description
number

_workspaceWidth

Declaration
protected _workspaceWidth: number;
Property Value
Type Description
number

_zoom

Declaration
protected _zoom: number;
Property Value
Type Description
number

offset

Declaration
set offset(value: PointF);
Property Value
Type Description
PointF

staticCanvasMargin

Declaration
static staticCanvasMargin: number;
Property Value
Type Description
number

Methods

_colorToTextWhizz(color)

Declaration
protected _colorToTextWhizz(color: RgbColor): TextWhizz.Color;
Parameters
Type Name Description
RgbColor color
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
Type Name Description
RectangleF bounds
Returns
Type Description
RectangleF

_getScaledBoundsWithoutRound(bounds)

Declaration
protected _getScaledBoundsWithoutRound(bounds: RectangleF): RectangleF;
Parameters
Type Name Description
RectangleF bounds
Returns
Type Description
RectangleF

clearText()

Declaration
abstract clearText(): void;
Returns
Type Description
void

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
Type Description
void

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
Type Description
void

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
Type Name Description
BaseTextItemHandler | NewBaseTextItemHandler handler
ImageContainer imageContainer
RectangleF imageContainerRect
CanvasRenderingContext2D itemHandlerCtx
number opacityMultiplier
number increaseImageRect
Returns
Type Description
void

setWorkspaceSize(width, height)

Declaration
setWorkspaceSize(width: number, height: number): void;
Parameters
Type Name Description
number width
number height
Returns
Type Description
void

setZoom(value)

Declaration
setZoom(value: number): void;
Parameters
Type Name Description
number value
Returns
Type Description
void

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
Type Description
void
Was this page helpful?
Thanks for your feedback!
Back to top Copyright © 2001–2025 Aurigma, Inc. All rights reserved.
Loading...
    Thank for your vote
    Your opinion is important to us. To provide details, send feedback.
    Send feedback