Print Page | Close Window

Bold truetype font

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=996
Printed Date: 17 Jul 25 at 3:30PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Bold truetype font
Posted By: skwirelboy
Subject: Bold truetype font
Date Posted: 16 Dec 08 at 7:05AM
I can see how to make aerial, courier and times bold. You just add different fonts. How do you make text bold for other truetype fonts added via AddTrueTypeFont function?
 
Thanks



Replies:
Posted By: DELBEKE
Date Posted: 17 Dec 08 at 12:53PM
Try to used SetFontFlags(0,0,0,0,0,0,0,1) after loading the font


Posted By: skwirelboy
Date Posted: 20 Dec 08 at 4:27AM
Hi Delbeke,
 
I have tried this, but I get no difference with the font whatsover when I call SetFontFlags.
 
Below is the code:
 
index:=QP.AddTrueTypeFont('Tw Cen MT', 1);
    if index=0 then
      begin
        Showmessage('couldnt add font');
        exit;
      end;
    Qp.SelectFont(index);
    index:=QP.SetFontFlags(0, 0, 0, 0, 0, 0, 0, 1);
    if index<>1 then
      begin
        Showmessage('couldnt set Flags');
        exit;
      end;
    QP.DrawText(10, 10, 'hello');
 
I get no messages back.
 
Any ideas?
 
BTW should setFontFlags work in the same way for the standard fonts or do I need to continue to add their various forms for bold and italic?
 
Thanks
 
Mark


Posted By: skwirelboy
Date Posted: 04 Feb 09 at 7:54AM

Have discovered thanks to Ingo that SetFontFlags is not the way to do this. For truetype fonts you simply add eg [Bold] or [BoldItalic] at the end of the font name when calling AddTrueTypeFont. Works like a treat and was covered perfectly well in the help for AddTrueTypeFont if only I had read it.

 
Regards
 
Mark



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