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 - Cambria TextHeight
  FAQ FAQ  Forum Search   Register Register  Login Login

Cambria TextHeight

 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: Cambria TextHeight
    Posted: 03 Apr 12 at 5:53PM
This is pretty screwy, but apparently a known problem.  Although I don't know why it's happening to me as I'm using Cambria and not Cambria Math.

http://stackoverflow.com/questions/8624229/cambria-math-big-top-and-bottom-margin

If you use the font called "Cambria" (not Bold or Italic) and call GetTextHeight, you'll get a number which is a bit larger than you might have expected.

---

The way I worked around this was to use AddSubsettedFont and just pass in the AnsiCharset, as this is all our reporting engine (technically) supports right now.  But I just wanted to know if there was some sort of work around, as we do a lot of calculations based on GetTextHeight.


Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3530
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 03 Apr 12 at 9:33PM
Hi Farg!

I think GetTextHeight only make sense if you draw with different font heights on your new pdf.
If you add a truetype font to the pdf it can be used with any height.
I could imagine that on a page with headline, chaptertext and normal text there will be perhaps three different font heights.
So you have to extract the pagetext getting the real used fontheights?

Cheers and welcome here,
Ingo


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: 04 Apr 12 at 4:05AM
Can you check to see what QP.GetTextAscent ()- QP.TextDescent() = ?  This might be more accurate.

Windows reports font heights different  to PostScript and other graphics libraries.  Windows returns the cell height by default and PDF  uses Ascent - Desent.

Andrew.
Back to Top
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 Posted: 13 Apr 12 at 6:13PM
Yeah, that GetTextAscent - GetTextDescent appears to actually give me the height of the text. Unfortunately, it still draws the text at the fairly screwy location.

Probably because we draw based on the Top/Left coordinates instead of using the baseline of the text.  (note: the code I'm using was all recently converted to QuickPDF from drawing directly to the canvas so it made more sense to draw using the top/left than the default functions the QuickPDF uses)
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