Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6710305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:00:23+00:00 2026-05-26T08:00:23+00:00

I am having trouble embedding a font as bold using FB4. I am using

  • 0

I am having trouble embedding a font as bold using FB4. I am using TextLayout fields and TextLayoutFormat to do this and my code is as follows:

package
{
import flash.display.Sprite;
import flash.text.AntiAliasType;
import flash.text.Font;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
import flash.text.engine.FontLookup;

import flashx.textLayout.container.ContainerController;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.formats.TextLayoutFormat;

public class FontEmbedding extends Sprite
{
    [Embed(source='TAHOMA.ttf', fontName='Tahoma', embedAsCFF="true")]
    private var _fontTahoma:Class;
    private const TAHOMA:String = "Tahoma";

    [Embed(source='TAHOMA.ttf', fontWeight = FontWeight.BOLD, fontName='Tahoma Bold', embedAsCFF="true")]
    private var _fontTahomBold:Class;
    private const TAHOMA_BOLD:String = "Tahoma Bold";

    public function FontEmbedding()
    {           
        this.textLayout();
    }

    private function textLayout():void
    {
        var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
        textLayoutFormat.fontLookup = FontLookup.EMBEDDED_CFF;
        textLayoutFormat.fontFamily = TAHOMA_BOLD;
        textLayoutFormat.fontSize = 32;

        var textFlow:TextFlow = new TextFlow();
        var paragraphElement:ParagraphElement = new ParagraphElement();
        textFlow.addChild(paragraphElement);

        var span:SpanElement = new SpanElement();
        span.text = "This is an example";
        paragraphElement.addChild(span);

        textFlow.format = textLayoutFormat;

        var containerController:ContainerController = new     ContainerController(this, 400, 100);
        textFlow.flowComposer.addController(containerController);
        textFlow.flowComposer.updateAllControllers();
    }
}
}

The font just displays as normal and the 'fontWeight' property is ignored. Any ideas would be gratefully received?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:00:23+00:00Added an answer on May 26, 2026 at 8:00 am

    This code worked for me, with the line textLayoutFormat.fontWeight = FontWeight.BOLD; or not.

    package
    {
        import flash.display.Sprite;
        import flash.text.AntiAliasType;
        import flash.text.Font;
        import flash.text.TextField;
        import flash.text.TextFieldAutoSize;
        import flash.text.TextFormat;
        import flash.text.engine.FontLookup;
        import flash.text.engine.FontWeight;
    
        import flashx.textLayout.container.ContainerController;
        import flashx.textLayout.elements.ParagraphElement;
        import flashx.textLayout.elements.SpanElement;
        import flashx.textLayout.elements.TextFlow;
        import flashx.textLayout.formats.TextLayoutFormat;
    
        public class FontEmbedding extends Sprite
        {
            [Embed(source='ChaparralPro-Bold.otf', fontWeight = FontWeight.BOLD, fontName='ChaparralPro-Bold', embedAsCFF="true")]
            private var _fontGillSans:Class;
            private const FONT_CHAP:String = "ChaparralPro-Bold";
    
            public function FontEmbedding()
            {           
                this.textLayout();
            }
    
            private function textLayout():void
            {
                var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
                textLayoutFormat.fontLookup = FontLookup.EMBEDDED_CFF;
                textLayoutFormat.fontFamily = FONT_CHAP;
                textLayoutFormat.fontSize = 32;
                textLayoutFormat.fontWeight = FontWeight.BOLD;
    
                var textFlow:TextFlow = new TextFlow();
                var paragraphElement:ParagraphElement = new ParagraphElement();
                textFlow.addChild(paragraphElement);
    
                var span:SpanElement = new SpanElement();
                span.text = "This is an example";
                paragraphElement.addChild(span);
    
                textFlow.format = textLayoutFormat;
    
                var containerController:ContainerController = new     ContainerController(this, 400, 100);
                textFlow.flowComposer.addController(containerController);
                textFlow.flowComposer.updateAllControllers();
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

having trouble with this. i need to come up with a logic code. How
Having trouble linking the Stomp.framework into an iPhone SDK application. http://code.google.com/p/stompframework/ I follow the
Having trouble with the following segment of code. I'm getting a parameter count mismatch.
Im having trouble using a .NET COM in vb6, It compiles ok and I
I having trouble in dividing the HTML frames. I have been using the following
I`m having trouble trying to optimize this query with OVER (PARTITION BY ...) because
I'm embedding IronPython in my C# application. For some reason I'm having trouble loading
Having trouble getting this syntax right: SELECT DISTINCT id FROM metadata WHERE (meta_key =
Having trouble with this -- a couple of other related posts out there, but
Having trouble using Powershell to manipulate IP Restrictions on IIsWebVirtualDir (Virtual Directories). However, i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.