6 Replies Latest reply on Jul 29, 2009 10:29 AM by RossRitchey

    Text not displaying

    RossRitchey Level 4

      I have been slowly converting an AS3 Flash IDE-based interface to Flash Builder, keeping up with the daily builds (for the most part) and reporting bugs as I go.

       

      For a long while, things were going great, aside from the several bugs that I reported.  At some point along the way, though, the text in my entire project started not displaying properly.  Certain characters do not display at all.

       

      It is a Windows standard font, though newer (Calibri), and the entire font set is currently embedded in the project.

       

      For some reason, most capital letters do not display, nor do certain special characters (underscore, etc)  Some lowercase letters don't display.

       

      It is always the same letters that don't display.

       

      I thought this was an issue with the build, but I rolled the SDK back the whole way to 4.0 (the original beta build) and it is happening there as well.  There is no rhyme or reason to it, as far as I can tell.

       

      Here is a screenshot with the problem:

      07-29-09-001.jpg

       

      The tabs should read:

      Menu
      Important Points

      Glossary


      The menu list should read:

      Pre-Test Pt 1
      4800_020

      Fred Bauer Audio

      Learning Activity

      Learning Activity

      Fred Bauer Audio

      4800_020

      Learning Activity

      Learning Activity

       

      And the horizontal list at the bottom should read:
      Page 1

      2

      3

      4

      5

      6

      7

      8

      9

       

      Has anyone else encountered this type of problem? Any workarounds?

        • 1. Re: Text not displaying
          Flex harUI Adobe Employee

          Try a simpler example, make sure you are using the embedAsCFF and fontLookup styles correctly

           

          Alex Harui

          Flex SDK Developer

          Adobe Systems Inc.

          Blog: http://blogs.adobe.com/aharui

          1 person found this helpful
          • 2. Re: Text not displaying
            RossRitchey Level 4

            I determined that I wasn't using the proper embed methods, though this doesn't solve the problem.

             

             

            The font is now embedded properly:

            [Embed(source='C:/WINDOWS/FONTS/CALIBRI.TTF', fontFamily='Calibri', mimeType="application/x-font", embedAsCFF="true")]
            public static var CalibriEmbedded:Class;
            

             

            And all font family references in the textFormat's use CalibriEmbedded as the name to reference the font.

             

            Now, though, the font is displaying as the default, rather than Calibri.  All characters are showing, but they are serif-ed, where Calibri is a sans-serif font.

            • 3. Re: Text not displaying
              Flex harUI Adobe Employee

              When you said Flex 4, I assumed you were using Spark components.  Sounds like you're not (maybe just straight TextField)?

               

              So, Spark requires embedAsCFF, but the TextField and Halo components do not.  Then maybe the missing chars are due to a different fontWeight or fontStyle on those chars?  You have to embed each weight and style as well.

               

              Alex Harui

              Flex SDK Developer

              Adobe Systems Inc.

              Blog: http://blogs.adobe.com/aharui

              1 person found this helpful
              • 4. Re: Text not displaying
                RossRitchey Level 4

                Definitely using Spark components, and every one of them is using a custom Spark skin.

                 

                I am not using differing weights for any of the text, let alone inside of a single word, so, unless Gumbo is changing this in compilation, this is not likely the culprit.

                 

                All itemRenderer skins, as well as the s:ButtonBarButtons at the top use s:RichText for the labels

                • 5. Re: Text not displaying
                  Peter deHaan Level 4

                  Rich,

                   

                  +1 to Alex's simple test case suggestion.

                   

                  For example, does this work for you?

                  It renders correctly on for me using XP/FP 10.0.22.87 (debug) with SDK 4.0.0.8847:

                   

                  <?xml version="1.0" encoding="utf-8"?>
                  <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                          xmlns:s="library://ns.adobe.com/flex/spark"
                          xmlns:mx="library://ns.adobe.com/flex/halo">
                   <s:layout>
                          <s:HorizontalLayout gap="20" paddingLeft="20" paddingTop="20" />
                      </s:layout>
                      <fx:Script>
                          <![CDATA[
                              [Embed(source='C:/WINDOWS/FONTS/CALIBRI.TTF',
                                     fontFamily='CalibriE',
                                     mimeType="application/x-font",
                                     embedAsCFF="true")]
                              public static var CalibriEmbedded:Class;
                          ]]>
                      </fx:Script>
                      <fx:Style>
                          @namespace s "library://ns.adobe.com/flex/spark";
                          @namespace mx "library://ns.adobe.com/flex/halo";
                          s|SimpleText,
                          s|RichText,
                          s|RichEditableText {
                              fontFamily: "CalibriE";
                          }
                      </fx:Style>
                      <s:VGroup>
                          <s:SimpleText text="SimpleText test:" fontSize="16" />
                          <s:SimpleText text="Menu" />
                          <s:SimpleText text="Important Points" />
                          <s:SimpleText text="Glossary" />
                          <mx:HRule width="100%" />
                          <s:SimpleText text="Pre-Test Pt 1" />
                          <s:SimpleText text="4800_020" />
                          <s:SimpleText text="Fred Bauer Audio" />
                          <s:SimpleText text="Learning Activity" />
                          <s:SimpleText text="Learning Activity" />
                          <s:SimpleText text="Fred Bauer Audio" />
                          <s:SimpleText text="4800_020" />
                          <s:SimpleText text="Learning Activity" />
                          <s:SimpleText text="Learning Activity" />
                          <s:SimpleText text="Page 1" />
                      </s:VGroup>
                      <s:VGroup>
                          <s:RichText text="RichText test:" fontSize="16" />
                          <s:RichText text="Menu" />
                          <s:RichText text="Important Points" />
                          <s:RichText text="Glossary" />
                          <mx:HRule width="100%" />
                          <s:RichText text="Pre-Test Pt 1" />
                          <s:RichText text="4800_020" />
                          <s:RichText text="Fred Bauer Audio" />
                          <s:RichText text="Learning Activity" />
                          <s:RichText text="Learning Activity" />
                          <s:RichText text="Fred Bauer Audio" />
                          <s:RichText text="4800_020" />
                          <s:RichText text="Learning Activity" />
                          <s:RichText text="Learning Activity" />
                          <s:RichText text="Page 1" />
                      </s:VGroup>
                      <s:VGroup>
                          <s:RichEditableText text="RichEditableText test:" fontSize="16" />
                          <s:RichEditableText text="Menu" />
                          <s:RichEditableText text="Important Points" />
                          <s:RichEditableText text="Glossary" />
                          <mx:HRule width="100%" />
                          <s:RichEditableText text="Pre-Test Pt 1" />
                          <s:RichEditableText text="4800_020" />
                          <s:RichEditableText text="Fred Bauer Audio" />
                          <s:RichEditableText text="Learning Activity" />
                          <s:RichEditableText text="Learning Activity" />
                          <s:RichEditableText text="Fred Bauer Audio" />
                          <s:RichEditableText text="4800_020" />
                          <s:RichEditableText text="Learning Activity" />
                          <s:RichEditableText text="Learning Activity" />
                          <s:RichEditableText text="Page 1" />
                      </s:VGroup>
                      <s:SimpleText activate="event.currentTarget.text = mx_internal::VERSION;" />
                  </s:Application>
                  

                   

                  Peter

                  • 6. Re: Text not displaying
                    RossRitchey Level 4

                    Thanks Peter and Alex

                     

                    @Peter - when I ran your test (after fixing the couple errors that were in it) it rendered perfectly using build 4,0,0,8811

                     

                    That got me thinking, I wonder where the issue was in mine.  Turns out, I was using the class name (CalibriEmbedded) to call the font, rather than the fontFamily of the embedded font (CalibriE).  So, I fixed that in my style XML, and now it renders correctly.