Select to view content in your preferred language

infoWindow label font change?

2295
1
09-10-2012 10:30 AM
MikeDahm
Frequent Contributor
I am having difficulty changing the font family for the InfoWindow label in the header.  Is this possible?  I am using a copy of the InfoWindowSkin and have changed the fontfamily for the content but the fontfamily does not appear to do anything to the InfoWindowLabel.  Below is the code I have in the InfoWindowSkin (the font style is identified in the Style area and works correctly for the content).

     <s:HGroup id="headerGroup"
                  width="100%"
                  includeInLayout.withoutHeader="false"
                  minWidth="0"
                  verticalAlign="middle"
                  visible.withoutHeader="false">
            <esri:InfoWindowLabel id="labelText"
    fontFamily="myriadFont"
    fontSize="30"
    color="#FFFFFF"/>
            <s:Rect width="100%" height="30"
                    minWidth="0"/>
            <esri:InfoWindowCloseButton id="closeButton"/>
  </s:HGroup>
   <s:Group id="contentGroup"
    width="100%" height="100%"
    fontSize="20" 
    fontFamily="myriadBoldFont"
    minHeight="0"
    minWidth="0"
    color="#000000"
    contentBackgroundColor="#B0B0B0">
    
   </s:Group>
Tags (2)
0 Kudos
1 Reply
TrishRempel
Occasional Contributor
Hi Mike,

The fontFamily and fontSize CSS properties for the InfoWindowLabel are being overwritten at run-time by UIManager.as:

var cssStyleDeclarationInfoWindowLabel:CSSStyleDeclaration = topLevelStyleManager.getStyleDeclaration("com.esri.ags.components.supportClasses.InfoWindowLabel");
cssStyleDeclarationInfoWindowLabel.setStyle("fontSize", fontSize);
cssStyleDeclarationInfoWindowLabel.setStyle("fontFamily", fontName);
topLevelStyleManager.setStyleDeclaration("com.esri.ags.components.supportClasses.InfoWindowLabel", cssStyleDeclarationInfoWindowLabel, false);


You could try creating a CSS style in defaults.css and setting the styleName property in your skin to the name of the style you created (I haven't tested to see whether this will override the fontSize/fontFamily declarations), or you could comment out these lines in UIManager.as.

Please remember to use the "Vote Up" and "Mark as Answer" buttons if this post has been helpful to you.
0 Kudos