API / geotoolkit / scene / shapes / painters / FontPainter / FontPainter
painters.FontPainter.FontPainter
Draws a font symbol
↳
FontPainter
Constructors
Methods
Css Properties
| Name | Type | Description |
|---|---|---|
family | string | Font family, must match to file name |
fill | string | Text fill style |
fill | FillStyle | Text fill style |
fill-color | string | Color in CSS form |
fill-evenoddmode | boolean | Even-odd fill mode |
fill-fillpattern | Pattern | Pattern |
fill-fillpattern-containername | string | An 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-patternname | string | Name of this pattern for indexing |
fill-fillpattern-scalable | boolean | Flag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported) |
fill-foreground | string | Foreground color |
fill-pattern | Pattern | Pattern |
text | string | Text which be drawn as a symbol, ascii or unicode |
url | string | Font url |
Constructors
• new FontPainter(url?, family?, text?)
Create FontPainter
| Name | Type | Description |
|---|---|---|
Optional url | string | ArrayBuffer | Options | font url or properties object |
Optional family | string | font family, must match to file name |
Optional text | string | text which be drawn as a symbol, ascii or unicode |
EventDispatcher.constructor
Methods
▸ clone(): FontPainter
Creates a clone of the painter, detaching itself from font fill style
▸ dispose(): void
Dispose.
void
▸ getClassName(): string
string
▸ getProperties(): OptionsOut
Gets all the properties pertaining to the font painter
font painter properties
▸ hasEventListener(type, callback?): boolean
Check if a list of event listeners for this type contains this listener
| Name | Type | Description |
|---|---|---|
type | string | type of event or property |
Optional callback | Function | to be called, if null, check if any callback is registered |
boolean
EventDispatcher.hasEventListener
▸ isDisposed(): boolean
Returns whether this object has been disposed
boolean
▸ isSilent(): boolean
Return true if the event dispatcher doesn't notify any events
boolean
▸ notify(type, source, args?): FontPainter
Notify listeners
| Name | Type | Description |
|---|---|---|
type | string | event types |
source | any | of the event |
Optional args | any | arguments of the event |
this
▸ 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.
| Name | Type | Description |
|---|---|---|
Optional type | string | type of the event |
Optional callback | EventListener | function to be called |
this
▸ off<E>(type, callback): FontPainter
| Name | Type |
|---|---|
E | extends string |
| Name | Type |
|---|---|
type | E |
callback | (eventType: E, sender: FontPainter, args: EventMap[E]) => void |
▸ 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.
| Name | Type | Description |
|---|---|---|
type | string | type of event or property |
callback | EventListener | to be called |
Optional options | Options | options of subscription |
this
▸ on<E>(type, callback, options?): FontPainter
| Name | Type |
|---|---|
E | extends string |
| Name | Type |
|---|---|
type | E |
callback | (eventType: E, sender: FontPainter, args: EventMap[E]) => void |
Optional options | Options |
▸ render(context, symbol, bbox): void
Draw text on context
| Name | Type | Description |
|---|---|---|
context | RenderingContext | rendering context |
symbol | SymbolShape | symbol, which uses this painter |
bbox | Rect | bounding box |
void
▸ setProperties(props?): FontPainter
Sets all the properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional props | Options | font painter properties |
this
▸ setSilent(bool): FontPainter
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
this
▸ Static getClassName(): string
string