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 Garlov · Jan 22, 2015 at 03:46 PM · textmeshfontsfontsize

How can I obtain an exportable font size?

Hey, I have an A4 page width a pixel size of 210*297. Which have a 1:1 translation to mm. Then I have a textmesh on that page, with some text. All fine. Now comes the problem, I want to export this and create a pdf from the extracted data, but the font size is bogus.

The text : "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" fills up exactly one line of 210 px/mm with the font size 32.9. In indesign if I do the same there I get a fontsize of 9.35pt.

I know I could do a easy calculation with these numbers 32.9/9.35 = 3.5187166, which then will be my ratio. My problem here is that this might not be the same for all fonts or it might not be accurate. my biggest problem is that I do not want a line-break in a different place in unity vs a pdf.

Is there a better and more accurate way to calculate this per font used?

Comment
Add comment · Show 2
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 team_eden · Jan 22, 2015 at 09:48 PM 0
Share

Just start the app in a regular size, and anchor the text accordingly to the screen. WHen you resize the pdf, unity canvas scaler will do the work. Just make sure your text is set to overflow, on both the horizontal and vertical scales. Hope this helps?

avatar image Garlov · Jan 23, 2015 at 08:40 AM 0
Share

That won't do, I need to be able to save the config for the Text$$anonymous$$esh to a file, xml for example. And then send it to a pdf generator. So if I export this:

 <page width="210" height="297">
   <textFrame fontSize="36" x="0" y="0" width="210" height="120">Lorem ipsum dolor sit amet, id tritani aliquando omittantur eum.</textFrame>
 </page>

If that fontSize is 36 in Unity, when it's really 10-ish pt in a real document, I'll have a problem. Then the text will display differently in Unity and the in generated pdf.

0 Replies

· Add your reply
  • Sort: 

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

2 People are following this question.

avatar image avatar image

Related Questions

TextMeshProUGUI Font Disappearing on Low FPS,Unity TextMeshProUGUI Font Disappearing 0 Answers

TextMesh characterSize vs fontSize 2 Answers

Unity 2.6.3f1 Font Size Limit 1 Answer

How do you optimize your fonts? 1 Answer

Font Size changes between PC and Mac 2 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