4 Replies Latest reply on Dec 21, 2010 11:05 PM by rayess

    Using embedded font in tree control

    rayess

      Hi,

       

      I'm trying to use an embedded font to change the font family of a tree control but with no hope, I tested the embedded font with a label component and it worked fine but for the tree control I couldn't succeed.

       

      Can any one help in this, does anyone have a clue?

        • 1. Re: Using embedded font in tree control
          flex2008 Level 3

          Can you post a sample code where the issue can be reproduced?.I just tried using an embedded font with a Tree and it worked for me.

          • 2. Re: Using embedded font in tree control
            rayess Level 1

            Hi,

             

            Here is part of the code:

             

             

            <?xml version="1.0" encoding="utf-8"?>
            <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:custComp="customComp.*"
                  width="100%" height="100%" layout="absolute" backgroundColor="#FFFFCC" backgroundAlpha="0.4">
            
            
            <mx:Style>
            .mystyle1 {
            fontFamily:myPlainFont;
            fontSize: 32pt;
            }
            </mx:Style>
            <mx:Script>
                 <![CDATA[
                 [Embed(systemFont='Mufferaw',
                      fontName='myPlainFont',
                      mimeType='application/x-font'
                     )]
                     private var font1:Class;
            
                  ]]>
            </mx:Script>
            
            
            <mx:XMLList id="tableOfContents">
                 <node label="Phase 9 Solution Description">
                      <node label="Executive Summary"/>
                      <node label="Current Network Layout"/>
                      <node label="Proposed Network Layout"/>
                      <node label="Network Software Licenses"/>
                      <node label="Core Network">
                           <node label="Hardware"/>
                           <node label="Software"/>
                      </node>
                      <node label="Radio Access Network">
                           <node label="BSC">
                                <node label="Hardware"/>
                                <node label="Software"/>
                           </node>
                      </node>
                 </node>
            </mx:XMLList>
            
            
            <mx:Canvas width="100%" height="100%">
            <mx:Panel height="100%" width="350" horizontalAlign="center" title="Control Panel">
                 <mx:TabNavigator id="menuTab" width="100%" height="100%" change="{if (menuTab.selectedChild.label == 'Solution Description') {displayPanel.title = menuTab.selectedChild.label}else{displayPanel.title = menuTab.selectedChild.label + ' Network Information'}}">
                 <mx:VBox label="Solution Description" width="100%"     height="100%" horizontalAlign="center">
                      <mx:Tree id="contentsTree" dataProvider="{tableOfContents}" width="96%" height="96%" labelField="@label" borderStyle="none" backgroundAlpha="0" fontWeight="bold"
                      creationComplete="trace(contentsTree.itemRenderer)"/>
            
                      <mx:Label text="font test" fontFamily="myPlainFont" fontSize="20"/>
                 </mx:VBox>
            
                 </mx:TabNavigator>
            </mx:Panel>
            </mx:VBox>
            </mx:Canvas>
            </mx:WindowedApplication>
            

             

             

             

            Actually this is not the whole code but I tried to emmit the ones that shouldn't have relation to the issue.

            The code had worked for the label but not for the tree.

            • 3. Re: Using embedded font in tree control
              Flex harUI Adobe Employee

              You have to embed the bold version of the font as well.

              • 4. Re: Using embedded font in tree control
                rayess Level 1
                function(){return A.apply(null,[this].concat($A(arguments)))}

                Flex harUI wrote:

                 

                You have to embed the bold version of the font as well.

                 

                Thanks man, u made my day.