Font advanced config options added (for v2.0.6+)

This commit is contained in:
Mykhailo Stadnyk
2016-09-27 22:47:03 +03:00
parent 8cd81193e0
commit 433c5dfa38
2 changed files with 17 additions and 3 deletions

View File

@@ -8,10 +8,12 @@ import {
} from 'canvas-gauges';
let linearOptions: LinearGaugeOptions = {
renderTo: document.createElement('canvas')
renderTo: document.createElement('canvas'),
fontNumbersStyle: 'italic'
};
let radialOptions: RadialGaugeOptions = {
renderTo: 'gauge-id'
renderTo: 'gauge-id',
fontNumbersWeight: 'bold'
};
new LinearGauge(linearOptions);

View File

@@ -4,6 +4,10 @@
// Definitions: https://github.com/Mikhus/DefinitelyTyped
declare namespace CanvasGauges {
export type FontStyle = 'normal' | 'italic' | 'oblique';
export type FontWeight = 'normal' | 'bold' | 'bolder' | 'lighter' |
'100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
export type RenderTarget = string|HTMLElement;
export interface AnimationRule {
@@ -86,7 +90,15 @@ declare namespace CanvasGauges {
fontTitleSize?: number,
fontValueSize?: number,
fontUnitsSize?: number,
fontNumbersSize?: number
fontNumbersSize?: number,
fontTitleStyle?: FontStyle,
fontValueStyle?: FontStyle,
fontUnitsStyle?: FontStyle,
fontNumbersStyle?: FontStyle,
fontTitleWeight?: FontWeight,
fontValueWeight?: FontWeight,
fontUnitsWeight?: FontWeight,
fontNumbersWeight?: FontWeight
}
export interface RadialGaugeOptions extends GenericOptions {