Discussion:
[reportlab-users] How can I use Bold or italic for CIDFont (ex.HeiseiMin-W3)
Hearn
2010-07-01 07:39:59 UTC
Permalink
I want to use HeiseiKakuGo-W5 font but I looks like bold and italic do not
work.

I reference to txt2pdf
http://www.sanface.com/txt2pdffaq.html#Bold

So, I try to set font "HeiseiKakuGo-W5-90ms-RKSJ-H bold".
Of course, it doesn't find this font.

I try to dig the pdf source.Then I found a dirty hack.

replace pdf font obj define(sorry,I dont know pdf spec)

Just open original pdf with simple text Editor

Step:
# add new font obj define
25 0 obj
<<
/Type /Font
/Subtype /Type0
/Name /F22
/BaseFont /HeiseiMin-W3-90ms-RKSJ-H,Bold
/Encoding /90ms-RKSJ-H
/DescendantFonts [ 26 0 R ]
endobj
26 0 obj
<<
/Type /Font
/Subtype /CIDFontType0
/BaseFont /HeiseiMin-W3,Bold
/FontDescriptor 27 0 R
/CIDSystemInfo
<<
/Registry (Adobe)
/Ordering (Japan1)
/Supplement 2
/DW 1000
/W [ 50 500 500 ]
endobj
27 0 obj
<<
/Type /FontDescriptor
/Ascent 723
/CapHeight 709
/Descent -241
/Flags 6
/FontBBox [ -123 -257 1001 910 ]
/FontName /HeiseiMin-W3,Bold
/ItalicAngle 0
/StemV 69
/XHeight 450
/Style
<<
/Panose <010502020400000000000000>
endobj

#replace font referance
- /F2 3 0 R >>
+ /F2 22 0 R >>

Sorry, I dont know how to explain it.
You may diff the attachments

Back to the topic.
How can I use Bold or italic for CIDFont (ex.HeiseiMin-W3) ?
Does any easy way?

Hope we could fix it.
Thank you.

Does it easy to hack this behavior in ReportLab ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20100701/3d709108/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: italic_cjk.pdf
Type: application/pdf
Size: 3933 bytes
Desc: not available
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20100701/3d709108/attachment.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: italic_cjk_hack.pdf
Type: application/pdf
Size: 2737 bytes
Desc: not available
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20100701/3d709108/attachment-0001.pdf>
Andy Robinson
2010-07-01 09:01:22 UTC
Permalink
I want to use?HeiseiKakuGo-W5 font but I looks like bold and italic do not
work.
...
I try to dig the pdf source.Then I found a dirty hack.
...
That's really neat! I did not even know that Bold and Italic versions
were possible; it was 2002-2003 when I implemented the support for
these fonts and I don't think you could do it then.

We'll try to add support for this into the next release. Things are
really busy now so if you don't see a checkin within 4 weeks, remind
me then...

- Andy
Hearn
2010-09-07 09:17:51 UTC
Permalink
Hello Robinson,

I think you are very busy.
This is short notification message to remind you this.
We may hack pdf objs to support Bold and Italic CID fonts.

Maybe, someone could try to hack with this method.

- Hearn


2010/7/1 Andy Robinson <andy at reportlab.com>
Post by Andy Robinson
Post by Hearn
I want to use HeiseiKakuGo-W5 font but I looks like bold and italic do
not
Post by Hearn
work.
...
Post by Hearn
I try to dig the pdf source.Then I found a dirty hack.
...
That's really neat! I did not even know that Bold and Italic versions
were possible; it was 2002-2003 when I implemented the support for
these fonts and I don't think you could do it then.
We'll try to add support for this into the next release. Things are
really busy now so if you don't see a checkin within 4 weeks, remind
me then...
- Andy
_______________________________________________
reportlab-users mailing list
reportlab-users at lists2.reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20100907/a274ddd7/attachment.html>
Andy Robinson
2010-09-07 11:23:09 UTC
Permalink
Hello?Robinson,
I think you are very busy.
This is short notification message to remind you this.
We may hack pdf objs to support??Bold and Italic CID fonts.
Thanks for the reminder. We're taking a look at this now.

- Andy

Loading...