Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Printing Fractions and other unicode things
  FAQ FAQ  Forum Search   Register Register  Login Login

Printing Fractions and other unicode things

 Post Reply Post Reply
Author
Message
fargburger View Drop Down
Beginner
Beginner


Joined: 03 Apr 12
Location: Wisconsin
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote fargburger Quote  Post ReplyReply Direct Link To This Post Topic: Printing Fractions and other unicode things
    Posted: 02 Oct 12 at 5:22PM
How do I print these unicode superscript characters?

> http://www.alanwood.net/unicode/superscripts_and_subscripts.html

I can print superscript 1,2 and 3 because they're found in a lower range of codepoints, but I can't print the slash or the rest of the numbers for numerators or denominators.  In debugging, Delphi shows me 5/9ths up until I send the string off to QuickPDF. When it comes through in quick PDF I get nothing, it's not even considered in calculating the width of the text box.

I tried using embed and non-embeded true type fonts, other than that I don't do anything fancy to fonts in quickPDF.

(using QuickPDF 8.16)
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 05 Oct 12 at 6:29AM
Not all fonts contain the extra fractions such as 1/6, 5/6.

If you only specify characters that exist then everything works as expected in 8.16 and 9.11.  To get the sample to work below in 8.16, 9.11 then just change the font to Arial Unicode MS.

I have used the following code for testing

Note :The string ends with  "1/4  1/2  3/4   1/3  2/3  1/8  3/8  5/8  7/8  1/5  2/5  3/5  4/5  1/6  5/6"

            QP.SetOrigin(1);
            string str = "12345: HELLO WORLD - ¼½¾ ⅓⅔⅛⅜⅝⅞  ⅕⅖⅗⅘⅙⅚";

            int id = QP.AddTrueTypeSubsettedFont("Arial", str, 0);

            QP.SelectFont(id);
            QP.SetTextSize(18);
            QP.DrawText(20, 30, str);

            QP.SaveToFile("out.pdf");

1. Using Arial I get the correct output up until 7/8.  The other characters don't exist in the font.

2. If I change the font to "Arial Unicode MS" then it generates the full string correctly.

Andrew.



Edited by AndrewC - 05 Oct 12 at 8:20AM
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store