ManifoldCF
  1. ManifoldCF
  2. CONNECTORS-387

Japanese fonts are missing from the PDF files generated for the site

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: ManifoldCF 0.5
    • Fix Version/s: ManifoldCF 0.5
    • Component/s: Documentation
    • Labels:
      None

      Description

      Japanese fonts are missing from the PDFs generated for the site.

      This page describes how to fix that:

      http://forrest.apache.org/pluginDocs/plugins_0_90/org.apache.forrest.plugin.output.pdf/

        Issue Links

          Activity

          Hide
          Karl Wright added a comment -

          I tried adding the fix in question, based on the link above, but it didn't seem to change anything. I committed it nevertheless, presuming it's something small. r1232733.

          Show
          Karl Wright added a comment - I tried adding the fix in question, based on the link above, but it didn't seem to change anything. I committed it nevertheless, presuming it's something small. r1232733.
          Hide
          Karl Wright added a comment -

          The fix actually does fix some things; the table-of-contents in the PDF looks right, but the content itself doesn't. I conclude that we have to modify the pdf generation configuration file so that it specifies a different font for Japanese vs. english; apparently it's not smart enough to realize that the font in question has no Japanese characters and try a different one.

          Show
          Karl Wright added a comment - The fix actually does fix some things; the table-of-contents in the PDF looks right, but the content itself doesn't. I conclude that we have to modify the pdf generation configuration file so that it specifies a different font for Japanese vs. english; apparently it's not smart enough to realize that the font in question has no Japanese characters and try a different one.
          Hide
          Hitoshi Ozawa added a comment -

          Yes. It's necessary to change fonts to include in the pdf document based on language. Will write it up.

          Show
          Hitoshi Ozawa added a comment - Yes. It's necessary to change fonts to include in the pdf document based on language. Will write it up.
          Hide
          Karl Wright added a comment -
          Show
          Karl Wright added a comment - Maybe this resource would be helpful? http://xmlgraphics.apache.org/fop/0.95/configuration.html#When+it+does+not+work
          Hide
          Hitoshi Ozawa added a comment -

          Sorry, didn't have too much time this weekend.

          This is what I did for JasperServer which had a similar problem.
          1. Download IPA Fonts (IPAGTTC00303.zip(4.23 MB)
          License is IPA Open Font License which is in standard with OSI. I'm not sure if this is Apache compatible or not.
          http://ossipedia.ipa.go.jp/ipafont/index.html

          2. Download fop
          3. Find font names
          java -cp build\fop.jar;lib\avalon-framework-4.2.0.jar;lib\commons-logging-1.0.4.jar;lib\commons-io-1.3.1.jar;lib\xmlgraphics-commons-1.4.jar org.apache.fop.fonts.apps.TTFReader C:\fonts\IPAGTTC00303\ipag.ttc "C:\fonts\IPAGTTC00303\ipag.ttc\ipagothic.xml"
          4. Create font metric file
          java -cp build\fop.jar;lib\avalon-framework-4.2.0.jar;lib\commons-logging-1.0.4.jar;lib\commons-io-1.3.1.jar;lib\xmlgraphics-commons-1.4.jar org.apache.fop.fonts.apps.TTFReader -ttcname "IPAPGothic" C:\fonts\IPAGTTC00303\ipag.ttc "C:\fonts\IPAGTTC00303\ipapgothic.xml

          5.Edit config.xml
          <!-- IPAPGothic -->
          <font metrics-file="ipapgothic.xml" kerning="yes" embed-url="file:///C:/fonts/IPAGTTC00303/ipag.ttc">
          <font-triplet name="IPAPGothic" style="normal" weight="normal"/>
          <font-triplet name="IPAPGothic" style="normal" weight="bold"/>
          <font-triplet name="IPAPGothic" style="normal" weight="100"/>
          <font-triplet name="IPAPGothic" style="normal" weight="200"/>
          <font-triplet name="IPAPGothic" style="normal" weight="300"/>
          <font-triplet name="IPAPGothic" style="normal" weight="400"/>
          <font-triplet name="IPAPGothic" style="normal" weight="500"/>
          <font-triplet name="IPAPGothic" style="normal" weight="600"/>
          <font-triplet name="IPAPGothic" style="normal" weight="700"/>
          <font-triplet name="IPAPGothic" style="normal" weight="800"/>
          <font-triplet name="IPAPGothic" style="normal" weight="900"/>
          <font-triplet name="IPAPGothic" style="italic" weight="normal"/>
          <font-triplet name="IPAPGothic" style="italic" weight="bold"/>
          <font-triplet name="IPAPGothic" style="italic" weight="100"/>
          <font-triplet name="IPAPGothic" style="italic" weight="200"/>
          <font-triplet name="IPAPGothic" style="italic" weight="300"/>
          <font-triplet name="IPAPGothic" style="italic" weight="400"/>
          <font-triplet name="IPAPGothic" style="italic" weight="500"/>
          <font-triplet name="IPAPGothic" style="italic" weight="600"/>
          <font-triplet name="IPAPGothic" style="italic" weight="700"/>
          <font-triplet name="IPAPGothic" style="italic" weight="800"/>
          <font-triplet name="IPAPGothic" style="italic" weight="900"/>
          </font>

          6. create forrest.properties.xml
          <?xml version='1.0'?>
          <properties>
          <property name="output.pdf.fontFamily.serif" value="IPAPGothic"/>
          <property name="output.pdf.fontFamily.sansSerif" value="IPAPGothic"/>
          <property name="output.pdf.fontFamily.monospace" value="IPAPGothic"/>
          <property name="output.pdf.fontFamily.arial" value="IPAPGothic"/>
          <property name="output.pdf.fontFamily.TimesNewRoman" value="IPAPGothic"/>
          <property name="output.pdf.fontFamily.Courier" value="IPAPGothic"/>
          <property name="output.pdf.fontFamily.arialMT" value="IPAPGothic"/>
          <property name="output.pdf.fontFamily.arial-BoldMT" value="IPAPGothic"/>
          <property name="output.pdf.fontFamily.arial-ItalicMT" value="IPAPGothic"/>
          <property name="output.pdf.fontFamily.TimesNewRomanPSMT" value="IPAPGothic"/>
          </properties>

          Show
          Hitoshi Ozawa added a comment - Sorry, didn't have too much time this weekend. This is what I did for JasperServer which had a similar problem. 1. Download IPA Fonts (IPAGTTC00303.zip(4.23 MB) License is IPA Open Font License which is in standard with OSI. I'm not sure if this is Apache compatible or not. http://ossipedia.ipa.go.jp/ipafont/index.html 2. Download fop 3. Find font names java -cp build\fop.jar;lib\avalon-framework-4.2.0.jar;lib\commons-logging-1.0.4.jar;lib\commons-io-1.3.1.jar;lib\xmlgraphics-commons-1.4.jar org.apache.fop.fonts.apps.TTFReader C:\fonts\IPAGTTC00303\ipag.ttc "C:\fonts\IPAGTTC00303\ipag.ttc\ipagothic.xml" 4. Create font metric file java -cp build\fop.jar;lib\avalon-framework-4.2.0.jar;lib\commons-logging-1.0.4.jar;lib\commons-io-1.3.1.jar;lib\xmlgraphics-commons-1.4.jar org.apache.fop.fonts.apps.TTFReader -ttcname "IPAPGothic" C:\fonts\IPAGTTC00303\ipag.ttc "C:\fonts\IPAGTTC00303\ipapgothic.xml 5.Edit config.xml <!-- IPAPGothic --> <font metrics-file="ipapgothic.xml" kerning="yes" embed-url="file:///C:/fonts/IPAGTTC00303/ipag.ttc"> <font-triplet name="IPAPGothic" style="normal" weight="normal"/> <font-triplet name="IPAPGothic" style="normal" weight="bold"/> <font-triplet name="IPAPGothic" style="normal" weight="100"/> <font-triplet name="IPAPGothic" style="normal" weight="200"/> <font-triplet name="IPAPGothic" style="normal" weight="300"/> <font-triplet name="IPAPGothic" style="normal" weight="400"/> <font-triplet name="IPAPGothic" style="normal" weight="500"/> <font-triplet name="IPAPGothic" style="normal" weight="600"/> <font-triplet name="IPAPGothic" style="normal" weight="700"/> <font-triplet name="IPAPGothic" style="normal" weight="800"/> <font-triplet name="IPAPGothic" style="normal" weight="900"/> <font-triplet name="IPAPGothic" style="italic" weight="normal"/> <font-triplet name="IPAPGothic" style="italic" weight="bold"/> <font-triplet name="IPAPGothic" style="italic" weight="100"/> <font-triplet name="IPAPGothic" style="italic" weight="200"/> <font-triplet name="IPAPGothic" style="italic" weight="300"/> <font-triplet name="IPAPGothic" style="italic" weight="400"/> <font-triplet name="IPAPGothic" style="italic" weight="500"/> <font-triplet name="IPAPGothic" style="italic" weight="600"/> <font-triplet name="IPAPGothic" style="italic" weight="700"/> <font-triplet name="IPAPGothic" style="italic" weight="800"/> <font-triplet name="IPAPGothic" style="italic" weight="900"/> </font> 6. create forrest.properties.xml <?xml version='1.0'?> <properties> <property name="output.pdf.fontFamily.serif" value="IPAPGothic"/> <property name="output.pdf.fontFamily.sansSerif" value="IPAPGothic"/> <property name="output.pdf.fontFamily.monospace" value="IPAPGothic"/> <property name="output.pdf.fontFamily.arial" value="IPAPGothic"/> <property name="output.pdf.fontFamily.TimesNewRoman" value="IPAPGothic"/> <property name="output.pdf.fontFamily.Courier" value="IPAPGothic"/> <property name="output.pdf.fontFamily.arialMT" value="IPAPGothic"/> <property name="output.pdf.fontFamily.arial-BoldMT" value="IPAPGothic"/> <property name="output.pdf.fontFamily.arial-ItalicMT" value="IPAPGothic"/> <property name="output.pdf.fontFamily.TimesNewRomanPSMT" value="IPAPGothic"/> </properties>
          Hide
          Karl Wright added a comment -

          It's not entirely clear to me whether these forrest.properties settings will allow both English and Japanese to be rendered correctly. What is your expectation here?

          Show
          Karl Wright added a comment - It's not entirely clear to me whether these forrest.properties settings will allow both English and Japanese to be rendered correctly. What is your expectation here?
          Hide
          Hitoshi Ozawa added a comment -

          Alphabets are included in Japanese fonts so they should appear. The only problem may be the fonts will be different. To keep English version to use English font while making Japanese version use Japanese font, we can use different namespace for English and Japanese and modify forrest stylesheet to select fonts based on the namespace.

          Show
          Hitoshi Ozawa added a comment - Alphabets are included in Japanese fonts so they should appear. The only problem may be the fonts will be different. To keep English version to use English font while making Japanese version use Japanese font, we can use different namespace for English and Japanese and modify forrest stylesheet to select fonts based on the namespace.
          Hide
          Karl Wright added a comment -

          Alphabets are included in Japanese fonts so they should appear.

          I take it that you mean English alphabets?

          My concern is that we need to have a plan and mechanism in place for dealing with other languages beyond English and Japanese. I think this means that each PDF we produce (e.g. end-user-documentation.pdf, ja_JP/end-user-documentation_ja_JP.pdf, etc.) EACH needs its own font selection. Can forrest use multiple configurations for PDF generation? If you do not know a way, then we should take this up on the Forrest list and maybe enter a new Forrest ticket.

          Show
          Karl Wright added a comment - Alphabets are included in Japanese fonts so they should appear. I take it that you mean English alphabets? My concern is that we need to have a plan and mechanism in place for dealing with other languages beyond English and Japanese. I think this means that each PDF we produce (e.g. end-user-documentation.pdf, ja_JP/end-user-documentation_ja_JP.pdf, etc.) EACH needs its own font selection. Can forrest use multiple configurations for PDF generation? If you do not know a way, then we should take this up on the Forrest list and maybe enter a new Forrest ticket.
          Hide
          Karl Wright added a comment -

          This thread seems to confirm to some extent your process:

          http://old.nabble.com/Japanese-PDF-rendering-td23118582.html

          The interesting allusion is in Heather's description of how she included styles for specific PDFs from another source:

          The Japanese font display issue is only occurring with my DocBook XML source files.  These are not handled by document2fo.xsl, but rather by the DocBook 4.4 stylesheets, which I downloaded and included on my own.  Here is an excerpt from my project sitemap showing how I did this:
          
             <map:match pattern="**.pdf">
              <map:act type="sourcetype" src="{properties:content.xdocs}{1}.xml">
               <map:select type="parameter">
                <map:parameter name="parameter-selector-test" value="{sourcetype}"/>
                <map:when test="docbook-v4.4">
                 <map:generate src="{properties:content.xdocs}{../1}.xml"/>
                 <map:transform
                    src="{properties:resources.stylesheets}/docbook-xsl-1.74.3-pre 2/fo/docbook.xsl"/>
                 <map:serialize type="fo2pdf"/>
                </map:when>
               </map:select>
              </map:act>
             </map:match>
          

          The map:match pattern looks like it might be usable to do what we need but I'm not sure what config file she's referring to.

          Show
          Karl Wright added a comment - This thread seems to confirm to some extent your process: http://old.nabble.com/Japanese-PDF-rendering-td23118582.html The interesting allusion is in Heather's description of how she included styles for specific PDFs from another source: The Japanese font display issue is only occurring with my DocBook XML source files. These are not handled by document2fo.xsl, but rather by the DocBook 4.4 stylesheets, which I downloaded and included on my own. Here is an excerpt from my project sitemap showing how I did this : <map:match pattern= "**.pdf" > <map:act type= "sourcetype" src= "{properties:content.xdocs}{1}.xml" > <map:select type= "parameter" > <map:parameter name= "parameter-selector-test" value= "{sourcetype}" /> <map:when test= "docbook-v4.4" > <map:generate src= "{properties:content.xdocs}{../1}.xml" /> <map:transform src= "{properties:resources.stylesheets}/docbook-xsl-1.74.3-pre 2/fo/docbook.xsl" /> <map:serialize type= "fo2pdf" /> </map:when> </map:select> </map:act> </map:match> The map:match pattern looks like it might be usable to do what we need but I'm not sure what config file she's referring to.
          Hide
          Karl Wright added a comment -

          The overall Forrest sitemap documentation is here:

          http://forrest.apache.org/docs_0_90/sitemap-ref.html

          It sounds like the PDF configuration moved to a plugin, and it is not immediately clear whether the plugin configuration can specify the equivalent of a map:match pattern or not...

          Show
          Karl Wright added a comment - The overall Forrest sitemap documentation is here: http://forrest.apache.org/docs_0_90/sitemap-ref.html It sounds like the PDF configuration moved to a plugin, and it is not immediately clear whether the plugin configuration can specify the equivalent of a map:match pattern or not...
          Hide
          Hitoshi Ozawa added a comment -

          Seems like Heather ended up just modifying the config.xml file to use fonts with Japanese included in it (i.e. Brush_Script.ttf)

          There's a fonts and schema directory unser site/src/documentation/resources/

          document-to^fo.xsl is under forrest's /apache-forrest-0.9/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets

          Around line #328, there's a fo:root tag with font-family name.

          Show
          Hitoshi Ozawa added a comment - Seems like Heather ended up just modifying the config.xml file to use fonts with Japanese included in it (i.e. Brush_Script.ttf) There's a fonts and schema directory unser site/src/documentation/resources/ document-to^fo.xsl is under forrest's /apache-forrest-0.9/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets Around line #328, there's a fo:root tag with font-family name.
          Hide
          Karl Wright added a comment -

          The forrest page for the PDF plugin configuration is here:

          http://forrest.apache.org/pluginDocs/plugins_0_90/org.apache.forrest.plugin.output.pdf/

          On that page they recommend a multi-lingual Dejavu open-source font, which apparently has quite wide language coverage which is growing all the time:

          http://dejavu-fonts.org/wiki/index.php?title=Main_Page

          The license for the font is here:

          http://dejavu-fonts.org/wiki/License

          A more important question for this discussion is whether or not it includes Japanese characters at this time. Hitoshi, can you find out?

          Show
          Karl Wright added a comment - The forrest page for the PDF plugin configuration is here: http://forrest.apache.org/pluginDocs/plugins_0_90/org.apache.forrest.plugin.output.pdf/ On that page they recommend a multi-lingual Dejavu open-source font, which apparently has quite wide language coverage which is growing all the time: http://dejavu-fonts.org/wiki/index.php?title=Main_Page The license for the font is here: http://dejavu-fonts.org/wiki/License A more important question for this discussion is whether or not it includes Japanese characters at this time. Hitoshi, can you find out?
          Hide
          Karl Wright added a comment -

          I even confirmed that the Dejavu license is redistributable, so in theory we can build the font as part of building the site. Here's the Apache Legal link:

          http://www.apache.org/legal/resolved.html

          What I'd like to do is (a) confirm that the Dejavu font solves our problem as far as Japanese is confirmed; (b) include code to build it locally (or include a built .ttf version); (c) include appropriate local configuration changes to Forrest's PDF configuration so that all PDFs are built with Dejavu.

          Show
          Karl Wright added a comment - I even confirmed that the Dejavu license is redistributable, so in theory we can build the font as part of building the site. Here's the Apache Legal link: http://www.apache.org/legal/resolved.html What I'd like to do is (a) confirm that the Dejavu font solves our problem as far as Japanese is confirmed; (b) include code to build it locally (or include a built .ttf version); (c) include appropriate local configuration changes to Forrest's PDF configuration so that all PDFs are built with Dejavu.
          Show
          Karl Wright added a comment - Here's the SourceForge download page: http://sourceforge.net/projects/dejavu/files/dejavu/2.33/dejavu-fonts-ttf-2.33.zip/download
          Hide
          Karl Wright added a comment -

          If there's a Forrest fix, we won't need to do one ourselves.

          Show
          Karl Wright added a comment - If there's a Forrest fix, we won't need to do one ourselves.
          Hide
          Hitoshi Ozawa added a comment -

          Sorry Karl, it doesn't seem like dejavu contains Japanese. Characters aren't coming out correctly. Looking at langcover.txt, progress in Japanese is still 0 for both Sans and Serif. I've also search Japanese pages and it seems people are using dejavu with IPA fonts I've mentioned earlier.

          Show
          Hitoshi Ozawa added a comment - Sorry Karl, it doesn't seem like dejavu contains Japanese. Characters aren't coming out correctly. Looking at langcover.txt, progress in Japanese is still 0 for both Sans and Serif. I've also search Japanese pages and it seems people are using dejavu with IPA fonts I've mentioned earlier.
          Hide
          Karl Wright added a comment - - edited

          Hitoshi,

          I don't see any sign that Apache Legal has ever ruled on the IPA license, but several clauses in there give me reason to question whether they would permit us to redistribute it. I'm happy to post the license and have them rule but it will take some time. What we'll also need to do is figure out a way to switch between fonts based on the path of the PDF being generated if we stick with IPA, because a clause in the license definitely forbids relabeling or modifying the IPA fonts, so we could not redistribute a merged font family.

          That's why I've been exploring the Dejavu route, since the Forrest page explicitly mentioned CJK support in that family. Too bad it isn't true.

          Show
          Karl Wright added a comment - - edited Hitoshi, I don't see any sign that Apache Legal has ever ruled on the IPA license, but several clauses in there give me reason to question whether they would permit us to redistribute it. I'm happy to post the license and have them rule but it will take some time. What we'll also need to do is figure out a way to switch between fonts based on the path of the PDF being generated if we stick with IPA, because a clause in the license definitely forbids relabeling or modifying the IPA fonts, so we could not redistribute a merged font family. That's why I've been exploring the Dejavu route, since the Forrest page explicitly mentioned CJK support in that family. Too bad it isn't true.
          Hide
          Hitoshi Ozawa added a comment -

          Tried Dejavu with Japanese and characters didn't come out. According to the included langcover.txt file, CJK progress on CJK support are all 0%. IPA is one of the popular fonts but I'll try to find some other.

          Show
          Hitoshi Ozawa added a comment - Tried Dejavu with Japanese and characters didn't come out. According to the included langcover.txt file, CJK progress on CJK support are all 0%. IPA is one of the popular fonts but I'll try to find some other.
          Hide
          Karl Wright added a comment -

          Using IPA is still possible if the site build automatically downloads the font. Once that happens, there are three ways of getting a site built that uses different PDF fonts for different languages. Here they are, in order of preference:

          (1) We could try to merge the IPA and Dejavu fonts during the site build process, before calling Forrest. This would require us to locate some open-source font editing tools. I know little about this but maybe it is not as hard as I think.

          (2) We could find a way to configure Forrest so that PDFs in one part of the site use one set of fonts, and PDFs in another part of the site use a different set. I think the right way to figure this out would be to post on the Forrest lists.

          (3) We could set up the site build to create multiple Forrest sites, one for each language. We'd use these special PDF sites to generate only the PDF documentation, and then write it back into the final result using Ant.

          So what we need to learn is:

          (a) Is there an open-source tool that would allow us to merge true-type fonts that we can download automatically, or redistribute?

          (b) Is it possible to configure Forrest so that different fonts are used in PDF generation for different parts of a single site?

          (c) Can I actually change Forrest's PDF font for a single site? I'm still trying to get this to work. The problem is that I don't know first of all where the config.xml should be, and second, the paths and URLs must all be relative, but I haven't figured out if this is possible yet, or what the working directory will be. I need to experiment further with this. If you know where config.xml goes that would be a great help though.

          Thanks,
          Karl

          Show
          Karl Wright added a comment - Using IPA is still possible if the site build automatically downloads the font. Once that happens, there are three ways of getting a site built that uses different PDF fonts for different languages. Here they are, in order of preference: (1) We could try to merge the IPA and Dejavu fonts during the site build process, before calling Forrest. This would require us to locate some open-source font editing tools. I know little about this but maybe it is not as hard as I think. (2) We could find a way to configure Forrest so that PDFs in one part of the site use one set of fonts, and PDFs in another part of the site use a different set. I think the right way to figure this out would be to post on the Forrest lists. (3) We could set up the site build to create multiple Forrest sites, one for each language. We'd use these special PDF sites to generate only the PDF documentation, and then write it back into the final result using Ant. So what we need to learn is: (a) Is there an open-source tool that would allow us to merge true-type fonts that we can download automatically, or redistribute? (b) Is it possible to configure Forrest so that different fonts are used in PDF generation for different parts of a single site? (c) Can I actually change Forrest's PDF font for a single site? I'm still trying to get this to work. The problem is that I don't know first of all where the config.xml should be, and second, the paths and URLs must all be relative, but I haven't figured out if this is possible yet, or what the working directory will be. I need to experiment further with this. If you know where config.xml goes that would be a great help though. Thanks, Karl
          Hide
          Karl Wright added a comment -

          The idea of merging fonts, even for one-time use, is apparently not a good one legally:

          http://lists.gnu.org/archive/html/freetype/2000-09/msg00022.html

          Show
          Karl Wright added a comment - The idea of merging fonts, even for one-time use, is apparently not a good one legally: http://lists.gnu.org/archive/html/freetype/2000-09/msg00022.html
          Hide
          Karl Wright added a comment - - edited

          I get the following when the PDFs are being built under the above setup:

               [exec] WARN - Font 'IPAPGothic,normal,400' not found. Substituting with 'any,normal,400'.
               [exec] WARN - Font 'IPAPGothic,normal,700' not found. Substituting with 'any,normal,700'.
               [exec] WARN - Font 'IPAPGothic,italic,400' not found. Substituting with 'any,italic,400'.
          

          It's not clear whether this is because none of the IPAP Gothic fonts are properly registered, or because only these three fonts are needed. Looking further, it doesn't look like any of the IPAP fonts are being properly registered. This is where I put config.xml at: src/documentation/resources/fonts/config.xml. Clearly that's not the right place, or I've done something wrong in it.

          I'm checking the whole thing in now, since it doesn't seem to break anything worse than it is already broken.

          Show
          Karl Wright added a comment - - edited I get the following when the PDFs are being built under the above setup: [exec] WARN - Font 'IPAPGothic,normal,400' not found. Substituting with 'any,normal,400'. [exec] WARN - Font 'IPAPGothic,normal,700' not found. Substituting with 'any,normal,700'. [exec] WARN - Font 'IPAPGothic,italic,400' not found. Substituting with 'any,italic,400'. It's not clear whether this is because none of the IPAP Gothic fonts are properly registered, or because only these three fonts are needed. Looking further, it doesn't look like any of the IPAP fonts are being properly registered. This is where I put config.xml at: src/documentation/resources/fonts/config.xml. Clearly that's not the right place, or I've done something wrong in it. I'm checking the whole thing in now, since it doesn't seem to break anything worse than it is already broken.
          Hide
          Karl Wright added a comment -

          r1237018 and r1237019

          Show
          Karl Wright added a comment - r1237018 and r1237019
          Hide
          Karl Wright added a comment -

          To try it, do the following:

          cd site
          ant download-dependencies
          ant

          (The second ant builds the site based on the downloaded fonts)

          Show
          Karl Wright added a comment - To try it, do the following: cd site ant download-dependencies ant (The second ant builds the site based on the downloaded fonts)
          Hide
          Karl Wright added a comment -

          r1237051 to fix a problem with above.

          Show
          Karl Wright added a comment - r1237051 to fix a problem with above.
          Hide
          Karl Wright added a comment -

          Still no luck. I did the following experiment to see whether or not my src/documentation/resources/schema/symbols-project-v10.ent file was being seen and understood: I put in a fixed path to the config.xml file, and made the config.xml file have bad XML in it. There was no error of any kind when I ran Forrest at that point. I conclude that the .ent file name is incorrect, or in the wrong place, despite the Forrest documentation. I'll have to figure out from the Forrest code what it is actually doing, maybe next week. In the meantime I'm going to open yet another Forrest ticket.

          Show
          Karl Wright added a comment - Still no luck. I did the following experiment to see whether or not my src/documentation/resources/schema/symbols-project-v10.ent file was being seen and understood: I put in a fixed path to the config.xml file, and made the config.xml file have bad XML in it. There was no error of any kind when I ran Forrest at that point. I conclude that the .ent file name is incorrect, or in the wrong place, despite the Forrest documentation. I'll have to figure out from the Forrest code what it is actually doing, maybe next week. In the meantime I'm going to open yet another Forrest ticket.
          Hide
          Karl Wright added a comment -

          Made some progress. Turns out the the symbols-project-v10.ent file is never read. Furthermore, since none of the paths can be relative, I realized we're better off just making a local copy of Forrest and modifying the PDF plugin's output.xmap. I've written Ant targets which do all of these things, and it is largely successful, except for the very last step, which is generating the PDFs themselves. Then, for each PDF I get the following:

          BROKEN: For TrueType collection you must specify which font to select (-ttcname)

          This is the same error I see when I use FOP to generate a metrics file, unless I include "-ttcname xxx" on the command line to specify the font. The IPA font collection has 2 fonts in it which explains why it is needed. But the <font> tag in the config.xml does not seem to have any way of describing the font name, so once again I'm stuck. I may need to go hacking around inside FOP to get this to work now.

          Show
          Karl Wright added a comment - Made some progress. Turns out the the symbols-project-v10.ent file is never read. Furthermore, since none of the paths can be relative, I realized we're better off just making a local copy of Forrest and modifying the PDF plugin's output.xmap. I've written Ant targets which do all of these things, and it is largely successful, except for the very last step, which is generating the PDFs themselves. Then, for each PDF I get the following: BROKEN: For TrueType collection you must specify which font to select (-ttcname) This is the same error I see when I use FOP to generate a metrics file, unless I include "-ttcname xxx" on the command line to specify the font. The IPA font collection has 2 fonts in it which explains why it is needed. But the <font> tag in the config.xml does not seem to have any way of describing the font name, so once again I'm stuck. I may need to go hacking around inside FOP to get this to work now.
          Hide
          Karl Wright added a comment -

          It looks like someone tried to add support for .ttc's in FOP 1.0. To use it you are supposed to set the attribute "sub-font" to the font name in the collection. But this does not seem to have any effect.

          This could be because Forrest's FOP version is 0.95 at the moment. But replacing the 0.95 fop jar with the 1.0 fop jar still doesn't get us past this problem.

          Show
          Karl Wright added a comment - It looks like someone tried to add support for .ttc's in FOP 1.0. To use it you are supposed to set the attribute "sub-font" to the font name in the collection. But this does not seem to have any effect. This could be because Forrest's FOP version is 0.95 at the moment. But replacing the 0.95 fop jar with the 1.0 fop jar still doesn't get us past this problem.
          Hide
          Karl Wright added a comment -

          r1237395

          Show
          Karl Wright added a comment - r1237395
          Hide
          Karl Wright added a comment - - edited

          Upgrading to the trunk version of fop fixed the problem. There was also an issue with a duplicate copy of the 0.95 jar hanging around, so the 1.0 fop jar might well have worked if I'd noticed that before. r1237495.
          Next step is to look into whether output.xmap can be conditionalized to use different fonts for different parts of the tree.

          Show
          Karl Wright added a comment - - edited Upgrading to the trunk version of fop fixed the problem. There was also an issue with a duplicate copy of the 0.95 jar hanging around, so the 1.0 fop jar might well have worked if I'd noticed that before. r1237495. Next step is to look into whether output.xmap can be conditionalized to use different fonts for different parts of the tree.
          Hide
          Karl Wright added a comment - - edited

          Looks good, and the properly-generated PDFs are already live.

          I've rearranged the site code now to give more equal emphasis to english and japanese, and also allow for the crawler UI "help" link to take you to the right help page for your language, but I have not published this yet. The only downside here is that there's now need of a "launch" tab which does nothing more than tell you to click on the appropriate language tab. I'm hoping Google will pick this up OK.

          Hitoshi, could you synch up trunk and do "ant download-dependencies doc", and see that the site navigation for the site at dist/doc now makes sense in Japanese?

          The only outstanding work for this ticket now is trying to get different fonts used to generate PDFs for different parts of the site.

          Show
          Karl Wright added a comment - - edited Looks good, and the properly-generated PDFs are already live. I've rearranged the site code now to give more equal emphasis to english and japanese, and also allow for the crawler UI "help" link to take you to the right help page for your language, but I have not published this yet. The only downside here is that there's now need of a "launch" tab which does nothing more than tell you to click on the appropriate language tab. I'm hoping Google will pick this up OK. Hitoshi, could you synch up trunk and do "ant download-dependencies doc", and see that the site navigation for the site at dist/doc now makes sense in Japanese? The only outstanding work for this ticket now is trying to get different fonts used to generate PDFs for different parts of the site.
          Hide
          Hitoshi Ozawa added a comment -

          Looks very good! Sorry, that I wasn't too much of a help, but I'm tied up with a short term customer project.

          Show
          Hitoshi Ozawa added a comment - Looks very good! Sorry, that I wasn't too much of a help, but I'm tied up with a short term customer project.
          Hide
          Karl Wright added a comment -

          I'd hoped to modify output.xmap to do the right thing for condition font inclusion, but this is not going to work because the conditional here would just change font registration, and we need to change font specification. We really need conditionals in the forrest.properties.xml to make the right thing happen.

          Nevertheless I am certain that the parameters created by forrest.parameters.xml are substituted somewhere to specify the font selection for FOP. That file can be replaced by our own version with multilanguage support the same way I replace the other files in Forrest. Will keep looking...

          Show
          Karl Wright added a comment - I'd hoped to modify output.xmap to do the right thing for condition font inclusion, but this is not going to work because the conditional here would just change font registration, and we need to change font specification. We really need conditionals in the forrest.properties.xml to make the right thing happen. Nevertheless I am certain that the parameters created by forrest.parameters.xml are substituted somewhere to specify the font selection for FOP. That file can be replaced by our own version with multilanguage support the same way I replace the other files in Forrest. Will keep looking...
          Hide
          Karl Wright added a comment -

          The right file for conditionalizating font choice is clearly plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/document-to-fo.xsl. Unfortunately I don't see any evidence that the stylesheet has access to the path of the current file, and what its variable name would be called. It may even be that the stylesheet is applied once, not on every PDF converted, which would be a hard thing to work around without more significant changes to the Forrest code.

          I'm also not a stylesheet pro so I'd love an example of a conditional stylesheet selection based on a regexp match.

          Show
          Karl Wright added a comment - The right file for conditionalizating font choice is clearly plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/document-to-fo.xsl. Unfortunately I don't see any evidence that the stylesheet has access to the path of the current file, and what its variable name would be called. It may even be that the stylesheet is applied once, not on every PDF converted, which would be a hard thing to work around without more significant changes to the Forrest code. I'm also not a stylesheet pro so I'd love an example of a conditional stylesheet selection based on a regexp match.
          Hide
          Karl Wright added a comment -

          r1239111 for conditional fonts.

          Show
          Karl Wright added a comment - r1239111 for conditional fonts.

            People

            • Assignee:
              Karl Wright
              Reporter:
              Karl Wright
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development