1 Reply Latest reply on May 3, 2009 10:54 PM by Srirangan

    Dynamic Fonts

    ckisthebest

      We can not rotate system fonts. So we need to embed it with SWF.

       

      In my project I want to load fonts from database. How can I do it??

       

      Is it possible? Can anyone give me idea?

       

      Thanks

      CK

        • 1. Re: Dynamic Fonts
          Srirangan Level 2

          For embedding fonts from a database, you need to:

          1. Have server side code that saves the font as a file on the server

          2. Pass the url of the font file to the Flex application

          3. On the Flex end, apply the stylesheet using the new font location

           

          <mx:Style>
                  @font-face
                  {
                      font-family: Copacetix;

                      src: url("assets/copacetix.ttf");
                      unicode-range:
                          U+0020-U+0040, /* Punctuation, Numbers */

                          U+0041-U+005A, /* Upper-Case A-Z */
                          U+005B-U+0060, /* Punctuation and Symbols */
                          U+0061-U+007A, /* Lower-Case a-z */
                          U+007B-U+007E; /* Punctuation and Symbols */

                  }

                  .MyTextStyle
                 
          {
                      font-family: Copacetix;
                      font-size: 24pt;   
                  }

          </mx:Style>
          1 person found this helpful