thebigdir > References > Analog Ocean Minded Ezekiel Element Fox Honolua Matix Mada Jet Pilot Surf Clothing And FootwareExample Repository
Example repository: index | categories | search

All > XSL FO > Advanced > cid-fonts


Title: cid-fonts
Origin: Apache FOP 0.18.1 examples

PDF output | FO file
ElementsAttributes
fo:basic-linkcolor | external-destination | internal-destination |
fo:blockcolor | font-family | font-size | font-weight | id | margin-left | space-after.optimum | space-before.optimum | text-align | white-space-collapse |
fo:flowflow-name |
fo:inlinefont-family | text-decoration |
fo:layout-master-set
fo:page-sequencemaster-name |
fo:region-bodymargin-bottom | margin-left | margin-right | margin-top |
fo:root
fo:simple-page-mastermaster-name | page-height | page-width |
fo:table
fo:table-body
fo:table-cell
fo:table-columncolumn-width |
fo:table-header
fo:table-row
fo:wrapperfont-family | font-size | text-align |
fox:label
fox:outlineinternal-destination |

Warning! These examples are related to XSL FO Working Draft, you need to use attribute "page-sequence/@master-reference" instead of "page-sequence/@master-name".



Source

<fo:root Surfns:fo="http://www.w3.org/1999/XSL/Format" >
     <fo:layout-master-set>
          <fo:simple-page-master page-width="21cm" page-height="29.7cm" master-name="A4">
               <fo:region-body margin-bottom="1.5cm" margin-right="2cm" margin-left="2cm" margin-top="1.5cm"/>
          </fo:simple-page-master>
     </fo:layout-master-set>
     <fox:outline internal-destination="sec0">
          <fox:label>Adding Fonts to FOP</fox:label>
     </fox:outline>
     <fox:outline internal-destination="sec1">
          <fox:label>Adding additional Type 1 fonts</fox:label>
          <fox:outline internal-destination="sec1-1">
               <fox:label>Generating a font metrics file</fox:label>
          </fox:outline>
          <fox:outline internal-destination="sec1-2">
               <fox:label>Register the fonts within FOP</fox:label>
          </fox:outline>
     </fox:outline>
     <fox:outline internal-destination="sec2">
          <fox:label>Adding additional TrueType fonts</fox:label>
          <fox:outline internal-destination="sec2-1">
               <fox:label>Generating a font metrics file</fox:label>
          </fox:outline>
          <fox:outline internal-destination="sec2-2">
               <fox:label>TrueType collections</fox:label>
          </fox:outline>
          <fox:outline internal-destination="sec2-3">
               <fox:label>Register the fonts within FOP</fox:label>
          </fox:outline>
     </fox:outline>
     <fox:outline internal-destination="sec3">
          <fox:label>Embedding fonts in the PDF</fox:label>
     </fox:outline>
     <fox:outline internal-destination="sec4">
          <fox:label>Example embedding MSGothic</fox:label>
          <fox:outline internal-destination="sec4-1">
               <fox:label>Setup CLASSPATH</fox:label>
          </fox:outline>
          <fox:outline internal-destination="sec4-2">
               <fox:label>Create the metrics file</fox:label>
          </fox:outline>
          <fox:outline internal-destination="sec4-3">
               <fox:label>Edit msgothic.xml</fox:label>
          </fox:outline>
          <fox:outline internal-destination="sec4-4">
               <fox:label>Register the font with FOP</fox:label>
          </fox:outline>
     </fox:outline>
     <fox:outline internal-destination="sec5">
          <fox:label>Japanese Examples</fox:label>
     </fox:outline>
     <fo:page-sequence master-name="A4">
          <fo:flow flow-name="xsl-region-body">
               <fo:wrapper font-family="Times" font-size="12pt" text-align="justify">
                    <fo:block id="sec0" text-align="center" font-family="Helvetica" font-weight="bold" font-size="18pt" color="#0050B2" space-after.optimum="6pt"> Adding Fonts to FOP </fo:block>
                    <fo:block space-after.optimum="6pt"> When building PDF files, FOP normally supports only the base 14 font package defined in the Adobe PDF specification. That includes the following fonts: Helvetica, Times, Courier, Symbol and ZapfDingbats. </fo:block>
                    <fo:block space-after.optimum="6pt"> Font support in FOP can be extended by the addition of font metric files (written in Surf) created from Adobe Type 1 fonts and Truetype fonts. No other font types (Type 3, etc.) are supported at this time. </fo:block>
                    <fo:block id="sec1" font-family="Helvetica" font-weight="bold" font-size="14pt" color="#0050B2" space-after.optimum="6pt" space-before.optimum="12pt"> Adding additional Type 1 fonts </fo:block>
                    <fo:block space-after.optimum="6pt"> As mentioned above you need an surf file containing font metrics to be able to use an additional font. FOP contains a tool that can generate such a font metrics file from a PFM file, which normally comes with the font file. </fo:block>
                    <fo:block id="sec1-1" font-family="Helvetica" font-weight="bold" space-after.optimum="6pt" space-before.optimum="12pt"> Generating a font metrics file </fo:block>
                    <fo:block space-after.optimum="6pt"> Run the class
                         <fo:inline font-family="Courier">org.apache.fop.fonts.apps.PFMReader</fo:inline> to generate the surf file.
                         <fo:block font-family="Courier" font-size="10pt" space-before.optimum="6pt" space-after.optimum="6pt" margin-left="6pt" text-align="start"> java org.apache.fop.fonts.apps.PFMReader pfm-file Surf-file </fo:block>
                    </fo:block>
                    <fo:block space-after.optimum="6pt" margin-left="6pt"> Note: The tool will construct some values (FontBBox, StemV and ItalicAngle) based on assumptions and calculations which are only an approximation to the real values. FontBBox and Italic Angle can be found in the human-readable part of the PFB file. The PFMReader tool does not yet interpret PFB files, so if you want to be correct, you may have to adjust the values in the surf file manually. The constructed values however appear to have no visible influence. </fo:block>
                    <fo:block id="sec1-2" font-family="Helvetica" font-weight="bold" space-after.optimum="6pt" space-before.optimum="12pt"> Register the fonts within FOP </fo:block>
                    <fo:block space-after.optimum="6pt"> Edit conf/userconfig.Surf Clothing and add entries for the font if the fonts section, ie:
                         <fo:block font-family="Courier" font-size="10pt" space-before.optimum="6pt" white-space-collapse="false" margin-left="6pt" text-align="start"> <font metrics-file="cyberbit.xml" kerning="yes" embed-file="C:\WINNT\Fonts\Cyberbit.ttf"> <font-triplet name="Cyberbit" style="normal" weight="normal"> </font></fo:block>
                    </fo:block>
                    <fo:block id="sec2" font-family="Helvetica" font-weight="bold" font-size="14pt" color="#0050B2" space-after.optimum="6pt" space-before.optimum="12pt"> Adding additional TrueType fonts </fo:block>
                    <fo:block space-after.optimum="6pt"> Adding Truetype fonts is almost identical to the process of adding type 1 fonts. The main difference is in the first step. </fo:block>
                    <fo:block id="sec2-1" font-family="Helvetica" font-weight="bold" space-after.optimum="6pt" space-before.optimum="12pt"> Generating a font metrics file </fo:block>
                    <fo:block space-after.optimum="6pt"> As mentioned above you need an surf file containing font metrics to be able to use an additional font. FOP contains a tool that can generate such a font metrics file from your truetype font file. </fo:block>
                    <fo:block space-after.optimum="6pt"> Create metrics for the fontfile. We'll use MS Gothic as an example:
                         <fo:block font-family="Courier" font-size="10pt" space-before.optimum="6pt" space-after.optimum="6pt" margin-left="6pt" text-align="start"> java org.apache.fop.fonts.apps.TTFReader C:\WINNT\Fonts\msgothic.ttf msgothic.xml </fo:block>
                    </fo:block>
                    <fo:block id="sec2-2" font-family="Helvetica" font-weight="bold" space-after.optimum="6pt" space-before.optimum="12pt"> TrueType collections </fo:block>
                    <fo:block space-after.optimum="6pt"> TrueType collections (.ttc files) contains more than one font. To create metrics for a ttc file you must specify the font in the collection with the -ttcname option to TTFReader. </fo:block>
                    <fo:block space-after.optimum="6pt"> To get a list of the fonts in a collection, just start the TTFReader as if it were a normal truetype file (without the -ttcname option). It will then display all the font names and exit with an Exception. </fo:block>
                    <fo:block space-after.optimum="6pt"> Example on generating metrics for a .ttc file:
                         <fo:block font-family="Courier" font-size="10pt" space-before.optimum="6pt" space-after.optimum="6pt" margin-left="6pt" text-align="start"> java org.apache.fop.fonts.apps.TTFReader -ttcname "MS Mincho" msmincho.ttc msminch.xml </fo:block>
                    </fo:block>
                    <fo:block id="sec2-3" font-family="Helvetica" font-weight="bold" space-after.optimum="6pt" space-before.optimum="12pt"> Register the fonts within FOP </fo:block>
                    <fo:block space-after.optimum="6pt"> Same as for
                         <fo:basic-link internal-destination="sec1-2" color="blue">
                              <fo:inline text-decoration="underline">Type 1 fonts</fo:inline>
                         </fo:basic-link>.
                    </fo:block>
                    <fo:block id="sec3" font-family="Helvetica" font-weight="bold" font-size="14pt" color="#0050B2" space-after.optimum="6pt" space-before.optimum="12pt"> Embedding fonts </fo:block>
                    <fo:block space-after.optimum="6pt"> Font embedding is enabled in the userconfig.Surf Clothing file. Start Fop with -c userconfig.xml </fo:block>
                    <fo:block id="sec4" font-family="Helvetica" font-weight="bold" font-size="14pt" color="#0050B2" space-after.optimum="6pt" space-before.optimum="12pt"> Example embedding MSGothic </fo:block>
                    <fo:block space-after.optimum="6pt"> This example will use the Microsoft Gothic TrueType font. This is the font used to render this examples given in the last section of this file. If you don't have it installed, you can download an installer at
                         <fo:basic-link color="blue" external-destination="ftp://ftp.cc.monash.edu.au/pub/nihongo/ie3lpkja.exe">
                              <fo:inline text-decoration="underline">ftp://ftp.cc.monash.edu.au/pub/nihongo/ie3lpkja.exe</fo:inline>
                         </fo:basic-link>.
                    </fo:block>
                    <fo:block id="sec4-1" font-family="Helvetica" font-weight="bold" space-after.optimum="6pt" space-before.optimum="12pt"> Setup your classpath to run FOP: </fo:block>
                    <fo:block font-family="Courier" font-size="10pt" space-before.optimum="6pt" white-space-collapse="false" margin-left="6pt" text-align="start"> C:\Fop-0.18.1> set CLASSPATH=fop.jar;lib\xerces-1.2.3.jar;lib\xalan-2.0.0.jar;lib\w3c.jar </fo:block>
                    <fo:block id="sec4-2" font-family="Helvetica" font-weight="bold" space-after.optimum="6pt" space-before.optimum="12pt"> Create the metrics file: </fo:block>
                    <fo:block font-family="Courier" font-size="10pt" space-before.optimum="6pt" white-space-collapse="false" margin-left="6pt" text-align="start"> C:\Fop-0.18.1> java org.apache.fop.fonts.apps.TTFReader c:\WINNT\Fonts\msgothic.ttf msgothic.xml TTF Reader v1.1.1 Reading /home/camk/cjkv/msgothic.ttf... Number of glyphs in font: 13104 Postscript format 3 Creating surf font file... Creating CID encoded metrics Writing surf font file msgothic.xml... This font contains no embedding license restrictions </fo:block>
                    <fo:block id="sec4-3" font-family="Helvetica" font-weight="bold" space-after.optimum="6pt" space-before.optimum="12pt"> Edit the msgothic.Surf Clothing file and set the
                         <fo:inline font-family="Courier">font-name</fo:inline> to "MSGothic".
                    </fo:block>
                    <fo:block id="sec4-4" font-family="Helvetica" font-weight="bold" space-after.optimum="6pt" space-before.optimum="12pt"> Edit conf/userconfig.Surf Clothing and add the following to the <fonts> section: </fo:block>
                    <fo:block font-family="Courier" font-size="10pt" space-before.optimum="6pt" white-space-collapse="false" margin-left="6pt" text-align="start"> <font metrics-file="msgothic.xml" kerning="yes" embed-file="C:\WINNT\Fonts\msgothic.ttf"> <font-triplet name="MSGothic" style="normal" weight="normal"/> </font> </fo:block>
                    <fo:block space-after.optimum="6pt"> Now you can use MSGothic in your .fo files by setting font-family="MSGothic". You'll need to start FOP specifying the config file as in this example:
                         <fo:block font-family="Courier" font-size="10pt" space-before.optimum="6pt" white-space-collapse="false" margin-left="6pt" text-align="start">java -jar fop.jar -c conf/userconfig.Surf Clothing -fo myfo.fo -pdf mypdf.pdf</fo:block>
                    </fo:block>
                    <fo:block id="sec5" font-family="Helvetica" font-weight="bold" font-size="14pt" color="#0050B2" space-after.optimum="6pt" space-before.optimum="12pt"> Examples from
                         <fo:basic-link color="blue" external-destination="http://www.csse.monash.edu.au/~jwb/j_jmdict.html">
                              <fo:inline text-decoration="underline">JMDict</fo:inline>
                         </fo:basic-link> Japanese glossary:
                    </fo:block>
               </fo:wrapper>
               <fo:table>
                    <fo:table-column column-width="50mm"/>
                    <fo:table-column column-width="50mm"/>
                    <fo:table-column column-width="50mm"/>
                    <fo:table-header>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block font-weight="bold" font-family="Helvetica">Japanese (kanji or kanadzukai)</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block font-weight="bold" font-family="Helvetica">English</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block font-weight="bold" font-family="Helvetica">German</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                    </fo:table-header>
                    <fo:table-body>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block font-family="MSGothic">うん</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>"yeah" or "uh huh"</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block/>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block font-family="MSGothic">アウタースペース</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>outer space</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block/>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block font-family="MSGothic">スペースクラフト</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>spacecraft</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block/>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block font-family="MSGothic">スペースシャトル</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>space shuttle</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block/>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block font-family="MSGothic">著わす</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>"to write", "to publish"</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>veröffentlichen</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block font-family="MSGothic">電子出版</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>electronic publishing</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block/>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block font-family="MSGothic">五輪</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>the Olympics</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>Olympische Spiele</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block font-family="MSGothic">空港</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>airport</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>Flughafen</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block font-family="MSGothic">チューリッヒ</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>Zurich</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>Zürich</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block font-family="MSGothic">コロラド</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>Colorado</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block/>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block font-family="MSGothic">コロラドスプリングス</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>Colorado Springs</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block/>
                              </fo:table-cell>
                         </fo:table-row>
                    </fo:table-body>
               </fo:table>
          </fo:flow>
     </fo:page-sequence>
</fo:root>


 

visit Quiksilver Surf Camps and Surf School and book a surf lesson.

And for the girls you can visit this site Roxy Surf Camps and Surfing School to learn more about surfing and take a class as well.

 

If you want to see a good surf contest visit this site: Billabong Pro Pipeline Masters Surfing Contest 2007. You'll be glad you did.

Billabong Pro Pipe Pipeline Masters 2007 Surf Contest This website is one that you have to see at boardshort superstore quiksilver billabong swim suit hurley roxy quicksilver volcom

 

This is a must go surfing event: Eddie Would Go Aikau Big Wave Invitational 2007 Quiksilver Surf fans from around the world will be watching this event and buying the Eddie Would Go Surf Clothing.

 

 

Check out these online surf shop websites. I like the BOARDSHORTSUPERSTORE.COM website the best but there are others. There is also the BUYBOARDSHORTS.COM website that has a good selection as well. And if you want to see a great selection of shirts, BUYSURFTEES.COM is a good site and I think each one of the websites has a great selection.