PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Dec 10, 2018 10:02 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Unicode support
PostPosted: Sun Sep 30, 2018 3:36 pm 
Offline

Joined: Sat Oct 18, 2008 4:15 pm
Posts: 41
Hi

I found some merged TTF here:
https://github.com/klokantech/klokantech-gl-fonts

Normal font ("KlokanTech Noto Sans") works fine for me, even Bold, but if I go for CJK("KlokanTech Noto Sans CJK"), nothing works, not chinese chars, nor Bold :(
any idea what could be wrong?

thx


Top
 Profile  
Reply with quote  
 Post subject: Re: Unicode support
PostPosted: Sun Sep 30, 2018 4:51 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 428
Location: CCAA
gastan wrote:
any idea what could be wrong?
Yes.
See also:
http://pdfsharp.net/wiki/Unicode-sample.ashx
http://forum.pdfsharp.net/viewtopic.php?f=2&t=832

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
 Post subject: Re: Unicode support
PostPosted: Sun Sep 30, 2018 7:31 pm 
Offline

Joined: Sat Oct 18, 2008 4:15 pm
Posts: 41
Yeah, sorry, I forgot to add that "Arial Unicode MS" font works quite ok, I just want to replace it with something with Bold face.
So I am just trying to figure out what could be the reason one font from the same guy is working ok and another not at all :(

PdfSharp is 1.2.1269
MigraDoc.Rendering is 1.2.2546
I beleive it's a relase DLLs.


Top
 Profile  
Reply with quote  
 Post subject: Re: Unicode support
PostPosted: Sun Sep 30, 2018 8:38 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 428
Location: CCAA
gastan wrote:
PdfSharp is 1.2.1269
Pretty old.
Arial has regular, bold, italic, and bold italic.

PDFsharp 1.50 can simulate bold for fonts that do not have bold glyphs.

Make sure you use the correct font name in MigraDoc (typically there is no "bold" or "italic" in the name coz there is a font attribute for bold and italics - use the family name).

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
 Post subject: Re: Unicode support
PostPosted: Fri Oct 05, 2018 1:58 pm 
Offline

Joined: Sat Oct 18, 2008 4:15 pm
Posts: 41
Yeah, I have success with other fonts and I believe I got the name right.
I updated to PDFSharp to latest 1.5 ver and no change there.
Question is, if


This text '末永萌絵子' looks ok in "Arial Unicode MS" and with ver 1.5 it even shows Bold, which is cool.
Could the format of 'KlokanTech Not Sans CJK' which is 'KOKANTECHNOTOSANSCJK-REGULAR.OTF' be the problem?


Top
 Profile  
Reply with quote  
 Post subject: Re: Unicode support
PostPosted: Fri Oct 05, 2018 2:22 pm 
Offline

Joined: Sat Oct 18, 2008 4:15 pm
Posts: 41
ok, now I figured adding 'Regular' to fonts name helps with "Noto Sans CJK JP Regular"
that is the Google font. Problem is, it only covers JP and what's worse, my PDFs for from 200-300kB to 13MB, which is HUGE and take forever to generate :(


Top
 Profile  
Reply with quote  
 Post subject: Re: Unicode support
PostPosted: Sat Oct 06, 2018 9:02 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 428
Location: CCAA
gastan wrote:
that is the Google font. Problem is, it only covers JP and what's worse, my PDFs for from 200-300kB to 13MB, which is HUGE and take forever to generate :(
When it comes to embedding font subsets, PDFsharp relies on index tables of the fonts. If those index tables are missing, PDFsharp will embed the complete font file.
So you can reduce the file size by using fonts that have these index tables filled.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
 Post subject: Re: Unicode support
PostPosted: Sat Oct 06, 2018 9:15 am 
Offline

Joined: Sat Oct 18, 2008 4:15 pm
Posts: 41
Thanks @TH

How do I check if index table is there?
Also, how do I check if Could 'KOKANTECHNOTOSANSCJK-REGULAR.OTF' is supported by PDFSharp?
(I mistakenly tagged thread as TTF font, but I see now it's OTF.)
Are all the fonts that work in OS (W10) supported by PDFSharp?
I read somewhere, there is limit of 64k glyphs in font, so that's that, but font it'self work in Windows (I paste Japanese chars and it displays them in Fonts app)

How does name of the font and filename relate? I just notice now spelling diference, filename is KOKAN*, and Font name starts with "Klokan"

Thx for you help
--G


Top
 Profile  
Reply with quote  
 Post subject: Re: Unicode support
PostPosted: Sat Oct 06, 2018 9:24 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 428
Location: CCAA
gastan wrote:
Are all the fonts that work in OS (W10) supported by PDFsharp?
Not my area of expertise.
AFAIK the WPF build of PDFsharp supports more fonts. Maybe worth a try if you do not use the WPF build yet.
See also:
viewtopic.php?p=11758#p11758

gastan wrote:
How does name of the font and filename relate?
I expect that in MigraDoc you have to use the font name that is showing in the Fonts applet of Windows or in applications like Word. The file name of the font file is not relevant in any way.
In most cases of fonts for Windows "Regular" is not part of the font name - but this may be the case for some non-Windows fonts converted to Windows.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
 Post subject: Re: Unicode support
PostPosted: Sat Oct 06, 2018 12:44 pm 
Offline

Joined: Sat Oct 18, 2008 4:15 pm
Posts: 41
I will check WPF. But I am doing my own graphs (that were not possible at the time with PDFSharp) so maybe I am using GDI?
(I know I get some multithreading exceptions once a week from GDI). If my charts work or it woudl be possible to move them to PDF facility, I could go for WPF.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group