Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
tseebach
Luminary Alumni
Luminary Alumni

Font font font

Hi,

I've got some generic and I hope usefull extensions almost ready. But I still miss the last piece in the puzzle: Font properties.

Can someone tell me how to load any of the default font values, either on a document or object level into my extension so every user does'nt need to hack the typeface?

I'm sorry that I've posted this question the third time now, but the stuff that goes on the market needs work properly.

Thanks for any suggestions!

1 Solution

Accepted Solutions
tseebach
Luminary Alumni
Luminary Alumni
Author

I FOUND IT!!! WUHUUUUUU!!!

            for (prop in this.Layout.Style) {
               alert(prop + ' = ' + this.Layout.Style[prop]);
          }
          fontfamily = this.Layout.Style.fontfamily;
          fontsize = this.Layout.Style.fontsize+'px';
          fontstyle = this.Layout.Style.fontstyle;
          fontweigth = this.Layout.Style.fontweigth;
          textdecoration = this.Layout.Style.textdecoration;

I used the above for loop to loop the properties, and found the Style under Layout which has what I was looking for. If you change the font settings on the object properties the variables change! Wuhu!!

There seems to be an error in the dokumentation for this.

this should be

     Qv.Document.Object.Layout.Style

View solution in original post

4 Replies
Nicole-Smith

This is how I've been handling fonts in extensions (see attachment).

Alexander_Thor
Employee
Employee

There is no documented method in the API to access the default font options set in the qvw.

I've forwarded the question internally to see if there is any decent hack floating around, i.e unsupported.

Or do you only want to re-use the PropertiesFont.qvpp dialog?

tseebach
Luminary Alumni
Luminary Alumni
Author

Hi Nicole and Alexander,

Nicole, I will test your trick as soon as I get home. Looks promising - I guess that would use the Document Settings. That would be a great improvement.

Alexander, since the Font and Caption boxes are there by default, I'd definitely prefere to use them. I've just not been able to figure out how call them. I've tried all sorts of stuff to dump out the "this" object but all attemps have crashed my browser. I expect they must be in there somewhere!

I would prefere that the object I'm creating would get these properties by default, and that I simply could add some bold formatting where needed. A lot of the extensions I've seen are really hard to implement in a nice layout without having to hardcode all the fonts.

tseebach
Luminary Alumni
Luminary Alumni
Author

I FOUND IT!!! WUHUUUUUU!!!

            for (prop in this.Layout.Style) {
               alert(prop + ' = ' + this.Layout.Style[prop]);
          }
          fontfamily = this.Layout.Style.fontfamily;
          fontsize = this.Layout.Style.fontsize+'px';
          fontstyle = this.Layout.Style.fontstyle;
          fontweigth = this.Layout.Style.fontweigth;
          textdecoration = this.Layout.Style.textdecoration;

I used the above for loop to loop the properties, and found the Style under Layout which has what I was looking for. If you change the font settings on the object properties the variables change! Wuhu!!

There seems to be an error in the dokumentation for this.

this should be

     Qv.Document.Object.Layout.Style