About How to use "bold" for Japanese font.

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics or PDF-XChange Viewer SDK if appropriate.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

elasoni
User
Posts: 20
Joined: Tue Aug 23, 2011 9:25 am

About How to use "bold" for Japanese font.

Post by elasoni »

Hello.

I'd like to use "bold" for Japanese font.
I execute the following sample code . But I was not able to output a "bold".

Is there anything wrong in the code or font ?

Language :C# VS2010
OS: Windows 7 Pro Japanese Edition
-------------------------------------------------
public static void Title(int pdf, int page, double x, double y, string txt, double fsize)
{
int fntID = 0;
int res = 0;
res = PDFXC_Funcs.PXC_AddFontW(pdf, FW_BOLD , false, "MS Gothic" , out fntID);
if (IS_DS_FAILED(res))
return;

......

}
-------------------------------------------------
Thanks.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17960
Joined: Mon Jan 12, 2009 8:07 am
Location: London

Re: About How to use "bold" for Japanese font.

Post by Tracker Supp-Stefan »

Hello elasoni,

Please make sure that your "pdf" is a pointer to a _PXCDocument.
Also are you getting any error codes as a result from the execution of PXC_AddFontW? Or does it return a non negative integer? (which would mean that the function succeeded)

Best,
Stefan
elasoni
User
Posts: 20
Joined: Tue Aug 23, 2011 9:25 am

Re: About How to use "bold" for Japanese font.

Post by elasoni »

Thank you for your prompt reply.

I checked "pdf" and the result code of PXC_AddFontW.
"pdf" ... pointer to a _PXCDocument :95748132
PXC_AddFontW ... It returns 0.

It seems to be fine.

But strings in the pdf was not changed to "bold" font.
It looks like "normal" font strings even though I set the FW_BOLD.

Is this a problem of font ?

Thank you.
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3556
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada

Re: About How to use "bold" for Japanese font.

Post by Ivan - Tracker Software »

I'm afraid problem is because there are no bold variants of this font, only regular.
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
elasoni
User
Posts: 20
Joined: Tue Aug 23, 2011 9:25 am

Re: About How to use "bold" for Japanese font.

Post by elasoni »

Is there anything alternative method to get the result of something like "bold" ?
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom

Re: About How to use "bold" for Japanese font.

Post by John - Tracker Supp »

Hi,

checked with our resident expert on fonts and he advises ...

To make a real Bold font from normal - the answer is no.

But there are at least two ways to
simulate
Bold:

1. Use Fill Stroketext rendering mode. Good for fonts like courier - with a constant line width.

2. Output the text several Times (usually 4) with very small offsets in both directions.

HTH.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
elasoni
User
Posts: 20
Joined: Tue Aug 23, 2011 9:25 am

Re: About How to use "bold" for Japanese font.

Post by elasoni »

Thank you for your help.
Your advice was really useful.

I tried the first one - To Use Fill Stroketext rendering mode.
The way you told me was really good and it satisfied me very much.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17960
Joined: Mon Jan 12, 2009 8:07 am
Location: London

Re: About How to use "bold" for Japanese font.

Post by Tracker Supp-Stefan »

Great to hear that elasoni!

Cheers,
Stefan