10 Replies Latest reply on Dec 7, 2012 12:17 AM by dasimonx

    ttf to otf

    dasimonx Level 1

      hi

      i want to convert ttf font to otf font (i need cff table to create swf font in as3 beacause i use tlf) with makeotfexe.exe trought commanline... is it possible ?

      if not how to build cff table with the glyf and loca table of the ttf font in as3...

      thanks

      Simon

        • 1. Re: ttf to otf
          MiguelSousa Adobe Employee

          Simon,

          makeOTF can't convert between font formats. There's no FDK tool that you can use for that.

          Also, keep in mind that if these are fonts that you licenced, you should make sure that the license allows you to do such conversions.

          • 2. Re: ttf to otf
            dasimonx Level 1

            hi Miguel,

            i work for a book editor who have built the font licence for all support (print, web...), do you know a way to create the cff table with the glyf and loca table ?

            thanks

            Simon

            • 3. Re: ttf to otf
              MiguelSousa Adobe Employee

              You'll need to use a font editor or a font converter app.

              • 4. Re: ttf to otf
                dasimonx Level 1

                i need to do that  in runtime with as3... it seems to be hard to do that in pure as3 code but i can use a exe file and communicate with it with NativeProcess class, but i can't find a font converter standalone exe... do u know one ?

                thanks

                Simon

                • 5. Re: ttf to otf
                  MiguelSousa Adobe Employee

                  I guess I didn't quite understand what you're trying to do.

                  You want to convert a whole TT font to OT/CFF font at runtime? Why do you need to do that?

                  TLF supports both TTF and OTF. What it doesn't support is Type 1 fonts.

                  • 6. Re: ttf to otf
                    dasimonx Level 1

                    tlf dont support ttf because ttf doesn't have cff table, tlf need a definefont 4 font definition with the cff table, otf (opentype) have cff table but ttf (truetype) doesn't have this table, the glyph is describe in ttf with glyf and loca table....

                    • 7. Re: ttf to otf
                      MiguelSousa Adobe Employee

                      I'll admit that my knowledge on DefineFont4 and using fonts in Flash is a bit rusty, but I think you're wrong. I'm 99% sure that TLF supports TrueType fonts.

                       

                      Have you considered embedding the fonts?

                      Here's a code example: Embedding fonts in ActionScript

                      The part of most importance to you is probably this one:

                       

                      [Embed(source='../assets/MyriadWebPro.ttf',
                      fontName='myMyriadFont',
                      mimeType='application/x-font',
                      embedAsCFF='true' )]
                      // You do not use this variable directly. It exists so that
                      // the compiler will link in the font.
                      private var font1:Class;

                       

                      The embedAsCFF value is what will determine if the font is embedded as DefineFont3 (false) or DefineFont4 (true). As you may know, TLF components require DF4. This is valid for TrueType (.ttf) and OpenType (.otf) fonts alike, despite the 'CFF' letters in the keyword.

                      • 8. Re: ttf to otf
                        dasimonx Level 1

                        you're right but when you embed a font like that in flex, it convert the font in swf with flex-fontkit.jar, that create the cff table with java. I can't use this because i need to convert the font when the air application run and not when i create the air application. if you got an idea...

                        thanks

                        Simon

                        • 9. Re: ttf to otf
                          MiguelSousa Adobe Employee

                          OK, I guess you're looking for a way to generate low-level font data in AS3. I can tell you that there's no native solution. You may be able to find a library somewhere that does it, but I don't know of any.

                           

                          If you want to pursue the approach of running a font converter from the command line, I think you could try FontForge.

                           

                          Good luck!

                          • 10. Re: ttf to otf
                            dasimonx Level 1

                            thanks