2 Replies Latest reply on Feb 2, 2012 5:18 PM by P.o.l.a.c.o

    HTML bold and regular text on Spark components with embeded fonts

    P.o.l.a.c.o Level 1

      Hi!

       

      I have been taking a look to the new (at least new for me) Flex 4 textflow.

      I am using a  spark textarea which is assigned an style that uses an embed font, the problem is that when the textarea renders text marked as bold (using <span fontWeight="bold">) it looses the embeded font style.

      How could I display bold text and regular text in the same text area using embeded fonts?

       

       

      thanks in advanced

        • 1. Re: HTML bold and regular text on Spark components with embeded fonts
          P.o.l.a.c.o Level 1

          can be a font embed with several fontWeights?

          eg:

          @font-face {

              src: url("location");

              fontFamily: myfontalias;

              fontWeight: normal, bold, heavy ;

          }

           

          instead of having to do two embedings like this?

           

          @font-face {

              src: url("location");

              fontFamily: myfontaliasNormal;

              fontWeight: normal;

          }

           

          @font-face {

              src: url("location");

              fontFamily: myfontaliasBold;

              fontWeight: bold;

          }

           

          Why is styling so complicated?

          Can anyone recommend some lecture regarding this topic?

          thanks again.

          • 2. Re: HTML bold and regular text on Spark components with embeded fonts
            P.o.l.a.c.o Level 1

            this is exactly what I was looking for:

             

            <fx:Style>

                 @font-face {

                    src:url("../assets/MyriadWebPro.ttf");

                    fontFamily: myFont;

                    embedAsCFF: true;

                 }

             

                 @font-face {

                    src:url("../assets/MyriadWebPro-Bold.ttf");

                    fontFamily: myFont;

                    fontWeight: bold;

                    embedAsCFF: true;

                 }

             

                 @font-face {

                    src:url("../assets/MyriadWebPro-Italic.ttf");

                    fontFamily: myFont;

                    fontStyle: italic;

                    embedAsCFF: true;

                 }

                

                 .myPlainStyle {

                    fontSize: 20;

                    fontFamily: myFont;

                 }

                

                 .myBoldStyle {

                    fontSize: 20;

                    fontFamily: myFont;

                    fontWeight: bold;

                 }

             

                 .myItalicStyle {

                    fontSize: 20;

                    fontFamily: myFont;

                    fontStyle: italic;

                 }

              </fx:Style>

             

             

            so now I can set font face on the style to "myFont" and Flash will render the font accordingly.

            http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7f5f.html

             

            nice!