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!
![]() |
Bold text |
Post Reply ![]() |
Author | |
skwirelboy ![]() Team Player ![]() Joined: 27 Feb 06 Status: Offline Points: 45 |
![]() ![]() ![]() ![]() ![]() Posted: 18 Aug 08 at 8:31AM |
Hi,
I can't quite figure out how to switch between bold and non-bold text.
I am adding fonts to my dcument as follows:
QP.AddStandardFont(4);
QP.AddStandardFont(5); This gives me helvetica and helvetica bold.
I am then calling
Qp.SelectFont(QP.FontID(4));
for non bold and
Qp.SelectFont(QP.FontID(5));
to switch to bold. But whichver one I opt for first sticks for the remainder of the document and the switch makes no difference.
First, am I approaching this in the correct way and if so what more do I need to do.
Thanks
Mark
|
|
![]() |
|
jwhitham ![]() Beginner ![]() Joined: 10 Jan 06 Location: United Kingdom Status: Offline Points: 11 |
![]() ![]() ![]() ![]() ![]() |
You need to use the result of the AddStandardFont function to select the font. In Pascal it would be:
var afont: integer;
afont := qp.AddStandardFont(5);
qp.SelectFont(afont);
|
|
![]() |
|
skwirelboy ![]() Team Player ![]() Joined: 27 Feb 06 Status: Offline Points: 45 |
![]() ![]() ![]() ![]() ![]() |
Thanks for the reply. I add all the fonts at the outset (ie Helvetica and HelveticaBold. I then select them using the function in my original reply. I assumje I don't want to go adding the same font over and over again when I switch between bold and non-bold. If this assumption is correct, why does the function that I am using for selecting the fonts not seem to work.
Thanks |
|
![]() |
|
jwhitham ![]() Beginner ![]() Joined: 10 Jan 06 Location: United Kingdom Status: Offline Points: 11 |
![]() ![]() ![]() ![]() ![]() |
the FontID() function takes the index of the font in your document as its argument so, in your case, you would use: Qp.SelectFont(QP.FontID(1));
for non bold and
Qp.SelectFont(QP.FontID(2));
|
|
![]() |
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