PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Superscript with 2 letters is not working
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2984
Page 1 of 1

Author:  Laxmikanth [ Wed Nov 19, 2014 1:23 am ]
Post subject:  Superscript with 2 letters is not working

Hi All,

I have an requirement where I need to show time 9:30 am as 9^30 a. I am able to generate the string as required from c#. But when I pass this value to AddParagraph() method the output is something like
"9^3<junkvalue like square, mue> a". Looks like 1st is displayed correctly but second letter is not.

endTime.AddParagraph("9^30a");

Can any one please help me in resolving this issue.

Thanks
lax

Author:  Thomas Hoevel [ Wed Nov 19, 2014 9:07 am ]
Post subject:  Re: Superscript with 2 letters is not working

Hi!

Often the problem is not in the code snippet shown on the forum, but somewhere else.
See also:
viewtopic.php?p=2094#p2094

What is "endTime"?

The line
Code:
section.AddParagraph("9^30a");
works as expected - I get "9^30a" in my PDF.

Author:  Laxmikanth [ Wed Nov 19, 2014 6:54 pm ]
Post subject:  Re: Superscript with 2 letters is not working

Hi Sir,

Thanks for the reply. I have analysed further and found that it's not about second letter. I have changed the font style to Verdana. It's working fine for all the numbers except '0'.

I am using the unicode: \u2070.

Is there any font which works for all the numbers?

And about "endTime" it's just a cell to hold text.
My version is : GDI.1.32.3879.0

Please let me know if I am doing anything wrong.

Thanks
lax

Author:  () => true [ Thu Nov 20, 2014 8:30 pm ]
Post subject:  Re: Superscript with 2 letters is not working

Hi!
You can use AddFormattedText to use superscript and subscript with all fonts and all characters. No need to mess around with Unicode characters 0x2070 &c.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/