Embedding fonts

I have a program and use it dynamic text. This text, I use a special font CAMPFIRE.ttf.

Many users do not have this font on their pc, but I want so they open my .swf and see this font.

For this I use the following code:

var fooFont:foo = new foo();
               var format:TextFormat = new TextFormat();
               format.font=fooFont.fontName;
               format.color=0xFF0000;
               format.size = 100;
               levelNumbers.height += 100;
               levelNumbers.embedFonts=true;
               levelNumbers.autoSize = TextFieldAutoSize.CENTER;
               levelNumbers.antiAliasType=AntiAliasType.ADVANCED;
               levelNumbers.defaultTextFormat=format;

but I don't see my correct dynamic text. I see strange space on top, do not see the lower part of the text.

Preview of the photo:

e.png

Can someone help please or any other way how to make main idea to offer what I need?

All the code here:

package {

     import flash.events.*;
     import flash.display.*;
     import flash.text.TextField;
     
     import flash.text.TextFormat;
     import flash.text.TextFieldAutoSize;
     import flash.text.AntiAliasType;

     public class GuessNumber extends MovieClip 
     {
          var guessNumber:Number;
          var points:Number = 0;     
          var level:Number = 1;
          var lastGuessNumber:Number = 5;
          
          //constructor
          public function GuessNumber() 
          {
               beginScreen();
          }
          
          public function beginScreen():void
          {
               gotoAndStop('beginScreen');
               playBtn.addEventListener(MouseEvent.CLICK, startGame);
               
               howToPlay_mc.visible = false;
               moreGames_mc.visible = false;
               thanks_mc.visible = false;
               
               howToPlayBtn.addEventListener(MouseEvent.CLICK, howToPlayScreen);
               moreGamesBtn.addEventListener(MouseEvent.CLICK, moreGamesScreen);
               thanksBtn.addEventListener(MouseEvent.CLICK, thanksScreen);
          }
          
          public function startGame(event:MouseEvent):void
          {
               generateNumber();
          }
          
          public function generateNumber(e:Event = null):void 
          {
               gotoAndStop('gameScreen');
               trace("****** Welcome Screen *********");
               pointsView.text = "0";
               levelView.text = "1";
               addEventListener(Event.ADDED_TO_STAGE, startGuess);
               startGuess();
          }
          
          public function howToPlayScreen(event:MouseEvent):void
          {
               trace("Open 'How to play screen'");
               howToPlay_mc.closeBtn.addEventListener(MouseEvent.CLICK, closeHowToPlayScreen);
               
               howToPlayBtn.mouseEnabled = false;
               moreGamesBtn.mouseEnabled = false;
               thanksBtn.mouseEnabled = false;
               
               howToPlayBtn.alpha = 1;
               moreGamesBtn.alpha = 0.5;
               thanksBtn.alpha = 0.5;
               
               howToPlay_mc.visible = true;
               moreGames_mc.visible = false;
               thanks_mc.visible = false;
          }
          public function moreGamesScreen(event:MouseEvent):void
          {
               trace("Open 'More games screen'");
               moreGames_mc.closeBtn.addEventListener(MouseEvent.CLICK, closeMoreGamesScreen);
               
               howToPlayBtn.mouseEnabled = false;
               moreGamesBtn.mouseEnabled = false;
               thanksBtn.mouseEnabled = false;
               
               howToPlayBtn.alpha = 0.5;
               moreGamesBtn.alpha = 1;
               thanksBtn.alpha = 0.5;
               
               howToPlay_mc.visible = false;
               moreGames_mc.visible = true;
               thanks_mc.visible = false;
          }
          public function thanksScreen(event:MouseEvent):void
          {
               trace("Open 'Thanks screen'");
               thanks_mc.closeBtn.addEventListener(MouseEvent.CLICK, closeThanksScreen);
               
               howToPlayBtn.mouseEnabled = false;
               moreGamesBtn.mouseEnabled = false;
               thanksBtn.mouseEnabled = false;
               
               howToPlayBtn.alpha = 0.5;
               moreGamesBtn.alpha = 0.5;
               thanksBtn.alpha = 1;
               
               howToPlay_mc.visible = false;
               moreGames_mc.visible = false;
               thanks_mc.visible = true;
          }
          public function closeHowToPlayScreen(event:MouseEvent):void
          {
               howToPlay_mc.visible = false;
               trace("Close 'How to play screen'");
               
               howToPlayBtn.mouseEnabled = true;
               moreGamesBtn.mouseEnabled = true;
               thanksBtn.mouseEnabled = true;
               
               howToPlayBtn.alpha = 1;
               moreGamesBtn.alpha = 1;
               thanksBtn.alpha = 1;
          }
          public function closeMoreGamesScreen(event:MouseEvent):void
          {
               moreGames_mc.visible = false;
               trace("Close 'More games screen'");
               
               howToPlayBtn.mouseEnabled = true;
               moreGamesBtn.mouseEnabled = true;
               thanksBtn.mouseEnabled = true;
               
               howToPlayBtn.alpha = 1;
               moreGamesBtn.alpha = 1;
               thanksBtn.alpha = 1;
          }
          public function closeThanksScreen(event:MouseEvent):void
          {
               thanks_mc.visible = false;
               trace("Close 'How to play screen'");
               
               howToPlayBtn.mouseEnabled = true;
               moreGamesBtn.mouseEnabled = true;
               thanksBtn.mouseEnabled = true;
               
               howToPlayBtn.alpha = 1;
               moreGamesBtn.alpha = 1;
               thanksBtn.alpha = 1;
          }
          
          public function startGuess(e:Event = null):void 
          {
               trace("**** Starting Guess ****");
               guessBtn.enabled = true;
               guessBtn.visible = true;
               nextLevelBtn.enabled = false;
               nextLevelBtn.visible = false;
               
               var fooFont:foo = new foo();
               var format:TextFormat = new TextFormat();
               format.font=fooFont.fontName;
               format.color=0xFF0000;
               format.size = 100;
               levelNumbers.height += 100;
               levelNumbers.embedFonts=true;
               levelNumbers.autoSize = TextFieldAutoSize.CENTER;
               levelNumbers.antiAliasType=AntiAliasType.ADVANCED;
               levelNumbers.defaultTextFormat=format;
               
               levelNumbers.text = String(lastGuessNumber);
               trace("Guessed number beetween 1 and " + lastGuessNumber);
               yourGuessText.text = "";
               levelView.text = String(level);
               trace("Now Level: " + level);
               pointsView.text = String(points);
               trace("Player Points: " + points);
               
               guessNumber=Math.ceil(Math.random()*lastGuessNumber);
               trace("Guessed number: " + guessNumber);
               
               removeEventListener(Event.ADDED_TO_STAGE,startGuess);
               guessBtn.addEventListener(MouseEvent.CLICK,checkingYourGuess);
          }
          
          public function checkingYourGuess(e:MouseEvent):void 
          {
               if (yourGuessText.length == 0) 
               {
                    trace("need enter something");
                    outputText.text="please enter a number beetween 1 and " + lastGuessNumber;
                    return;
               }               
               
               if (guessNumber == Number(yourGuessText.text)) 
               {
                    outputText.text = "You are GUESS!!!";
                    trace("Guess!");
                    points += 100;
                    trace("Player earn: " + points + " points!");
                    trace("+++++++++++++++++++++++++");
                    trace("go to the next level?");
                    nextLevelBtn.visible = true;
                    guessBtn.visible = false;
                    winGame();
               } 
               else if (guessNumber > Number(yourGuessText.text)) 
               {
                    points -= 20;
                    pointsView.text = String(points);
                    trace("-20 points, need MORE");
                    outputText.text = "need MORE, try again please";
               } 
               else if (guessNumber < Number(yourGuessText.text) && (Number(yourGuessText.text)<= lastGuessNumber)) 
               {
                    points -= 20;
                    pointsView.text = String(points);
                    trace("-20 points, need LESS");
                    outputText.text = "need LESS, try again please";
               }
               else if (Number(yourGuessText.text) > lastGuessNumber)
               {
                    outputText.text = "enter number from 1 to " + lastGuessNumber;
                    trace("enter number from 1 to " + lastGuessNumber);
               }          
          }
          
          public function winGame():void 
          {
               pointsView.text = String(points);
               level += 1;
               if (level == 4)
               {
                    youAreWinner();
                    trace("You are winner!!!!!");
                    pointsView.text = String(points);
                    trace("Player earn: " + points + " points." );
                    level = 1;
                    points = 0;
                    lastGuessNumber = 5;
               }
               else{lastGuessNumber += 10;}
               
               nextLevelBtn.enabled=true;
               guessBtn.enabled=false;
               nextLevelBtn.addEventListener(MouseEvent.CLICK, playAgain);
          }
          
          public function playAgain(event:MouseEvent):void 
          {
               trace("yes");
               outputText.text = "";
               startGuess();
          }
          
          public function youAreWinner():void
          {
               gotoAndStop('finishScreen');
               nextLevelBtn.visible = false;
               guessBtn.visible = false;
               playAgainBtn.addEventListener(MouseEvent.CLICK, generateNumber);
          }
          
     }

}

