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 6592993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:37:32+00:00 2026-05-25T17:37:32+00:00

I want to draw text to a bitmapData and allow it to be rotated

  • 0

I want to draw text to a bitmapData and allow it to be rotated but rotating the text makes it disappear 🙁

The code I am using resembles something like this :

var tf : TextField = new TextField();
tf.text = "testing";

var mat : Matrix = new Matrix();
mat.identity();
mat.rotate(angle);
var img : BitmapData = new BitmapData(500, 500, true, 0);

img.draw(tf, mat, null, null, null, true);

If I comment out mat.rotate(angle); the text appears fine. It’s not the angle value because I can do this :

var tf : TextField = new TextField();
tf.text = "testing";

var mat : Matrix = new Matrix();
mat.identity();
mat.rotate(angle);
var img    : BitmapData = new BitmapData(500, 500, true, 0);
var txtImg : BitmapData = new BitmapData(500, 500, true, 0);

txtImg.draw(tf,      null, null, null, null, true);
img.   draw(txtImg , mat,  null, null, null, true);

and the text will appear rotated (which is a workaround to this problem but I need to create 2 BitmapData images and call draw twice which costs CPU and memory). I would much rather not have to do all this extra processing to get an effect that should, in theory, work with a single call to the draw method. What am I doing wrong?

Thanks

  • 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-25T17:37:32+00:00Added an answer on May 25, 2026 at 5:37 pm

    You should try

    tf.embedFonts = true;
    

    If you don’t use embedded fonts, Flash won’t be able to do anything graphicaly advanced with your TextField.


    From @yesterday’s comment (for a better formatting):

    For others that might have the same problem, I used the Embed tag to embed my font. Something along the line of :

    [Embed(source='../libs/font.ttf', fontFamily='MyFont', embedAsCFF='false')] 
    private const MyFont : Class; 
    

    and I call

    Font.registerFont(MyFont); 
    

    somewhere in the code before using the font.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to draw text into UIView 's subview using drawInRect:withFont:lineBreakMode call but that
Using Python I want to be able to draw text at different angles using
alt text http://www.imagechicken.com/uploads/tn1270646423002339600.png I want to draw like that. How do I draw like
I want to draw some text in a view, rotated 90°. I'm pretty new
I want to add new font and draw text on the screen. But When
I can draw text using the below code, myCanvas.fillStyle = Red; myCanvas.font = 30pt
I want to draw text view with 2 color like the text in this
I'm attempting to draw text to the screen using GLUT in 2d. I want
I want to draw text just like the following style -- the image is
I write a opengl code on ubuntu. I want to draw a text on

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.