RE: Japanese fonts do not appear in desired weights
This means you can only select MS Mincho and MS PMincho I can already use both MS Mincho (monospace) and MS PMincho (the P stands for Proportional) just fine. The problem is that I cannot make these fonts appear in different weights. (Or perhaps I've completely missed the point of your email?) Does anyone know what the status of JPFOP (http://jpfop.sourceforge.net) is? The home page offers a tantalizing glimpse of what appears to be MS Mincho and MS Gothic and multiple weights and styles. The home page also offers instructions that are probably perfectly readable in Japanese, or to a more experienced FOP user, but I have not been able to get anywhere with this. I currently have FOP 0.20.4 installed. I've copied the latest JPFOP .jar (for 0.20.2, provided on the JPFOP site) to the same build directory as the 0.20.4 FOP .jar, and tried running this: C:\devtools\Docs\fopjava -Xmx200m -cp build\fop-0.20.2-jp.jar;lib\batik.jar;lib \xalan-2.3.1.jar;lib\xercesImpl-2.0.1.jar;lib\xml-apis.jar;lib\avalon-framew ork- cvs-20020315.jar;lib\logkit-1.0.jar;lib\jimi-1.0.jar org.apache.fop.apps.Fop -c conf/userconfig.xml C:\projects_docs\source\MakePDF.fo C:\projects_docs\Techn icalAuthorGuideJ.pdf This results in: Exception in thread main java.lang.NoClassDefFoundError: org/apache/log/format /Formatter at org.apache.fop.apps.Fop.main(Fop.java:16) With apologies: I'm no Java developer... anyone who knows anything about Java will likely be dismayed at this hamfisted attempt. I'm thinking that perhaps this JPFOP .jar is not compatible with the other .jar files. Finally, the JPFOP 0.17.0 .zip includes some font metrics XML files with names like MSGothicBold.xml, that would seem to offer the promise (like the bitmap of the PDF on the home page) of multiple weights from the msgothic.ttc. I've tried referring to these XML files in userconfig.xml with FOP 0.20.4, but it causes FOP to crash with an unspecified error. I wish I understood better how JPFOP created these weight-specific XML files (and why they don't work with FOP 0.20.4). I'd really like to get JPFOP working, not just for the multiple weight fonts, but also because it appears to fix the FOP line break issue in Japanese (where lines can sometimes begin with a punctuation mark). Any advice would be greatly appreciated. Regards, Graham Hannington - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Japanese fonts do not appear in desired weights
FOP does not have an engine to create fonts with different weight a single typeface definition. Gotcha, thanks. I think this is what JPFOP, er, kludges (no disrespect intended to the developer). From the JPFOP site: renderInlineArea() method was modified. ... For Bold, the characters are rendered 4 times with offset. If I read this correctly, and JPFOP is doing what I think it's doing to emulate a true bold weight, then: ingenious, but... yeurch! ;-) A more elegant (if you like, proper) solution, as you say, would be to get a font that actually contains the different weights. I'm looking at: http://www.ricoh.co.jp/swd/font/valu-d2/wabun/index.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Japanese fonts do not appear in desired weights
I'm using FOP to produce English and Japanese PDFs. For English, I use Helvetica and the system monospace (Courier) fonts. For Japanese, I use MS PMincho and MS Gothic. In the English PDFs, the fonts appear at their desired weights (such as bold or normal). In the Japanese PDFs, the fonts appear at a single weight. PMincho appears throughout in normal weight, Gothic appears throughout in bold weight. Weird. MS PMincho and MS Gothic are defined in TrueType collection (.ttc) files, msmincho.ttc and msgothic.ttc. Here's a log of messages from TTFReaderor (for PMincho): C:\devtools\Docs\fopjava -cp build\fop.jar;lib\avalon-framework.jar;lib\xml-api s.jar;lib\xercesImpl.jar;lib\xalan.jar org.apache.fop.fonts.apps.TTFReader -ttcn ame MS PMincho c:\windows\fonts\msmincho.ttc mspmincho.xml TTF Reader v1.1.1 Reading c:\windows\fonts\msmincho.ttc... This is a TrueType collection file with2 fonts Containing the following fonts: MS Mincho * MS PMincho Number of glyphs in font: 17807 Postscript format 3 Creating xml font file... Creating CID encoded metrics Writing xml font file mspmincho.xml... This font contains no embedding license restrictions And here's an extract from my userconfig.xml: font metrics-file=style\fonts\mspmincho.xml embed-file=style\fonts\msmincho.ttc kerning=yes font-triplet name=PMincho style=normal weight=normal/ font-triplet name=PMincho style=normal weight=bold/ font-triplet name=PMincho style=italic weight=normal/ font-triplet name=PMincho style=italic weight=bold/ /font font metrics-file=style\fonts\msgothic.xml embed-file=style\fonts\msgothic.ttc kerning=yes font-triplet name=Gothic style=normal weight=normal/ font-triplet name=Gothic style=normal weight=bold/ font-triplet name=Gothic style=italic weight=normal/ font-triplet name=Gothic style=italic weight=bold/ /font Yes, the .ttc files *do* exist at that style\fonts\ location, relative to the .fo input file, when FOP runs... the resulting PDF displays PMincho and Gothic fine, just not in the right weights. Any ideas? Regards, Graham Hannington - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Japanese fonts do not appear in desired weights
Andreas, Chris, Thanks very much for your responses. Andreas, When embedding fonts, a separate metrics file should be generated for bold, italic and bold-italic (that is, if you want them to work properly). Right now, your userconfig maps all combinations (normal, bold, italic, bold-italic) to one and the same metrics file. Yep, I can see how that would be a problem... in my defence ;-), I was just copying lines in the supplied userconfig.xml that also does this. Is there a way to get TTFReader to extract separate bold, italic and bold-italic XML metrics files from a single .ttc? (This is assuming that the .ttc *does actually* contain the bold etc. glyphs, as per Chris's point, below.) It does strike me as weird that MS Gothic is showing up in bold... when I view this font in the Windows Character Map application, or set the Notepad font to MS Gothic, then it appears at a much lighter (I presume, normal) weight. Any idea why this might be happening? (On the positive side, maybe this means that the msgothic.ttc *does* contain both normal and bold faces... if only I knew how to generate separate metrics files for each weight.) Chris, Unlike M$ Word, XSL-FO processors do not emulate bold text. Therefore the its up to the source font to contain glyphs for both bold and normal weights. Ah, gotcha. Is there an easy way to find out for sure whether fonts (specifically, the fonts in msgothic.ttc and msmincho.tff) actually *do* contain the different weight glyphs? (Erm, I mean: in addition to trying to render these fonts in bold via an XSL-FO processor? ;-) Japanese Fonts typically contain glyphs for one weight. I know this because this subject has been discussed on this list before. Oops: I did search the archives before I asked, I swear :-). I've gone back and had another look... Recommended course of action: find a Japanesse font that has glyphs for both weights. Although I'm not sure any exist; hence the frequency of this question. I can't see any suggestions for (freeware) Japanese fonts (I'm cheap too :-) with different glyph weights... anyone know of any, and where I can get 'em? (I'm off to Google for some now...) If I can't find any, then, as suggested by others in previous emails, I'll make do with a combination of fonts (although why MS Gothic appears in bold still bugs me...). Thanks again for the advice. Regards, Graham Hannington - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Japanese fonts do not appear in desired weights
I would definitely try generating a different .xml from the same .ttc, but change the -ttc param to say MS Mincho Bold (--you get the idea) See if that works out okay. I tried MS Mincho Bold and several other variations (... bold, ...-Bold, ... (Bold)), but they all resulted in: This is a TrueType collection file with2 fonts Containing the following fonts: MS Mincho MS PMincho java.io.IOException: Failed to read font at org.apache.fop.fonts.TTFFile.readFont(Unknown Source) at org.apache.fop.fonts.apps.TTFReader.loadTTF(Unknown Source) at org.apache.fop.fonts.apps.TTFReader.main(Unknown Source) Shame, it *was* a nice idea. Thanks for the suggestion :-). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Table of Contents problem
Jon Steeves wrote: I'm trying to generate a TOC. The following code works up to a point - all the TOC items output correctly except for the last one, which won't print the page number at the end of the leader pattern. I have the same problem (last page number citation in a TOC does not appear), and also this one: the last page number citation on *each page* of a (multi-page) TOC does not appear. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How do I use MathML with FOP?
How can I include MathML-source equations etc. into a PDF? (I'm afraid I don't know much about MathML: is there a tool/stylesheet to transform MathML into FO, which can then be included in an FO file with the rest of the content required in the PDF, prior to using FOP?) Graham Hannington - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Aligning a block with the bottom of the page
How do I align an fo:block with the bottom of the current page? (I'd like to have the copyright notice, on the reverse side of the cover page, appear at the bottom of the page.) Graham Hannington - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Aligning a block with the bottom of the page
Use the region-after sections of your static-content of your page-sequences. Okay, thanks. Er, is there any way to do this inside a fo:flow ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: FOP completes rendering when using lo-res graphics, but not w ith hi-res
Probably. You should get a MemoryOverflowException somewhere, check whatever logs you have. Try to give more memory to the JVM, see the FOP FAQ for more hints. Thank you so much! I added -Xmx200m between the java and -cp in fop.bat, and now FOP completely renders my document with high-res graphics! :-) (The FOP FAQ, at http://xml.apache.org/fop/faq.html, has a memory settings of the JVM hyperlink that, not that helpfully, points to the FOP home page.) Where would that MemoryOverflowException be reported? I'm currently forwarding FOP messages to a log file, but it doesn't contain any such error. On that subject, is there any way to get FOP to report the .fo source line number at which an error occurs? All my log contains is errors such as: [ERROR] children of list-blocks must be list-items A line number would sure make it easier to track down errors in my (1.5MB) .fo file. Thanks again for the memory tip, that's made my day :-). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: A question about tables
Not a direct answer to your question, I'm afraid, but here's what I do in my HTML-FO stylesheet, for tables whose column widths are not specified: xsl:variable name=width select=concat(format-number(floor(number(substring-before($column-width, 'mm')) div count(html:tr[child::html:td][1]/html:td)), '#'), 'mm') / xsl:for-each select=html:tr[child::html:td][1]/html:td fo:table-column xsl:attribute name=column-widthxsl:value-of select=$width //xsl:attribute /fo:table-column /xsl:for-each ($column-width is a predefined string variable that contains the width of the printable area on the page: say, 160mm) Basically, this divides the available width by the number of td (table cell) tags in a table row, and then outputs a fo:table-column tag for each table column. If you can determine from your XML how many columns are in your table, then you can at least specify equal column widths, as above. (The above XSL snippet assumes that the row does not contain spanned cells. Any advice on improving this gratefully received.) Graham Hannington - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can FOP indent tables (say, with start-indent)?
Can FOPindent tables? I'm using a page layout that defines a startindent for the body text column (the headings are "outdented"). I'd like some tables to be "column width" (in line with the body text), others to be "page width" (margin-to-margin). After experimenting, I can indent the table contents, but the borders are stuck at the left margin. Any ideas? I'm using FOP 2.0.4. (With apologies if this is a well-known issue: I'm a new user. I've searched the FOP open bug list, and googled, but I've not yet seen this explicitly confirmed/denied.) Graham Hannington