This isn't a problem with embedding fonts.

Make sure that multiline is disabled.

Tags: Adobe Animate

Similar Questions

  • LabelButton blurred embedded fonts in the Simulator and the rendering of the fonts of the differences

    Hey people, party

    I have problems with the fonts embedded in LabelButton not made cleary by operating in the Simulator. They are crunchy when added stand alone. The button is on whole pixels and I double checked that the text in the button field is also on a set of pixels.

    Autonomous mode:

    Simulator:

    My code:

    public class GenericLabelButton extends LabelButton
        {
            protected var labelStr:String;
    
            public function GenericLabelButton(labelStr:String)
            {
                this.labelStr=labelStr;
    
                super();
            }
    
            override protected function init():void
            {
                var format:TextFormat=new TextFormat();
                format.font="font_helveticaNeue";
                format.size=16;
                format.color=0x000000;
                format.align=TextFormatAlign.CENTER;
    
                super.init();
    
                setTextFormatForState(format, SkinStates.DISABLED);
                setTextFormatForState(format, SkinStates.UP);
                setTextFormatForState(format, SkinStates.DOWN);
                setTextFormatForState(format, SkinStates.SELECTED);
                setTextFormatForState(format, SkinStates.DISABLED_SELECTED);
                label_txt.embedFonts=true;
                label=labelStr;
                label_txt.x=Math.round(label_txt.x);
                label_txt.y=Math.round(label_txt.y);
            }
        }
    

    Everyone knows this? Is font_helveticaNeue a bad font to use for the development of the PlayBook? Should I use the native font instead?

    I would also add that I use the police elsewhere in my application as a plain text field and it makes fine/crisp in the Simulator.

    I could use the native components wholesale, but I tell myself that I should at least try to use my own fonts.

    And while on the subject of the native LabelButton...

    Why text makes it differently in the Simulator this autonomous? The bg of the LabelButton doesn't resize correctly when I use the Simulator. Should I have the fonts installed on the host computer?

    Autonomous mode:

    In the Simulator:

    Would appreciate any input in this...

    Thank you

    SMJOHN

    Whoops - just realized I wrote this for you questions about LabelButton, and TextInput in which case you will need to use the textfield label_txt as you have already done (this is the default TextField fom flash.text).

    Embedded fonts will make in the TextInput QNX on the Simulator, as they do with TextInput fl.controls Flash; 100 times greater than the vector shapes.

    To make them look good, you need to change some properties of the TextInput textField.

    You can adjust the sharpness and thickness to your taste. The gridFitType property can also help alone. I have not tested it without the custom of the AA, however settings.

    _textInput.textField.antiAliasType = AntiAliasType.ADVANCED;
    _textInput.textField.sharpness = 1;
    _textInput.textField.thickness = 25;
    _textInput.textField.gridFitType = GridFitType.PIXEL;
    

    I have attached a before and after the screenshot of the Simulator. Unlike my screenshot, make sure the size of your type TextInput and/or its TextField correctly do not cut the Downhillers. Myriad Pro is displayed.

    TextField reference for anyone who comes across this thread and he needs: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html

  • AIR SDK v23 embedded fonts does not not on Android

    Bug #4182571 - TextField with no embedded fonts does not display international characters on Android

    This means emoji or any language using non-ASCII characters cannot be displayed. Is this a known issue?

    Hi Peter,.

    Yes, this problem occurs with unicode characters and it is known to us.

    We are currently looking into it.

    Thank you

    Adobe AIR Team

  • Embedding fonts is embeded swf

    Hey, I have a big problem with embedding the fonts.

    I have a swf file which embeded in an another SWF (for security code).

    In the first swf file, I have some for Tlf embeded fonts and it works fine but after Im points in another swf file:

    [Embed (source = "main.swf", mimeType = "application/octet-stream")]

    All the fonts that have been shipped are not shown and replaced by the default system font.

    How can I fix it and make fonts work?

    your tlf containing the swf must use the runtime library settings link shared "merged into code", not "runtime shared library.

  • Is there a way to 'batch' record as very? We have a customer who regularly sends files without all the embedded fonts. To clean the files for digital printing, save us as Postscript and pass them through Distller. "Save as Postscript is most of time consu

    Is there a way to 'batch' record as very? We have a customer who regularly sends files without all the embedded fonts. To clean the files for digital printing, save us as Postscript and pass them through Distller. "Save as Postscript is the longest part of the process, then I would be able to automate it.  Any ideas?

    This is the worst absolute way to embed fonts for PostScript through deletes dynamic transparency, color management, bookmarks, hyperlinks, etc. Yucck!  You are in many ways to ruin the files, do not clean them.

    Acrobat Preflight has a correction for embedding fonts. Takes only a few seconds per file PDF. And if you have a bunch of these files, you can create an action to do this.

    -Dov

  • The present no embedded fonts in scanned documents containing plain text are not get converted fonts incorporated after OCR applied. But the texts are searchable. The text even unincorporated font that is formatted as text (not scanned) become stupid

    The present no embedded fonts in scanned documents containing plain text are not get converted fonts incorporated after OCR applied. But the texts are searchable. Even fonts not embedded text that is formatted as text (not digital) are themselves converted to fonts embedded by adobe distiller.

    Fix. Expected behavior.

    Output of the OCR is not incorporated. With Acrobat Pro, a preflight check is available to embed the fonts.

    On the use of Distiller - using a work option distill configured appropriately that the PDF created from the authoring application (FrameMaker, InDesign, MS Word, etc.) will have embedded fonts.

    Be well...

  • The pdf I want to change has all embedded fonts.  When I try to insert a comma, I get the message, "all or part of the selection has no available system fonts.» Cannot add or remove text using the selected font. "Will I still have this problem

    The pdf I want to change has all embedded fonts.  When I try to insert a comma, I get the message, "all or part of the selection has no available system fonts.» Cannot add or remove text using the selected font. "Will I still have this problem if I'm updating from Acrobat X?

    You have the fonts installed in the system. This has not changed. (Having the police is not always enough, but it is certainly necessary).

  • When you try to download a PDF file to an interactive site, I get the announcement: "the attached PDF file is referring to a non-embedded font Tahoma. Please delete, incorporate the police and set again. "How to integrate it, or in fact any other font?

    When you try to download a PDF file to an interactive site, I get the announcement: "the attached PDF file is referring to a non-embedded font Tahoma. Please delete, incorporate the police and set again. »

    I couldn't get rid of the Tahoma police in the WORD file.

    How to integrate it, or in fact any other police?

    It should be an option to make the PDF.  Which version of Acrobat you are using, and exactly the method and parameters do you use to make the PDF?

  • How can I change the text in a pdf document using an embedded font?

    I'm trying to edit text in a pdf document where the text is in a (Nimbus San) embedded font, but when I try to add some text in the text box, it appears in Minion instead of the police of San Nimbus.  I don't understand why I can't change by using the embedded font.

    The fonts are licensed assets subject to single use. They are not intended to share, redesigned, etc..

    As part of the PDF standard that they included in a document so that the document can be considered reliably without the police be installed on the viewing station.

    To change you must have fonts installed on your computer. The possibility for the second parties to use the police violate the licensing of fonts.

  • Convert to PDF from word, the fonts are not included, the word doc record embedded fonts, but conversion does not incorporate fonts?  What should I do to get the embedded fonts?

    Convert to PDF from word, the fonts are not included, the word doc record embedded fonts, but conversion does not incorporate fonts?  What should I do to get the embedded fonts?

    I used times new roman in word 2013.  New file.  Apparently the version of adobe that I use will not incorporate.  I use the version line.  I was told that I have to upgrade to Adobe Pro.  I'm dealing with a patent application, so I can't share the document.  The patent office cannot accept that documents with embedded fonts.  My drawings that have been scanned and then converted are a problem too because I get an error based on the size of the page (23.6 "x 32.4") and I am unable to reduce this size in files from Adobe.com.

    Unfortunately I signed up for this product that get these two converted documents and uploaded only to discover that the conversions will not download.

  • underscore Embedded fonts html

    I have a html textfield using embedded fonts. I found that because I'm using a font embedded, I am not able to use the HTML < b > < i > and < u >. I found a solution with bold and italic by integrating the fat version and italic of each font and then use the tag make and define the face to the version in bold or italic to the police. The problem I face today is that there is no strictly stressed police. So, how to underline my text?

    You can use these tags.  just assign htmlText to your textfield when using html tags.

  • Remove an embeded font from a PDF file

    Hi guys

    I have a bunch of PDF files where I need to remove a font sertant for copyright reason.

    When I use PDF Optimization and cancellation of embedding the fonts, it replaces the police with one another across in the PDF, but when I open the optimized PDF file and check properties, he said that the police is

    Embeded.

    How can I completely remove the embeded font? and is it possible, where I can choose the substitute font?

    Another solution of course would be to transform all text to images, but the quality is simply misuse.

    I use Adobe Pro IX for Windows 8.1 (64-bit)

    Why do you think that it is always integrated?

    The latter appears in the file properties > because it is defined as the font to use when ripping the file, but unless Scripture says it is integrated, it is only a reference to name the list fonts.

  • Help with embedded fonts

    Hello-

    I use FlashEFF for some text effects in our online advertising banners.  I have five embedded fonts.  Now the problem is that the file size is huge because of the embedded fonts.

    Is it true that if a user doesn't have this font on their computer they will see a default font?

    I use the following fonts:

    Helvetica Neue: 65, 77 Bold Condensed, 95 Black medium

    and

    Futura LT:  "BOLD" and book

    Thank you for any advice on that.

    When you embed a font, you can only embed certain characters

    Select the textfield (dynamic or input) press the 'Embed' deselect all "ranges of characters" and type the characters to use in the section also "include these characters.

    If you use a static text, you don t need to incorporate fonts, everyone see your fonts with static text.

  • HTML "BOLD" text and regular on the Spark components with embeded fonts

    Hello!

    I took a quick glance to the textflow Flex 4 new (at least new to me).

    I use a spark textarea that is assigned to a style that uses a font embed, the problem is that when the textarea component renders the text marked in bold (using < span fontWeight = "bold" >) you lose the embeded font style.

    How to display bold text and text in the same text box using embeded fonts?

    Thanks in advance

    That's exactly what I was looking for:

    {@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;

    }

    so now I can put fonts on "myFont" style, and the Flash will be made to the police as a result.

    http://help.Adobe.com/en_US/Flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7f5f.html

    Nice!

  • Embeded fonts

    Hello

    I create my own font for my app recently and I use the [Embed] tag to embed fonts in. it works when I debug my application in Flash Builder, but when I publish it on my site, all the embeded fonts are missing, they do not display, my code is

     [Embed(source="res/Font.TTF", fontName="Font",unicodeRange="U+30-U+39",mimeType="application/x-font" ,embedAsCFF="false")]
     public const Font:Class;
    =================================
     text.defaultTextFormat=new TextFormat(new Font());
    

    And when I check 'hasGlyphs()', they all return true in FB debugger and web page, just...

    Someone help me please, thank you 1 million

    One last thing, as the resource of police I use, images and animations are in the same application domain, why is the font? Images in a new application domain can be viewed freely, why not the fonts?

    Because the images contain definitions of class - if they did, and if you tried to use them in different ApplicationDomain then the same issue would occur. In any case, although you have solved the problem

    --

    Kenneth Kawamoto

    http://www.materiaprima.co.UK/

  • Non - embedding fonts using AIR in Flash Professional 3.0 (for iOS Development)

    Hey there,

    We develop Plains AS3 projects (to compile) using Flash Professional and Flash Builder.

    Everything works well with the new 3.0 version of the AIR and performance is better than with AIR 2.6

    I followed this tutorial and similar use AIR instead of AIR 2.6 3.0:

    http://kb2.Adobe.com/CPS/908/cpsid_90810.html

    Unfortunately, today, we have seen a new show with embedding fonts. Using Flash Professional, himself or the Embed tag in the code itself works. We also see that the SWF size does not change when you add more than one font.

    Anyone has an idea where this problem may be caused? I think that how the fonts are embedded changed air 3.0 and it does not work with the 'replace AIR 2.6 with AIR X.Y thing'.

    Any help welcome.

    Best,

    Cedric

    Try the instructions at http://help.adobe.com/en_US/as3/iphone/WS789ea67d3e73a8b2-5b45bb17124b3295cc8-7ffd.html.

Maybe you are looking for