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 Font |
Post Reply ![]() |
Author | |
skwirelboy ![]() Team Player ![]() Joined: 27 Feb 06 Status: Offline Points: 45 |
![]() ![]() ![]() ![]() ![]() Posted: 31 Jan 09 at 5:27AM |
Hi,
Does anyone have a code sample to show how to set the font to bold, italic etc.
I need to get this working with the standard pdf fonts and also with added truetype fonts.
Have tried SetFontFlags, but can't get it to work. Posted a snippet of code I was using a few weeks ago, but nobody was able to correct it.
I can't believe that no-one out there has managed to set font to bold, italic etc for truetype fonts.
Thanks for any help.
Regards
Mark
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi Mark! I think you won't find an answer... I've used the search-function (here above) with "bold" ... and i've found your old postings in this case ;-) Perhaps it's better to post your post and then the other ones here can say what's perhaps wrong with it. Cheers, Ingo
|
|
![]() |
|
skwirelboy ![]() Team Player ![]() Joined: 27 Feb 06 Status: Offline Points: 45 |
![]() ![]() ![]() ![]() ![]() |
Hi Ingo,
I haven't been able to find an answer on the forum. But does this mean it can't be done or that no-one else has this problem.
Basically, if you add a truetype font how do you output the text for that font in bold or italics?
Does anyone know?
Thanks
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Perhaps it's better to post your code and then the other ones here can say what's perhaps wrong with it. Edited by Ingo - 02 Feb 09 at 7:23AM |
|
![]() |
|
skwirelboy ![]() Team Player ![]() Joined: 27 Feb 06 Status: Offline Points: 45 |
![]() ![]() ![]() ![]() ![]() |
Hi Ingo,
I have tried using setfontflags as recommended by another user in an earlier post. The code is:
id:=qp.AddTrueTypeFont(FontName, 1);
qp.SelectFont(id); qp.SetFontFlags(0, 0, 0, 0, 1, 0, 0, 1); //ie bold italic
This makes no perceptible difference to the font whne drawn.
Thanks
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi Mark!
This is from the help-file.
Try a font family with bold or whatever you want.
Cheers, Ingo
Function AddTrueTypeFont(FontName As String,
Embed As Long) As Long Parameters FontName The name of the TrueType font to install. This can either be the name of the font as shown in the Windows\Fonts folder (for example "Times New Roman Bold") or it can be the font family name with an optional style specifier in square brackets (for example "Times New Roman [BoldItalic]"). Possible optional specifiers are: [Bold], [Italic] or [BoldItalic]. A codepage can also be specified (for example "Arial [Bold] {1250}") which allows other encodings to be used. The only codepages supported at the moment are 437, 850, 852, 1250, 1251 and 1255. Embed Specifies whether to embed the font or not: 0 = Don't embed the font. 1 = Embed the font. Returns 0 The font could not be added. This may mean that the font is not licensed to be embedded, or that the font could not be found. Non-zero The ID of the font that was successfully added. |
|
![]() |
|
skwirelboy ![]() Team Player ![]() Joined: 27 Feb 06 Status: Offline Points: 45 |
![]() ![]() ![]() ![]() ![]() |
Hi Ingo, Works perfectly. Obviously helps to read the help file properly. I will post a reply to the earlier thread just to point out that SetFontFlags is not the way to go.
Many thanks for your help.
Regards
MArk |
|
![]() |
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