Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by x4000 · Sep 23, 2010 at 07:21 PM · fontatlastexture-atlaspacktextures

Is it possible to get the atlas for a font texture?

Using the PackTextures method returns an array of indexes of all the different textures in a given texture atlas, apparently. That's hugely useful, and I assume that with the font textures Unity is doing something similar so that it can effectively render text in a given font when given a string as input.

My question is: can I get access to that array (and also the characters that map to each array index)? It seems pretty definite that Unity has that information internally, and normally I wouldn't need it, but I want to be able to get at the font texture and then use GetPixels to extract a single character at a time out, and then composite those into another texture.

My goal is just to composite some drawn fonts onto custom textures of my choosing. RenderTextures can't have a transparent background, to my knowledge, and they seem awkward and troublesome in general. But I am using Unity Pro, so I have access to that if absolutely necessary.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by jonas-echterhoff · Sep 24, 2010 at 02:29 PM

Unfortunately, there is currently no way to access that information from a font at runtime. With some work, you could extract that information in the editor using the SerializedProperty class, and then store it somewhere for processing at runtime, though that will not work for Unity 3.0 dynamic fonts, as the character placement information is not static.

Though, probably, using RenderTextures would be a simpler solution for your problem. What do you mean by "RenderTextures can't have a transparent background", and what makes them awkward?

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image x4000 · Sep 24, 2010 at 03:17 PM 0
Share

That's what I feared -- thanks for the info, at any rate.

Regarding RenderTextures, from reading around here, and my own experiments, it seems that I can't have a transparent background color onto which I composite something (like text) to then save it. The suggestions were to use hot pink or something that could then be cropped out, but when it comes to doing nicely antialiased font borders, that of course would keep remnants of the pink.

$$anonymous$$ore comments in a sec.

avatar image x4000 · Sep 24, 2010 at 03:20 PM 0
Share

Admittedly, though, I didn't get too far with the render textures because actually I was finding that they always rendered a blank texture when I was trying to use a temporary rendertexture and setting it to rendertexture.active. Or, at least, ReadPixels was just giving me blankness. I wasn't able to find any good tutorials on the subject, and a day or so of experimentation led to nothing, so I went with a different route.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Packing unity textures into atlases 0 Answers

Texture atlas and Texture2D.PackTextures 1 Answer

Is texture atlasing useless when you are constantly changing materials? 2 Answers

i'm trying to make the packed atlas and use the reacts to get the width and height then apply it to the material how do you do it 1 Answer

How to force a model to use texture atlas uvs via editor scripts 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges