summaryrefslogtreecommitdiffstats
path: root/dist/svg.js
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2017-03-08 19:34:22 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2017-03-08 19:34:22 +0100
commit5587dd76de4d17038111e713d135e8a0a4f17453 (patch)
treee34c7b3ca2404b7401a5b832fac1490419a3c928 /dist/svg.js
parent1f7a0ac6b903eb90ef8468aa2b2bd95d5df43c34 (diff)
downloadsvg.js-5587dd76de4d17038111e713d135e8a0a4f17453.tar.gz
svg.js-5587dd76de4d17038111e713d135e8a0a4f17453.zip
add ability to use `font()` method like `attr()` method (#620)
Diffstat (limited to 'dist/svg.js')
-rw-r--r--dist/svg.js23
1 files changed, 12 insertions, 11 deletions
diff --git a/dist/svg.js b/dist/svg.js
index 66ac30c..b48e1b9 100644
--- a/dist/svg.js
+++ b/dist/svg.js
@@ -6,7 +6,7 @@
* @copyright Wout Fierens <wout@mick-wout.com>
* @license MIT
*
-* BUILT: Wed Mar 08 2017 14:43:51 GMT+0100 (Mitteleuropäische Zeit)
+* BUILT: Wed Mar 08 2017 19:30:37 GMT+0100 (Mitteleuropäische Zeit)
*/;
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
@@ -4986,17 +4986,18 @@ SVG.extend(SVG.Path, {
SVG.extend(SVG.Parent, SVG.Text, SVG.Tspan, SVG.FX, {
// Set font
- font: function(o) {
- for (var k in o)
- k == 'leading' ?
- this.leading(o[k]) :
- k == 'anchor' ?
- this.attr('text-anchor', o[k]) :
- k == 'size' || k == 'family' || k == 'weight' || k == 'stretch' || k == 'variant' || k == 'style' ?
- this.attr('font-'+ k, o[k]) :
- this.attr(k, o[k])
+ font: function(a, v) {
+ if (typeof a == 'object') {
+ for (v in a) this.font(v, a[v])
+ }
- return this
+ return a == 'leading' ?
+ this.leading(v) :
+ a == 'anchor' ?
+ this.attr('text-anchor', v) :
+ a == 'size' || a == 'family' || a == 'weight' || a == 'stretch' || a == 'variant' || a == 'style' ?
+ this.attr('font-'+ a, v) :
+ this.attr(a, v)
}
})