Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

attr: font-size not working. #595

Closed
asenner opened this Issue · 7 comments

4 participants

asenner Sebastián Gurin nikkilocke Tomas Alabes
asenner

paper.text(startBox.x2 + 30, startBox.y, 'Triggers').attr({
"font-family":"serif",
"font-style":"bold",
"font-size":"350px" // (Also tried 30, 30pt, 30px)
});

Font-size does not change whatsoever.

Google Chrome 19.0.1084.56 (Official Build 140965) m
OS Windows
WebKit 536.5 (@119244)
JavaScript V8 3.9.24.29
Flash 11,3,300,257
User Agent Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5

Sebastián Gurin

just use a number, like attr({"font-size": 20});

asenner

If you look at the comment next to the font-size property you'll see the other values I used with no success, including, just the number, 30. The font-size will not change at all and I can't seem to find anyone else experiencing this issue.

Sebastián Gurin

yes, but have you tried with a javascript number not string - i.e 30 vs "30". Also I have tested and "30px" it is working ok. try the examples at http://cancerbero.vacau.com/raphaeltut/#sec-shape-text (you can run them directly just press "Run". Those examples are working for me in firefox 12, opera and chrome:

var text1 = paper.text(230,120,"What is happiness?\nThe feeling that power \nincreases - that resistance \nis being overcome.\n Friedrich Nietzsche").
attr({"font-size": "32px", "font-weight": "800", fill: "yellow", stroke:"brown", "stroke-width": "3px"});

asenner

Yes, I have tried the value using just a number, not a string. Interesting. Like I said, I couldn't find anyone else having this issue so I came here to see if anyone had some input. I will keep messing with it and get back to you. Thanks for the quick responses! :)

Sebastián Gurin

did my raphael tutorial examples worked for you? http://cancerbero.vacau.com/raphaeltut/#sec-shape-text

asenner
Tomas Alabes tomasAlabes closed this
nikkilocke

There is an issue. If you have the following css:
* {
font-family: verdana;
font-size: 10pt;
}
then all Raphael text will be 10pt, even if you specify otherwise.

See http://jsfiddle.net/nikkilocke/J94kP/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.