Hi all,
I would like to use the exact string of an attribute value as a property value when defining a text format rule in the EDD.
Is there a way to get the attribute value by using a variable?
---
Example:
This is a <font family="Helvetica">test</font>.
I have an element "font" with the attribute "family". The value of this attribute is the name of the font family that I would like to use for the text in the "font" element.
So in my example "test" shall be formatted with Helvetica.
Of course I could use a context rule for every font family, like this:
If context is: [family="Helvetica"] Text range.
Font properties
Family: HelveticaIf context is: [family="Arial"] Text range.
Font properties
Family: ArialIf context is: [family="Times"] Text range.
Font properties
Family: Times ... etc.
The problem is that I can't tell which fonts I am going to use in future plus they can change from time to time. That's why I would like to avoid having to update my EDD and add or remove text format rules every time I know that I am going to use a new font. For that reason I am looking for a way to format the text with the value of the attribute "family".
I've found out that I can output the attribute value in a prefix or suffix rule by using <$attribute[value]>.
So the rule
In all contexts.
Prefix:<$attribute[family]>
would output the following:
This is a Helveticatest.
That means whatever the value of "family" is, it can be displayed as a prefix or suffix by using this variable. But unfortunately this kind of variable doesn't seem to work in text format rules as I always get this error message:
Referenced font family (<$attribute[family]>) does not exist. Property was not imported.
Do you have any helpful ideas? Thanks a lot in advance!
Best regards from Germany,
Sebastian