Last updated

API / geotoolkit / scene / shapes / painters / FontPainter / FontPainter

Class: FontPainter

painters.FontPainter.FontPainter

Draws a font symbol

Hierarchy

Implements

Table of contents

Constructors
Methods
Css Properties
Name Type Description
familystringFont family, must match to file name
fillstringText fill style
fillFillStyleText fill style
fill-colorstringColor in CSS form
fill-evenoddmodebooleanEven-odd fill mode
fill-fillpatternPatternPattern
fill-fillpattern-containernamestringAn optional container name, which creates an image pattern. This parameter is used for serialization if you want to save are reference to pattern instead of the pattern itself
fill-fillpattern-patternnamestringName of this pattern for indexing
fill-fillpattern-scalablebooleanFlag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported)
fill-foregroundstringForeground color
fill-patternPatternPattern
textstringText which be drawn as a symbol, ascii or unicode
urlstringFont url

Contents

Constructors

new FontPainter(url, family, text)

new FontPainter(url?, family?, text?)

Create FontPainter

Parameters

Name Type Description
Optional urlstring | ArrayBuffer | Optionsfont url or properties object
Optional familystringfont family, must match to file name
Optional textstringtext which be drawn as a symbol, ascii or unicode

Overrides

EventDispatcher.constructor

Methods

clone

clone(): FontPainter

Creates a clone of the painter, detaching itself from font fill style

Returns

FontPainter


dispose

dispose(): void

Dispose.

Returns

void

Inherited from

EventDispatcher.dispose


getClassName

getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName


getProperties

getProperties(): OptionsOut

Gets all the properties pertaining to the font painter

Returns

OptionsOut

font painter properties


hasEventListener

hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

EventDispatcher.hasEventListener


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

EventDispatcher.isDisposed


isSilent

isSilent(): boolean

Return true if the event dispatcher doesn't notify any events

Returns

boolean

Inherited from

EventDispatcher.isSilent


notify

notify(type, source, args?): FontPainter

Notify listeners

Parameters

Name Type Description
typestringevent types
sourceanyof the event
Optional argsanyarguments of the event

Returns

FontPainter

this

Inherited from

EventDispatcher.notify


off

off(type?, callback?): FontPainter

Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.

Parameters

Name Type Description
Optional typestringtype of the event
Optional callbackEventListenerfunction to be called

Returns

FontPainter

this

Inherited from

EventDispatcher.off

off<E>(type, callback): FontPainter

Type parameters

NameType
Eextends string

Parameters

Name Type
typeE
callback(eventType: E, sender: FontPainter, args: EventMap[E]) => void

Returns

FontPainter

Inherited from

EventDispatcher.off


on

on(type, callback, options?): FontPainter

Attach listener on event that will be called whenever the specified event is delivered to the target

If the callback function is already in the list of event listeners for this target, the function is not added a second time.

If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target.

Parameters

Name Type Description
typestringtype of event or property
callbackEventListenerto be called
Optional optionsOptionsoptions of subscription

Returns

FontPainter

this

Inherited from

EventDispatcher.on

on<E>(type, callback, options?): FontPainter

Type parameters

NameType
Eextends string

Parameters

Name Type
typeE
callback(eventType: E, sender: FontPainter, args: EventMap[E]) => void
Optional optionsOptions

Returns

FontPainter

Inherited from

EventDispatcher.on


render

render(context, symbol, bbox): void

Draw text on context

Parameters

Name Type Description
contextRenderingContextrendering context
symbolSymbolShapesymbol, which uses this painter
bboxRectbounding box

Returns

void

Implementation of

IPainter.render


setProperties

setProperties(props?): FontPainter

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propsOptionsfont painter properties

Returns

FontPainter

this


setSilent

setSilent(bool): FontPainter

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

FontPainter

this

Inherited from

EventDispatcher.setSilent


getClassName

Static getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName