Skip to main content
1-Visitor
February 6, 2014
Question

How to modify the font size of the element using an attribute.

  • February 6, 2014
  • 1 reply
  • 2047 views

Hi everybody!

Anyone knows how to modify the font size of the element using any its attribute?

Example:

In my DTD, I've this element:

<!ELEMENT para EMPTY>

<!ATTLIST para

font-size NUMBER #IMPLIED

>

How to use this attribute 'font-size' to set the font size?

This appear a easy case, but I haven't seen this function in Arbortext.

1 reply

5-Regular Member
February 6, 2014

Hey again Robson,

This would be resolved similar to the example I provided for the field with only an X in it.

The functionality isn't in Editor itself, but in the Styler component.

You would create a new context, with an attribute check on the font-size field.

Of course, each context can only assign one specific font size, so you would need to have a context for each font size you expect users to input. So it might look similar to (replacing 'os' with 'font-size'):

fontsize.png

rboneti1-VisitorAuthor
1-Visitor
February 6, 2014

Rafael,

Actually, I need that when I type the attribute on the xml, the font adjusts automatically, like works with the graphics (when I change the attribute of the height, it adjusts the height automatically).

rboneti1-VisitorAuthor
1-Visitor
February 6, 2014

Thanks for all!

I solved this case using the APP.

For this, I saw the interface style and changed the font's height. Like this:

style.height = arguments[0].attributes.font-size+'pt';