Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 rjr · Dec 23, 2015 at 04:28 PM · language

unity local language integration problem

alt text

Hello all I am having problem at displaying the characters of a language (Kannada Language in particular) the characters are printed properly on other applications like whatsapp, kik etc.. but in the unity the characters are displayed in improper way

Example as shown in the figure when those two characters are added it should printed as shown in the First Sequence but when it comes to unity its printed as shown in second which is improper

Whats the reason for this? and how can i overcome this problem. i Have tried with using different fonts, still the result is same. i am using unity UI system Text field and Unity 5.2.3 version

image.jpg (25.1 kB)
Comment
Add comment · Show 1
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 csgpm · Nov 29, 2019 at 07:44 AM 0
Share

Hi RJR, We are also facing the issue with kannada font. we have used thunga & Nirmala fonts. when the code is converted from cshmtl to pdf, the kannada fonts are not displaying correctly.

using ($$anonymous$$emoryStream stream = new System.IO.$$anonymous$$emoryStream()) { TextReader sr = new StringReader(""); Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 100f, 0f); PdfWriter writer = PdfWriter.GetInstance(pdfDoc, stream); Font font = null;

             font = FontFactory.GetFont(Server.$$anonymous$$apPath("/TTF/Nirmala.ttf"), BaseFont.IDENTITY_H, 10f, Font.NOR$$anonymous$$AL);

             pdfDoc.Open();
             Paragraph p = new Paragraph(new Chunk(GridHtml, font));
             pdfDoc.Add(p);
             X$$anonymous$$LWorkerHelper.GetInstance().ParseXHtml(writer, pdfDoc, sr);
            
             pdfDoc.Close();
             return File(stream.ToArray(), "application/pdf", "Gridtest.pdf");
         }

         
     }

2 Replies

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

Answer by rjr · Dec 29, 2015 at 12:35 PM

Well i found a solution to overcome this problem, if anyone facing the same issues... post here, i shall explain in detail

Comment
Add comment · Show 1 · 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 AntzyP · Mar 08, 2016 at 12:02 PM 0
Share

Please post the solution to this problem...

avatar image
0

Answer by csgpm · Nov 30, 2019 at 07:44 AM

HI, I am facing same problem with kannada fonts, can you share your solution. so that i can use that in my code. @rjr @rjr

public void pdfExport(string GridHtml) { StringReader sr = new StringReader(GridHtml.ToString());

         Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 0f);

         HTMLWorker htmlparser = new HTMLWorker(pdfDoc);

using (MemoryStream memoryStream = new MemoryStream()) { Font font = null;

             font = FontFactory.GetFont(Server.MapPath("/TTF/Tunga_Regular.ttf"), BaseFont.IDENTITY_H, BaseFont.EMBEDDED, 12f, Font.NORMAL, BaseColor.BLACK);

            

             PdfWriter writer = PdfWriter.GetInstance(pdfDoc, memoryStream);
             pdfDoc.Open();

             Paragraph p = new Paragraph(new Chunk(GridHtml, font));
             pdfDoc.Add(p);

             htmlparser.Parse(sr);
             pdfDoc.Close();

             byte[] bytes = memoryStream.ToArray();
             memoryStream.Close();

             Response.Clear();
             Response.ContentType = "application/pdf";
             Response.AddHeader("Content-Disposition", "attachment; filename=Invoice.pdf");

             Response.Charset = "UTF-8";
             //Response.ContentEncoding=PdfEncodings.
             Response.Buffer = true;
             Response.Cache.SetCacheability(HttpCacheability.NoCache);
             Response.BinaryWrite(bytes);

             Response.End();
             Response.Close();
         }

}

Comment
Add comment · 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

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

How is the relationship between Rodrigo Barreto de Oliveira and Unity? 1 Answer

Function to translate text in unity 0 Answers

How to localization app name on android platform 1 Answer

Can you ever add a Python as new scripting language, if many people will want it? 0 Answers

C# scripting and Javascript in the same project? 3 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