Print Page | Close Window

Bold text

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=929
Printed Date: 17 May 24 at 5:45AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Bold text
Posted By: skwirelboy
Subject: Bold text
Date 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
 



Replies:
Posted By: jwhitham
Date Posted: 25 Aug 08 at 2:29PM
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);
 
 


Posted By: skwirelboy
Date Posted: 26 Aug 08 at 6:50AM

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



Posted By: jwhitham
Date Posted: 26 Aug 08 at 7:24AM

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));
 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk