StyleSheet ss = getStyleSheet(); float emBase = ss.getEMBase(attributes); float exBase = ss.getEXBase(attributes); cssWidth = (Length) attributes.getAttribute(CSS.Attribute.WIDTH); if (cssWidth != null) cssWidth.setFontBases(emBase, exBase); cssHeight = (Length) attributes.getAttribute(CSS.Attribute.WIDTH); if (cssHeight != null) cssHeight.setFontBases(emBase, exBase); }
  protected void setPropertiesFromAttributes()  {    super.setPropertiesFromAttributes();    // Fetch CSS attributes.    AttributeSet atts = getAttributes();    Object o = atts.getAttribute(CSS.Attribute.TEXT_ALIGN);    if (o != null)      {        String align = o.toString();        if (align.equals("left"))          setJustification(StyleConstants.ALIGN_LEFT);        else if (align.equals("right"))          setJustification(StyleConstants.ALIGN_RIGHT);        else if (align.equals("center"))          setJustification(StyleConstants.ALIGN_CENTER);        else if (align.equals("justify"))          setJustification(StyleConstants.ALIGN_JUSTIFIED);      }    // Fetch StyleSheet's box painter.    painter = getStyleSheet().getBoxPainter(atts);    setInsets((short) painter.getInset(TOP, this),              (short) painter.getInset(LEFT, this),              (short) painter.getInset(BOTTOM, this),              (short) painter.getInset(RIGHT, this));    // TODO: Handle CSS width and height attributes somehow.  }