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!
![]() |
Cambria TextHeight |
Post Reply ![]() |
Author | |
fargburger ![]() Beginner ![]() Joined: 03 Apr 12 Location: Wisconsin Status: Offline Points: 13 |
![]() ![]() ![]() ![]() ![]() 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. |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3530 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
AndrewC ![]() Moderator Group ![]() ![]() Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
fargburger ![]() Beginner ![]() Joined: 03 Apr 12 Location: Wisconsin Status: Offline Points: 13 |
![]() ![]() ![]() ![]() ![]() |
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) |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store