Patent attributes
A system, method and non-transitory, computer-readable storage medium are disclosed for implementing dynamic layout rules for attributed text strings having different type styles. In some implementations, developers can use an Application Programming Interface (API) or a design tool to specify dynamic text layout rules for rendering attributed text strings in a user interface (UI). Various text attributes associated with the different type styles (e.g., font metrics) are dynamically adjusted based on the dynamic text layout rules to improve the readability of the text when, for example, font sizes are adjusted. In some implementations, one or more parameters of a text container, text container region, line-fragment or display object are dynamically adjusted based on the dynamic text layout rules to improve the readability of the text.