Browse Source

Imported AWT renderer from HEAD in preparation for area generation and rendering experiments.

Hacks to allow compilation.


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197440 13f79535-47bb-0310-9956-ffa450edef68
tags/Defoe_export
Peter Bernard West 20 years ago
parent
commit
65437060b5
49 changed files with 1769 additions and 1385 deletions
  1. BIN
      resources/awt_viewer/images/Print.gif
  2. BIN
      resources/awt_viewer/images/firstpg.gif
  3. BIN
      resources/awt_viewer/images/fop.gif
  4. BIN
      resources/awt_viewer/images/lastpg.gif
  5. BIN
      resources/awt_viewer/images/nextpg.gif
  6. BIN
      resources/awt_viewer/images/prevpg.gif
  7. BIN
      resources/awt_viewer/images/reload.gif
  8. 44
    0
      resources/awt_viewer/properties/Viewer.properties
  9. 34
    0
      resources/awt_viewer/properties/Viewer_cs.properties
  10. 32
    0
      resources/awt_viewer/properties/Viewer_de.properties
  11. 23
    0
      resources/awt_viewer/properties/Viewer_fi.properties
  12. 21
    0
      resources/awt_viewer/properties/Viewer_fr.properties
  13. 21
    0
      resources/awt_viewer/properties/Viewer_it.properties
  14. 28
    0
      resources/awt_viewer/properties/Viewer_ja.properties
  15. 24
    0
      resources/awt_viewer/properties/Viewer_pl.properties
  16. 43
    0
      resources/awt_viewer/properties/Viewer_ru.properties
  17. 33
    0
      resources/awt_viewer/properties/Viewer_tr.properties
  18. 20
    54
      src/codegen/font-file.xsl
  19. 122
    123
      src/codegen/org/apache/fop/datatypes/CountryLanguageScript.java
  20. 8
    10
      src/codegen/org/apache/fop/fonts/base14/Courier.java
  21. 8
    10
      src/codegen/org/apache/fop/fonts/base14/CourierBold.java
  22. 8
    10
      src/codegen/org/apache/fop/fonts/base14/CourierBoldOblique.java
  23. 8
    10
      src/codegen/org/apache/fop/fonts/base14/CourierOblique.java
  24. 8
    10
      src/codegen/org/apache/fop/fonts/base14/Helvetica.java
  25. 8
    10
      src/codegen/org/apache/fop/fonts/base14/HelveticaBold.java
  26. 8
    10
      src/codegen/org/apache/fop/fonts/base14/HelveticaBoldOblique.java
  27. 8
    10
      src/codegen/org/apache/fop/fonts/base14/HelveticaOblique.java
  28. 8
    10
      src/codegen/org/apache/fop/fonts/base14/Symbol.java
  29. 8
    10
      src/codegen/org/apache/fop/fonts/base14/TimesBold.java
  30. 8
    10
      src/codegen/org/apache/fop/fonts/base14/TimesBoldItalic.java
  31. 8
    10
      src/codegen/org/apache/fop/fonts/base14/TimesItalic.java
  32. 8
    10
      src/codegen/org/apache/fop/fonts/base14/TimesRoman.java
  33. 8
    10
      src/codegen/org/apache/fop/fonts/base14/ZapfDingbats.java
  34. 5
    117
      src/java/org/apache/fop/apps/Document.java
  35. 136
    7
      src/java/org/apache/fop/apps/Driver.java
  36. 1
    25
      src/java/org/apache/fop/apps/FOUserAgent.java
  37. 40
    24
      src/java/org/apache/fop/apps/Fop.java
  38. 246
    21
      src/java/org/apache/fop/fonts/Font.java
  39. 9
    9
      src/java/org/apache/fop/fonts/FontDescriptor.java
  40. 9
    9
      src/java/org/apache/fop/fonts/FontMetrics.java
  41. 9
    9
      src/java/org/apache/fop/fonts/FontType.java
  42. 9
    9
      src/java/org/apache/fop/fonts/Glyphs.java
  43. 492
    522
      src/java/org/apache/fop/render/AbstractRenderer.java
  44. 0
    16
      src/java/org/apache/fop/render/PrintRenderer.java
  45. 0
    37
      src/java/org/apache/fop/render/Renderer.java
  46. 3
    3
      src/java/org/apache/fop/render/awt/AWTFontMetrics.java
  47. 251
    258
      src/java/org/apache/fop/render/awt/AWTRenderer.java
  48. 1
    1
      src/java/org/apache/fop/render/awt/viewer/Command.java
  49. 1
    1
      src/java/org/apache/fop/render/awt/viewer/PreviewDialogAboutBox.java

BIN
resources/awt_viewer/images/Print.gif View File


BIN
resources/awt_viewer/images/firstpg.gif View File


BIN
resources/awt_viewer/images/fop.gif View File


BIN
resources/awt_viewer/images/lastpg.gif View File


BIN
resources/awt_viewer/images/nextpg.gif View File


BIN
resources/awt_viewer/images/prevpg.gif View File


BIN
resources/awt_viewer/images/reload.gif View File


+ 44
- 0
resources/awt_viewer/properties/Viewer.properties View File

@@ -0,0 +1,44 @@
#############################################################################
# Copyright (C) The Apache Software Foundation. All rights reserved. #
# ------------------------------------------------------------------------- #
# This software is published under the terms of the Apache Software License #
# version 1.1, a copy of which has been included with this distribution in #
# the LICENSE file. #
#############################################################################
#
# AWT viewer's GUI resources. Default bundle.
#
Menu.File=File
Menu.Exit=Exit
Menu.View=View
Menu.First.page=First page
Menu.Prev.page=Previous page
Menu.Next.page=Next page
Menu.Last.page=Last page
Menu.Go.to.Page=Go to Page
Menu.Help=Help
Menu.Default.zoom=Default zoom
Menu.About=About
Menu.Print=Print
Menu.Zoom=Zoom
Menu.Reload=Reload

Title.Preview=Preview

Status.Show=Show
Status.Page=Page
Status.of=of
Status.Build.FO.tree=Generating document...

Exception.Occured=An exception has occured
Exception.Error=Fatal error

Label.Page.number=Page number
Button.Ok=Ok
Button.Cancel=Cancel

About.Product=FOP AWT Viewer
About.Version=Version:
About.Copyright=See http://xml.apache.org/fop
About.Title=About


+ 34
- 0
resources/awt_viewer/properties/Viewer_cs.properties View File

@@ -0,0 +1,34 @@
#############################################################################
# Copyright (C) The Apache Software Foundation. All rights reserved. #
# ------------------------------------------------------------------------- #
# This software is published under the terms of the Apache Software License #
# version 1.1, a copy of which has been included with this distribution in #
# the LICENSE file. #
#############################################################################
#
# AWT viewer's GUI resources. Czech bundle.
#
Menu.File=Soubor
Menu.Print=Tisk
Menu.Exit=Konec
Menu.View=Zobrazit
Menu.First.page=Prvn\u00ed strana
Menu.Prev.page=P\u0159edchoz\u00ed strana
Menu.Next.page=Dal\u0161\u00ed strana
Menu.Last.page=Posledn\u00ed strana
Menu.Zoom=Lupa
Menu.Default.zoom=Standardn\u00ed lupa
Menu.Help=N\u00e1pov\u011bda
Menu.About=O aplikaci
Menu.Reload=Obnovit
Menu.Go.to.Page=Jdi na stranu

Title.Preview=N\u00e1hled

Status.Show=Zobrazen\u00ed
Status.Page=Strana
Status.of=z
Status.Build.FO.tree=Vytv\u00e1\u0159\u00edm strom FO...

Label.Page.number=Strana \u010d\u00edslo
Button.Cancel=Zru\u0161it

+ 32
- 0
resources/awt_viewer/properties/Viewer_de.properties View File

@@ -0,0 +1,32 @@
#############################################################################
# Copyright (C) The Apache Software Foundation. All rights reserved. #
# ------------------------------------------------------------------------- #
# This software is published under the terms of the Apache Software License #
# version 1.1, a copy of which has been included with this distribution in #
# the LICENSE file. #
#############################################################################
#
# AWT viewer's GUI resources. German bundle.
#
Menu.File=Datei
Menu.Exit=Beenden
Menu.View=Anzeige
Menu.First.page=Erste Seite
Menu.Prev.page=Vorherige Seite
Menu.Next.page=N\u00e4chste Seite
Menu.Last.page=Letzte Seite
Menu.Help=Hilfe
Menu.Default.zoom=Standardzoom
Menu.About=\u00dcber
Menu.Print=Drucken
Menu.Go.to.Page=Gehe zur Seite

Title.Preview=Vorschau

Status.Show=Anzeigen
Status.Page=Seite
Status.of=von
Status.Build.FO.tree=Baue FO-Baum

Button.Cancel=Abbrechen
Label.Page.number=Seitennummer

+ 23
- 0
resources/awt_viewer/properties/Viewer_fi.properties View File

@@ -0,0 +1,23 @@
#############################################################################
# Copyright (C) The Apache Software Foundation. All rights reserved. #
# ------------------------------------------------------------------------- #
# This software is published under the terms of the Apache Software License #
# version 1.1, a copy of which has been included with this distribution in #
# the LICENSE file. #
#############################################################################
#
# AWT viewer's GUI resources. Finnish bundle.
#
Menu.File=Tiedosto
Menu.Print=Tulosta
Menu.Exit=Poistu
Menu.View=N\u00e4yt\u00e4
Menu.First.page=Ensimm\u00e4inen sivu
Menu.Prev.page=Edellinen sivu
Menu.Next.page=Seuraava sivu
Menu.Last.page=Viimeinen sivu
Menu.Default.zoom=Normaali zoom
Menu.Help=Ohje
Menu.About=Tietoja

Status.Page=Sivu

+ 21
- 0
resources/awt_viewer/properties/Viewer_fr.properties View File

@@ -0,0 +1,21 @@
#############################################################################
# Copyright (C) The Apache Software Foundation. All rights reserved. #
# ------------------------------------------------------------------------- #
# This software is published under the terms of the Apache Software License #
# version 1.1, a copy of which has been included with this distribution in #
# the LICENSE file. #
#############################################################################
#
# AWT viewer's GUI resources. French bundle.
#
Menu.File=Fichier
Menu.Print=Imprimer
Menu.Exit=Quitter
Menu.View=Affichage
Menu.First.page=Premi\u00e8re page
Menu.Prev.page=Page pr\u00e9c\u00e9dente
Menu.Next.page=Page suivante
Menu.Last.page=Derni\u00e8re page
Menu.Help=Aide
Menu.Default.zoom=Zoom par d\u00e9faut
Menu.About=A propos

+ 21
- 0
resources/awt_viewer/properties/Viewer_it.properties View File

@@ -0,0 +1,21 @@
#############################################################################
# Copyright (C) The Apache Software Foundation. All rights reserved. #
# ------------------------------------------------------------------------- #
# This software is published under the terms of the Apache Software License #
# version 1.1, a copy of which has been included with this distribution in #
# the LICENSE file. #
#############################################################################
#
# AWT viewer's GUI resources. Italian bundle.
#
Menu.File=File
Menu.Exit=Esci
Menu.View=Vista
Menu.First.page=Prima pagina
Menu.Prev.page=Pagina precedente
Menu.Next.page=Pagina seguente
Menu.Last.page=Ultima pagina
Menu.Help=Aiuto
Menu.Default.zoom=Zoom di default
Menu.About=Riguardo a...
Menu.Print=Stampa

+ 28
- 0
resources/awt_viewer/properties/Viewer_ja.properties View File

@@ -0,0 +1,28 @@
#############################################################################
# Copyright (C) The Apache Software Foundation. All rights reserved. #
# ------------------------------------------------------------------------- #
# This software is published under the terms of the Apache Software License #
# version 1.1, a copy of which has been included with this distribution in #
# the LICENSE file. #
#############################################################################
#
# AWT viewer's GUI resources. Japanese bundle.
#
Menu.File=\u30d5\u30a1\u30a4\u30eb
Menu.Print=\u5370\u5237
Menu.Exit=\u7d42\u4e86
Menu.View=\u8868\u793a
Menu.First.page=\u958b\u59cb\u30da\u30fc\u30b8
Menu.Prev.page=\u524d\u30da\u30fc\u30b8
Menu.Next.page=\u6b21\u30da\u30fc\u30b8
Menu.Last.page=\u6700\u7d42\u30da\u30fc\u30b8
Menu.Go.to.Page=\u30da\u30fc\u30b8\u6307\u5b9a
Menu.Zoom=\u30ba\u30fc\u30e0
Menu.Default.zoom=\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30ba\u30fc\u30e0
Menu.Help=\u30d8\u30eb\u30d7
Menu.About=\u30d0\u30fc\u30b8\u30e7\u30f3\u60c5\u5831

Status.Page=\u30da\u30fc\u30b8
Status.of=/
Status.Build.FO.tree=FO\u30c4\u30ea\u30fc\u69cb\u7bc9\u4e2d
Status.Show=\u5b8c\u4e86

+ 24
- 0
resources/awt_viewer/properties/Viewer_pl.properties View File

@@ -0,0 +1,24 @@
#############################################################################
# Copyright (C) The Apache Software Foundation. All rights reserved. #
# ------------------------------------------------------------------------- #
# This software is published under the terms of the Apache Software License #
# version 1.1, a copy of which has been included with this distribution in #
# the LICENSE file. #
#############################################################################
#
# AWT viewer's GUI resources. Polish bundle.
#
Menu.File=Plik
Menu.Print=Drukuj
Menu.Exit=Zako\u00f1cz
Menu.View=Widok
Menu.First.page=Pierwsza strona
Menu.Prev.page=Poprzednia strona
Menu.Next.page=Nast\u00eapna strona
Menu.Last.page=Ostatnia strona
Menu.Zoom=Powi\u00eakszenie
Menu.Default.zoom=Domy\u00b6lne powiekszenie
Menu.Help=Pomoc
Menu.About=O programie

Status.Page=Strona

+ 43
- 0
resources/awt_viewer/properties/Viewer_ru.properties View File

@@ -0,0 +1,43 @@
#############################################################################
# Copyright (C) The Apache Software Foundation. All rights reserved. #
# ------------------------------------------------------------------------- #
# This software is published under the terms of the Apache Software License #
# version 1.1, a copy of which has been included with this distribution in #
# the LICENSE file. #
#############################################################################
#
# AWT viewer's GUI resources. Russain bundle.
#
Menu.File=\u0424\u0430\u0439\u043b
Menu.Exit=\u0412\u044b\u0445\u043e\u0434
Menu.View=\u0412\u0438\u0434
Menu.First.page=\u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430
Menu.Prev.page=\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430
Menu.Next.page=\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430
Menu.Last.page=\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430
Menu.Go.to.Page=\u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435
Menu.Help=\u041f\u043e\u043c\u043e\u0449\u044c
Menu.Default.zoom=\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440
Menu.About=\u041e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0435
Menu.Print=\u041f\u0435\u0447\u0430\u0442\u044c
Menu.Zoom=\u0420\u0430\u0437\u043c\u0435\u0440
Menu.Reload=\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c

Title.Preview=\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440

Status.Show=\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435
Status.Page=\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430
Status.of=\u0438\u0437
Status.Build.FO.tree=\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 FO \u0434\u0435\u0440\u0435\u0432\u0430...

Exception.Occured=\u041f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430
Exception.Error=\u041a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430

Label.Page.number=\u041d\u043e\u043c\u0435\u0440 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b
Button.Ok=Ok
Button.Cancel=\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c

About.Product=FOP AWT Viewer
About.Version=\u0412\u0435\u0440\u0441\u0438\u044f:
About.Copyright=\u0421\u043c\u043e\u0442\u0440\u0438 http://xml.apache.org/fop
About.Title=\u041e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0435

+ 33
- 0
resources/awt_viewer/properties/Viewer_tr.properties View File

@@ -0,0 +1,33 @@
#############################################################################
# Copyright (C) The Apache Software Foundation. All rights reserved. #
# ------------------------------------------------------------------------- #
# This software is published under the terms of the Apache Software License #
# version 1.1, a copy of which has been included with this distribution in #
# the LICENSE file. #
#############################################################################
#
# AWT viewer's GUI resources. Turkish bundle.
#
Menu.File=Dosya
Menu.Exit=\u00c7\u0131k\u0131\u015f
Menu.View=\u0130zle
Menu.First.page=\u0130lk Sayfa
Menu.Prev.page=\u00d6nceki Sayfa
Menu.Next.page=Sonraki Sayfa
Menu.Last.page=Son Sayfa
Menu.Go.to.Page=Sayfaya Git
Menu.Help=Yard\u0131m
Menu.Default.zoom=Standart zum
Menu.About=Hakk\u0131nda
Menu.Print=Yazd\u0131r

Title.Preview=\u00d6nizleme

Status.Show=G\u00f6ster
Status.Page=Sayfa
Status.of=
Status.Build.FO.tree=FO a\u011fac\u0131n\u0131 yarat

Label.Page.number=Sayfa numaras\u0131
Button.Cancel=Vazge\u00e7


+ 20
- 54
src/codegen/font-file.xsl View File

@@ -4,53 +4,19 @@
<!-- $Id$ -->
<xsl:variable name="licence"><![CDATA[/*
* $Id]]><![CDATA[$
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
*
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
*
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
* DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
*
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
@@ -77,10 +43,10 @@
package org.apache.fop.fonts.base14;

import org.apache.fop.fonts.FontType;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.Typeface;
import org.apache.fop.fonts.CodePointMapping;

public class <xsl:value-of select="class-name"/> extends Font {
public class <xsl:value-of select="class-name"/> extends Typeface {
private final static String fontName = "<xsl:value-of select="font-name"/>";
private final static String encoding = <xsl:choose><xsl:when test="$encoding != $native-encoding">"<xsl:value-of select="$encoding"/>"</xsl:when><xsl:otherwise>null</xsl:otherwise></xsl:choose>;
private final static int capHeight = <xsl:value-of select="cap-height"/>;
@@ -103,9 +69,9 @@ public class <xsl:value-of select="class-name"/> extends Font {
}

public String getFontName() {
return fontName;
return fontName;
}
public FontType getFontType() {
return FontType.TYPE1;
}
@@ -144,15 +110,15 @@ public class <xsl:value-of select="class-name"/> extends Font {
//for( int i = 0; i &lt; arr.length; i++) arr[i] *= size;
return arr;
}
public boolean hasKerningInfo() {
return false;
}
public java.util.Map getKerningInfo() {
return java.util.Collections.EMPTY_MAP;
}
public char mapChar(char c) {
char d = mapping.mapChar(c);
if(d != 0) {

+ 122
- 123
src/codegen/org/apache/fop/datatypes/CountryLanguageScript.java View File

@@ -1,20 +1,19 @@
/*
* $Id$
*
* Copyright 1999-2003 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*

Copyright 1999-2003 The Apache Software Foundation.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated from xml-lang.xml by
@@ -613,7 +612,7 @@ public class CountryLanguageScript {
// Aleut
iso639_2T_ToENLang.put("ale", "Aleut");
iso639_2T_ToFRLang.put("ale", "al�oute");
iso639_2T_ToFRLang.put("ale", "aléoute");
// Algonquian languages
iso639_2T_ToENLang.put("alg", "Algonquian languages");
@@ -641,11 +640,11 @@ public class CountryLanguageScript {
// Aramaic
iso639_2T_ToENLang.put("arc", "Aramaic");
iso639_2T_ToFRLang.put("arc", "aram�en");
iso639_2T_ToFRLang.put("arc", "araméen");
// Armenian
iso639_2T_ToENLang.put("hye", "Armenian");
iso639_2T_ToFRLang.put("hye", "arm�nien");
iso639_2T_ToFRLang.put("hye", "arménien");
iso639_2B_To_639_2T.put("arm", "hye");
@@ -707,7 +706,7 @@ public class CountryLanguageScript {
// Azerbaijani
iso639_2T_ToENLang.put("aze", "Azerbaijani");
iso639_2T_ToFRLang.put("aze", "az�ri");
iso639_2T_ToFRLang.put("aze", "azéri");
iso639_1_To_639_2T.put("az", "aze");
@@ -717,7 +716,7 @@ public class CountryLanguageScript {
// Bamileke languages
iso639_2T_ToENLang.put("bai", "Bamileke languages");
iso639_2T_ToFRLang.put("bai", "bamil�k�s, langues");
iso639_2T_ToFRLang.put("bai", "bamilékés, langues");
// Bashkir
iso639_2T_ToENLang.put("bak", "Bashkir");
@@ -759,7 +758,7 @@ public class CountryLanguageScript {
// Belarusian
iso639_2T_ToENLang.put("bel", "Belarusian");
iso639_2T_ToFRLang.put("bel", "bi�lorusse");
iso639_2T_ToFRLang.put("bel", "biélorusse");
iso639_1_To_639_2T.put("be", "bel");
@@ -775,7 +774,7 @@ public class CountryLanguageScript {
// Berber (Other)
iso639_2T_ToENLang.put("ber", "Berber (Other)");
iso639_2T_ToFRLang.put("ber", "berb�res, autres langues");
iso639_2T_ToFRLang.put("ber", "berbères, autres langues");
// Bhojpuri
iso639_2T_ToENLang.put("bho", "Bhojpuri");
@@ -811,7 +810,7 @@ public class CountryLanguageScript {
// Tibetan
iso639_2T_ToENLang.put("bod", "Tibetan");
iso639_2T_ToFRLang.put("bod", "tib�tain");
iso639_2T_ToFRLang.put("bod", "tibétain");
iso639_2B_To_639_2T.put("tib", "bod");
@@ -835,7 +834,7 @@ public class CountryLanguageScript {
// Batak (Indonesia)
iso639_2T_ToENLang.put("btk", "Batak (Indonesia)");
iso639_2T_ToFRLang.put("btk", "batak (Indon�sie)");
iso639_2T_ToFRLang.put("btk", "batak (Indonésie)");
// Buriat
iso639_2T_ToENLang.put("bua", "Buriat");
@@ -865,7 +864,7 @@ public class CountryLanguageScript {
// Central American Indian (Other)
iso639_2T_ToENLang.put("cai", "Central American Indian (Other)");
iso639_2T_ToFRLang.put("cai", "indiennes d'Am�rique centrale, autres langues");
iso639_2T_ToFRLang.put("cai", "indiennes d'Amérique centrale, autres langues");
// Carib
iso639_2T_ToENLang.put("car", "Carib");
@@ -891,7 +890,7 @@ public class CountryLanguageScript {
// Czech
iso639_2T_ToENLang.put("ces", "Czech");
iso639_2T_ToFRLang.put("ces", "tch�que");
iso639_2T_ToFRLang.put("ces", "tchèque");
iso639_2B_To_639_2T.put("cze", "ces");
@@ -909,13 +908,13 @@ public class CountryLanguageScript {
// Chechen
iso639_2T_ToENLang.put("che", "Chechen ");
iso639_2T_ToFRLang.put("che", "tch�tch�ne");
iso639_2T_ToFRLang.put("che", "tchétchène");
iso639_1_To_639_2T.put("ce", "che");
// Chagatai
iso639_2T_ToENLang.put("chg", "Chagatai");
iso639_2T_ToFRLang.put("chg", "djaghata�");
iso639_2T_ToFRLang.put("chg", "djaghataï");
// Chinese
iso639_2T_ToENLang.put("zho", "Chinese");
@@ -951,7 +950,7 @@ public class CountryLanguageScript {
// Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic
iso639_2T_ToENLang.put("chu", "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic");
iso639_2T_ToFRLang.put("chu", "slavon d'�glise; vieux slave; slavon liturgique; vieux bulgare");
iso639_2T_ToFRLang.put("chu", "slavon d'église; vieux slave; slavon liturgique; vieux bulgare");
iso639_1_To_639_2T.put("cu", "chu");
@@ -987,15 +986,15 @@ public class CountryLanguageScript {
// Creoles and pidgins, English based (Other)
iso639_2T_ToENLang.put("cpe", "Creoles and pidgins, English based (Other)");
iso639_2T_ToFRLang.put("cpe", "cr�oles et pidgins anglais, autres");
iso639_2T_ToFRLang.put("cpe", "créoles et pidgins anglais, autres");
// Creoles and pidgins, French-based (Other)
iso639_2T_ToENLang.put("cpf", "Creoles and pidgins, French-based (Other)");
iso639_2T_ToFRLang.put("cpf", "cr�oles et pidgins fran�ais, autres");
iso639_2T_ToFRLang.put("cpf", "créoles et pidgins français, autres");
// Creoles and pidgins, Portuguese-based (Other)
iso639_2T_ToENLang.put("cpp", "Creoles and pidgins, Portuguese-based (Other)");
iso639_2T_ToFRLang.put("cpp", "cr�oles et pidgins portugais, autres");
iso639_2T_ToFRLang.put("cpp", "créoles et pidgins portugais, autres");
// Cree
iso639_2T_ToENLang.put("cre", "Cree");
@@ -1003,7 +1002,7 @@ public class CountryLanguageScript {
// Creoles and pidgins (Other)
iso639_2T_ToENLang.put("crp", "Creoles and pidgins (Other)");
iso639_2T_ToFRLang.put("crp", "cr�oles et pidgins divers");
iso639_2T_ToFRLang.put("crp", "créoles et pidgins divers");
// Cushitic (Other)
iso639_2T_ToENLang.put("cus", "Cushitic (Other)");
@@ -1019,7 +1018,7 @@ public class CountryLanguageScript {
// Czech
iso639_2T_ToENLang.put("ces", "Czech");
iso639_2T_ToFRLang.put("ces", "tch�que");
iso639_2T_ToFRLang.put("ces", "tchèque");
iso639_2B_To_639_2T.put("cze", "ces");
@@ -1081,11 +1080,11 @@ public class CountryLanguageScript {
// Dutch, Middle (ca.1050-1350)
iso639_2T_ToENLang.put("dum", "Dutch, Middle (ca.1050-1350)");
iso639_2T_ToFRLang.put("dum", "n�erlandais moyen (ca. 1050-1350)");
iso639_2T_ToFRLang.put("dum", "néerlandais moyen (ca. 1050-1350)");
// Dutch
iso639_2T_ToENLang.put("nld", "Dutch");
iso639_2T_ToFRLang.put("nld", "n�erlandais");
iso639_2T_ToFRLang.put("nld", "néerlandais");
iso639_2B_To_639_2T.put("dut", "nld");
@@ -1107,7 +1106,7 @@ public class CountryLanguageScript {
// Egyptian (Ancient)
iso639_2T_ToENLang.put("egy", "Egyptian (Ancient)");
iso639_2T_ToFRLang.put("egy", "�gyptien");
iso639_2T_ToFRLang.put("egy", "égyptien");
// Ekajuk
iso639_2T_ToENLang.put("eka", "Ekajuk");
@@ -1115,7 +1114,7 @@ public class CountryLanguageScript {
// Greek, Modern (1453-)
iso639_2T_ToENLang.put("ell", "Greek, Modern (1453-)");
iso639_2T_ToFRLang.put("ell", "grec moderne (apr�s 1453)");
iso639_2T_ToFRLang.put("ell", "grec moderne (après 1453)");
iso639_2B_To_639_2T.put("gre", "ell");
@@ -1123,7 +1122,7 @@ public class CountryLanguageScript {
// Elamite
iso639_2T_ToENLang.put("elx", "Elamite");
iso639_2T_ToFRLang.put("elx", "�lamite");
iso639_2T_ToFRLang.put("elx", "élamite");
// English
iso639_2T_ToENLang.put("eng", "English");
@@ -1137,7 +1136,7 @@ public class CountryLanguageScript {
// Esperanto
iso639_2T_ToENLang.put("epo", "Esperanto");
iso639_2T_ToFRLang.put("epo", "esp�ranto");
iso639_2T_ToFRLang.put("epo", "espéranto");
iso639_1_To_639_2T.put("eo", "epo");
@@ -1157,11 +1156,11 @@ public class CountryLanguageScript {
// Ewe
iso639_2T_ToENLang.put("ewe", "Ewe");
iso639_2T_ToFRLang.put("ewe", "�w�");
iso639_2T_ToFRLang.put("ewe", "éwé");
// Ewondo
iso639_2T_ToENLang.put("ewo", "Ewondo");
iso639_2T_ToFRLang.put("ewo", "�wondo");
iso639_2T_ToFRLang.put("ewo", "éwondo");
// Fang
iso639_2T_ToENLang.put("fan", "Fang");
@@ -1169,7 +1168,7 @@ public class CountryLanguageScript {
// Faroese
iso639_2T_ToENLang.put("fao", "Faroese");
iso639_2T_ToFRLang.put("fao", "f�ro�en");
iso639_2T_ToFRLang.put("fao", "féroïen");
iso639_1_To_639_2T.put("fo", "fao");
@@ -1207,7 +1206,7 @@ public class CountryLanguageScript {
// French
iso639_2T_ToENLang.put("fra", "French");
iso639_2T_ToFRLang.put("fra", "fran�ais");
iso639_2T_ToFRLang.put("fra", "français");
iso639_2B_To_639_2T.put("fre", "fra");
@@ -1215,11 +1214,11 @@ public class CountryLanguageScript {
// French, Middle (ca.1400-1800)
iso639_2T_ToENLang.put("frm", "French, Middle (ca.1400-1800)");
iso639_2T_ToFRLang.put("frm", "fran�ais moyen (1400-1800)");
iso639_2T_ToFRLang.put("frm", "français moyen (1400-1800)");
// French, Old (842-ca.1400)
iso639_2T_ToENLang.put("fro", "French, Old (842-ca.1400)");
iso639_2T_ToFRLang.put("fro", "fran�ais ancien (842-ca.1400)");
iso639_2T_ToFRLang.put("fro", "français ancien (842-ca.1400)");
// Frisian
iso639_2T_ToENLang.put("fry", "Frisian");
@@ -1253,7 +1252,7 @@ public class CountryLanguageScript {
// Georgian
iso639_2T_ToENLang.put("kat", "Georgian");
iso639_2T_ToFRLang.put("kat", "g�orgien");
iso639_2T_ToFRLang.put("kat", "géorgien");
iso639_2B_To_639_2T.put("geo", "kat");
@@ -1269,7 +1268,7 @@ public class CountryLanguageScript {
// Geez
iso639_2T_ToENLang.put("gez", "Geez");
iso639_2T_ToFRLang.put("gez", "gu�ze");
iso639_2T_ToFRLang.put("gez", "guèze");
// Gilbertese
iso639_2T_ToENLang.put("gil", "Gilbertese");
@@ -1277,7 +1276,7 @@ public class CountryLanguageScript {
// Gaelic; Scottish Gaelic
iso639_2T_ToENLang.put("gla", "Gaelic; Scottish Gaelic");
iso639_2T_ToFRLang.put("gla", "ga�lique; ga�lique �cossais");
iso639_2T_ToFRLang.put("gla", "gaélique; gaélique écossais");
iso639_1_To_639_2T.put("gd", "gla");
@@ -1325,11 +1324,11 @@ public class CountryLanguageScript {
// Greek, Ancient (to 1453)
iso639_2T_ToENLang.put("grc", "Greek, Ancient (to 1453)");
iso639_2T_ToFRLang.put("grc", "grec ancien (jusqu'� 1453)");
iso639_2T_ToFRLang.put("grc", "grec ancien (jusqu'à 1453)");
// Greek, Modern (1453-)
iso639_2T_ToENLang.put("ell", "Greek, Modern (1453-)");
iso639_2T_ToFRLang.put("ell", "grec moderne (apr�s 1453)");
iso639_2T_ToFRLang.put("ell", "grec moderne (après 1453)");
iso639_2B_To_639_2T.put("gre", "ell");
@@ -1347,9 +1346,9 @@ public class CountryLanguageScript {
iso639_1_To_639_2T.put("gu", "guj");
// Gwich�in
iso639_2T_ToENLang.put("gwi", "Gwich�in");
iso639_2T_ToFRLang.put("gwi", "gwich�in");
// Gwich´in
iso639_2T_ToENLang.put("gwi", "Gwich´in");
iso639_2T_ToFRLang.put("gwi", "gwich´in");
// Haida
iso639_2T_ToENLang.put("hai", "Haida");
@@ -1363,11 +1362,11 @@ public class CountryLanguageScript {
// Hawaiian
iso639_2T_ToENLang.put("haw", "Hawaiian");
iso639_2T_ToFRLang.put("haw", "hawa�en");
iso639_2T_ToFRLang.put("haw", "hawaïen");
// Hebrew
iso639_2T_ToENLang.put("heb", "Hebrew");
iso639_2T_ToFRLang.put("heb", "h�breu");
iso639_2T_ToFRLang.put("heb", "hébreu");
iso639_1_To_639_2T.put("he", "heb");
@@ -1425,7 +1424,7 @@ public class CountryLanguageScript {
// Armenian
iso639_2T_ToENLang.put("hye", "Armenian");
iso639_2T_ToFRLang.put("hye", "arm�nien");
iso639_2T_ToFRLang.put("hye", "arménien");
iso639_2B_To_639_2T.put("arm", "hye");
@@ -1485,13 +1484,13 @@ public class CountryLanguageScript {
// Indonesian
iso639_2T_ToENLang.put("ind", "Indonesian");
iso639_2T_ToFRLang.put("ind", "indon�sien");
iso639_2T_ToFRLang.put("ind", "indonésien");
iso639_1_To_639_2T.put("id", "ind");
// Indo-European (Other)
iso639_2T_ToENLang.put("ine", "Indo-European (Other)");
iso639_2T_ToFRLang.put("ine", "indo-europ�ennes, autres langues");
iso639_2T_ToFRLang.put("ine", "indo-européennes, autres langues");
// Inupiaq
iso639_2T_ToENLang.put("ipk", "Inupiaq");
@@ -1535,11 +1534,11 @@ public class CountryLanguageScript {
// Judeo-Persian
iso639_2T_ToENLang.put("jpr", "Judeo-Persian");
iso639_2T_ToFRLang.put("jpr", "jud�o-persan");
iso639_2T_ToFRLang.put("jpr", "judéo-persan");
// Judeo-Arabic
iso639_2T_ToENLang.put("jrb", "Judeo-Arabic");
iso639_2T_ToFRLang.put("jrb", "jud�o-arabe");
iso639_2T_ToFRLang.put("jrb", "judéo-arabe");
// Kara-Kalpak
iso639_2T_ToENLang.put("kaa", "Kara-Kalpak");
@@ -1581,7 +1580,7 @@ public class CountryLanguageScript {
// Georgian
iso639_2T_ToENLang.put("kat", "Georgian");
iso639_2T_ToFRLang.put("kat", "g�orgien");
iso639_2T_ToFRLang.put("kat", "géorgien");
iso639_2B_To_639_2T.put("geo", "kat");
@@ -1657,7 +1656,7 @@ public class CountryLanguageScript {
// Korean
iso639_2T_ToENLang.put("kor", "Korean");
iso639_2T_ToFRLang.put("kor", "cor�en");
iso639_2T_ToFRLang.put("kor", "coréen");
iso639_1_To_639_2T.put("ko", "kor");
@@ -1667,7 +1666,7 @@ public class CountryLanguageScript {
// Kpelle
iso639_2T_ToENLang.put("kpe", "Kpelle");
iso639_2T_ToFRLang.put("kpe", "kpell�");
iso639_2T_ToFRLang.put("kpe", "kpellé");
// Kru
iso639_2T_ToENLang.put("kro", "Kru");
@@ -1699,7 +1698,7 @@ public class CountryLanguageScript {
// Ladino
iso639_2T_ToENLang.put("lad", "Ladino");
iso639_2T_ToFRLang.put("lad", "jud�o-espagnol");
iso639_2T_ToFRLang.put("lad", "judéo-espagnol");
// Lahnda
iso639_2T_ToENLang.put("lah", "Lahnda");
@@ -1793,7 +1792,7 @@ public class CountryLanguageScript {
// Macedonian
iso639_2T_ToENLang.put("mkd", "Macedonian");
iso639_2T_ToFRLang.put("mkd", "mac�donien");
iso639_2T_ToFRLang.put("mkd", "macédonien");
iso639_2B_To_639_2T.put("mac", "mkd");
@@ -1841,7 +1840,7 @@ public class CountryLanguageScript {
// Austronesian (Other)
iso639_2T_ToENLang.put("map", "Austronesian (Other)");
iso639_2T_ToFRLang.put("map", "malayo-polyn�siennes,autres langues");
iso639_2T_ToFRLang.put("map", "malayo-polynésiennes,autres langues");
// Marathi
iso639_2T_ToENLang.put("mar", "Marathi");
@@ -1851,7 +1850,7 @@ public class CountryLanguageScript {
// Masai
iso639_2T_ToENLang.put("mas", "Masai");
iso639_2T_ToFRLang.put("mas", "massa�");
iso639_2T_ToFRLang.put("mas", "massaï");
// Malay
iso639_2T_ToENLang.put("msa", "Malay");
@@ -1867,7 +1866,7 @@ public class CountryLanguageScript {
// Mende
iso639_2T_ToENLang.put("men", "Mende");
iso639_2T_ToFRLang.put("men", "mend�");
iso639_2T_ToFRLang.put("men", "mendé");
// Irish, Middle (900-1200)
iso639_2T_ToENLang.put("mga", "Irish, Middle (900-1200)");
@@ -1887,7 +1886,7 @@ public class CountryLanguageScript {
// Macedonian
iso639_2T_ToENLang.put("mkd", "Macedonian");
iso639_2T_ToFRLang.put("mkd", "mac�donien");
iso639_2T_ToFRLang.put("mkd", "macédonien");
iso639_2B_To_639_2T.put("mac", "mkd");
@@ -1895,7 +1894,7 @@ public class CountryLanguageScript {
// Mon-Khmer (Other)
iso639_2T_ToENLang.put("mkh", "Mon-Khmer (Other)");
iso639_2T_ToFRLang.put("mkh", "m�n-khmer, autres langues");
iso639_2T_ToFRLang.put("mkh", "môn-khmer, autres langues");
// Malagasy
iso639_2T_ToENLang.put("mlg", "Malagasy");
@@ -1939,7 +1938,7 @@ public class CountryLanguageScript {
// Mossi
iso639_2T_ToENLang.put("mos", "Mossi");
iso639_2T_ToFRLang.put("mos", "mor�");
iso639_2T_ToFRLang.put("mos", "moré");
// Maori
iso639_2T_ToENLang.put("mri", "Maori");
@@ -1991,7 +1990,7 @@ public class CountryLanguageScript {
// North American Indian
iso639_2T_ToENLang.put("nai", "North American Indian");
iso639_2T_ToFRLang.put("nai", "indiennes d'Am�rique du Nord, autres langues");
iso639_2T_ToFRLang.put("nai", "indiennes d'Amérique du Nord, autres langues");
// Neapolitan
iso639_2T_ToENLang.put("nap", "Neapolitan");
@@ -2011,13 +2010,13 @@ public class CountryLanguageScript {
// Ndebele, South; South Ndebele
iso639_2T_ToENLang.put("nbl", "Ndebele, South; South Ndebele");
iso639_2T_ToFRLang.put("nbl", "nd�b�l� du Sud");
iso639_2T_ToFRLang.put("nbl", "ndébélé du Sud");
iso639_1_To_639_2T.put("nr", "nbl");
// Ndebele, North; North Ndebele
iso639_2T_ToENLang.put("nde", "Ndebele, North; North Ndebele");
iso639_2T_ToFRLang.put("nde", "nd�b�l� du Nord");
iso639_2T_ToFRLang.put("nde", "ndébélé du Nord");
iso639_1_To_639_2T.put("nd", "nde");
@@ -2033,7 +2032,7 @@ public class CountryLanguageScript {
// Nepali
iso639_2T_ToENLang.put("nep", "Nepali");
iso639_2T_ToFRLang.put("nep", "n�palais");
iso639_2T_ToFRLang.put("nep", "népalais");
iso639_1_To_639_2T.put("ne", "nep");
@@ -2047,15 +2046,15 @@ public class CountryLanguageScript {
// Niger-Kordofanian (Other)
iso639_2T_ToENLang.put("nic", "Niger-Kordofanian (Other)");
iso639_2T_ToFRLang.put("nic", "nig�ro-congolaises, autres langues");
iso639_2T_ToFRLang.put("nic", "nigéro-congolaises, autres langues");
// Niuean
iso639_2T_ToENLang.put("niu", "Niuean");
iso639_2T_ToFRLang.put("niu", "niu�");
iso639_2T_ToFRLang.put("niu", "niué");
// Dutch
iso639_2T_ToENLang.put("nld", "Dutch");
iso639_2T_ToFRLang.put("nld", "n�erlandais");
iso639_2T_ToFRLang.put("nld", "néerlandais");
iso639_2B_To_639_2T.put("dut", "nld");
@@ -2067,19 +2066,19 @@ public class CountryLanguageScript {
// Norwegian
iso639_2T_ToENLang.put("nor", "Norwegian");
iso639_2T_ToFRLang.put("nor", "norv�gien");
iso639_2T_ToFRLang.put("nor", "norvégien");
iso639_1_To_639_2T.put("no", "nor");
// Norwegian Nynorsk; Nynorsk, Norwegian
iso639_2T_ToENLang.put("nno", "Norwegian Nynorsk; Nynorsk, Norwegian");
iso639_2T_ToFRLang.put("nno", "norv�gien nynorsk; nynorsk, norv�gien ");
iso639_2T_ToFRLang.put("nno", "norvégien nynorsk; nynorsk, norvégien ");
iso639_1_To_639_2T.put("nn", "nno");
// Norwegian Bokm�l; Bokm�l, Norwegian
iso639_2T_ToENLang.put("nob", "Norwegian Bokm�l; Bokm�l, Norwegian");
iso639_2T_ToFRLang.put("nob", "norv�gien bokm�l; bokm�l, norv�gien");
// Norwegian Bokmål; Bokmål, Norwegian
iso639_2T_ToENLang.put("nob", "Norwegian Bokmål; Bokmål, Norwegian");
iso639_2T_ToFRLang.put("nob", "norvégien bokmål; bokmål, norvégien");
iso639_1_To_639_2T.put("nb", "nob");
@@ -2103,7 +2102,7 @@ public class CountryLanguageScript {
// Nyankole
iso639_2T_ToENLang.put("nyn", "Nyankole");
iso639_2T_ToFRLang.put("nyn", "nyankol�");
iso639_2T_ToFRLang.put("nyn", "nyankolé");
// Nyoro
iso639_2T_ToENLang.put("nyo", "Nyoro");
@@ -2113,9 +2112,9 @@ public class CountryLanguageScript {
iso639_2T_ToENLang.put("nzi", "Nzima");
iso639_2T_ToFRLang.put("nzi", "nzema");
// Occitan (post 1500); Proven�al
iso639_2T_ToENLang.put("oci", "Occitan (post 1500); Proven�al");
iso639_2T_ToFRLang.put("oci", "occitan (apr�s 1500); proven�al");
// Occitan (post 1500); Provençal
iso639_2T_ToENLang.put("oci", "Occitan (post 1500); Provençal");
iso639_2T_ToFRLang.put("oci", "occitan (après 1500); provençal");
iso639_1_To_639_2T.put("oc", "oci");
@@ -2141,7 +2140,7 @@ public class CountryLanguageScript {
// Ossetian; Ossetic
iso639_2T_ToENLang.put("oss", "Ossetian; Ossetic");
iso639_2T_ToFRLang.put("oss", "oss�te");
iso639_2T_ToFRLang.put("oss", "ossète");
iso639_1_To_639_2T.put("os", "oss");
@@ -2201,7 +2200,7 @@ public class CountryLanguageScript {
// Phoenician
iso639_2T_ToENLang.put("phn", "Phoenician");
iso639_2T_ToFRLang.put("phn", "ph�nicien");
iso639_2T_ToFRLang.put("phn", "phénicien");
// Pali
iso639_2T_ToENLang.put("pli", "Pali");
@@ -2227,11 +2226,11 @@ public class CountryLanguageScript {
// Prakrit languages
iso639_2T_ToENLang.put("pra", "Prakrit languages");
iso639_2T_ToFRLang.put("pra", "pr�krit");
iso639_2T_ToFRLang.put("pra", "prâkrit");
// Proven�al, Old (to 1500)
iso639_2T_ToENLang.put("pro", "Proven�al, Old (to 1500)");
iso639_2T_ToFRLang.put("pro", "proven�al ancien (jusqu'� 1500)");
// Provençal, Old (to 1500)
iso639_2T_ToENLang.put("pro", "Provençal, Old (to 1500)");
iso639_2T_ToFRLang.put("pro", "provençal ancien (jusqu'à 1500)");
// Pushto
iso639_2T_ToENLang.put("pus", "Pushto");
@@ -2263,7 +2262,7 @@ public class CountryLanguageScript {
// Raeto-Romance
iso639_2T_ToENLang.put("roh", "Raeto-Romance");
iso639_2T_ToFRLang.put("roh", "rh�to-roman");
iso639_2T_ToFRLang.put("roh", "rhéto-roman");
iso639_1_To_639_2T.put("rm", "roh");
@@ -2307,7 +2306,7 @@ public class CountryLanguageScript {
// South American Indian (Other)
iso639_2T_ToENLang.put("sai", "South American Indian (Other)");
iso639_2T_ToFRLang.put("sai", "indiennes d'Am�rique du Sud,autres langues");
iso639_2T_ToFRLang.put("sai", "indiennes d'Amérique du Sud,autres langues");
// Salishan languages
iso639_2T_ToENLang.put("sal", "Salishan languages ");
@@ -2341,7 +2340,7 @@ public class CountryLanguageScript {
// Scots
iso639_2T_ToENLang.put("sco", "Scots");
iso639_2T_ToFRLang.put("sco", "�cossais");
iso639_2T_ToFRLang.put("sco", "écossais");
// Croatian
iso639_2T_ToENLang.put("hrv", "Croatian");
@@ -2357,11 +2356,11 @@ public class CountryLanguageScript {
// Semitic (Other)
iso639_2T_ToENLang.put("sem", "Semitic (Other) ");
iso639_2T_ToFRLang.put("sem", "s�mitiques, autres langues");
iso639_2T_ToFRLang.put("sem", "sémitiques, autres langues");
// Irish, Old (to 900)
iso639_2T_ToENLang.put("sga", "Irish, Old (to 900) ");
iso639_2T_ToFRLang.put("sga", "irlandais ancien (jusqu'� 900)");
iso639_2T_ToFRLang.put("sga", "irlandais ancien (jusqu'à 900)");
// Sign Languages
iso639_2T_ToENLang.put("sgn", "Sign Languages");
@@ -2387,7 +2386,7 @@ public class CountryLanguageScript {
// Sino-Tibetan (Other)
iso639_2T_ToENLang.put("sit", "Sino-Tibetan (Other)");
iso639_2T_ToFRLang.put("sit", "sino-tib�taines, autres langues");
iso639_2T_ToFRLang.put("sit", "sino-tibétaines, autres langues");
// Slavic (Other)
iso639_2T_ToENLang.put("sla", "Slavic (Other)");
@@ -2403,7 +2402,7 @@ public class CountryLanguageScript {
// Slovenian
iso639_2T_ToENLang.put("slv", "Slovenian");
iso639_2T_ToFRLang.put("slv", "slov�ne");
iso639_2T_ToFRLang.put("slv", "slovène");
iso639_1_To_639_2T.put("sl", "slv");
@@ -2453,7 +2452,7 @@ public class CountryLanguageScript {
// Soninke
iso639_2T_ToENLang.put("snk", "Soninke ");
iso639_2T_ToFRLang.put("snk", "sonink�");
iso639_2T_ToFRLang.put("snk", "soninké");
// Sogdian
iso639_2T_ToENLang.put("sog", "Sogdian");
@@ -2505,7 +2504,7 @@ public class CountryLanguageScript {
// Serer
iso639_2T_ToENLang.put("srr", "Serer");
iso639_2T_ToFRLang.put("srr", "s�r�re");
iso639_2T_ToFRLang.put("srr", "sérère");
// Nilo-Saharan (Other)
iso639_2T_ToENLang.put("ssa", "Nilo-Saharan (Other)");
@@ -2533,7 +2532,7 @@ public class CountryLanguageScript {
// Sumerian
iso639_2T_ToENLang.put("sux", "Sumerian");
iso639_2T_ToFRLang.put("sux", "sum�rien");
iso639_2T_ToFRLang.put("sux", "sumérien");
// Swahili
iso639_2T_ToENLang.put("swa", "Swahili");
@@ -2543,7 +2542,7 @@ public class CountryLanguageScript {
// Swedish
iso639_2T_ToENLang.put("swe", "Swedish");
iso639_2T_ToFRLang.put("swe", "su�dois");
iso639_2T_ToFRLang.put("swe", "suédois");
iso639_1_To_639_2T.put("sv", "swe");
@@ -2559,7 +2558,7 @@ public class CountryLanguageScript {
// Tai (Other)
iso639_2T_ToENLang.put("tai", "Tai (Other)");
iso639_2T_ToFRLang.put("tai", "tha�es, autres langues");
iso639_2T_ToFRLang.put("tai", "thaïes, autres langues");
// Tamil
iso639_2T_ToENLang.put("tam", "Tamil");
@@ -2575,7 +2574,7 @@ public class CountryLanguageScript {
// Telugu
iso639_2T_ToENLang.put("tel", "Telugu");
iso639_2T_ToFRLang.put("tel", "t�lougou");
iso639_2T_ToFRLang.put("tel", "télougou");
iso639_1_To_639_2T.put("te", "tel");
@@ -2605,13 +2604,13 @@ public class CountryLanguageScript {
// Thai
iso639_2T_ToENLang.put("tha", "Thai");
iso639_2T_ToFRLang.put("tha", "tha�");
iso639_2T_ToFRLang.put("tha", "thaï");
iso639_1_To_639_2T.put("th", "tha");
// Tibetan
iso639_2T_ToENLang.put("bod", "Tibetan");
iso639_2T_ToFRLang.put("bod", "tib�tain");
iso639_2T_ToFRLang.put("bod", "tibétain");
iso639_2B_To_639_2T.put("tib", "bod");
@@ -2619,7 +2618,7 @@ public class CountryLanguageScript {
// Tigre
iso639_2T_ToENLang.put("tig", "Tigre");
iso639_2T_ToFRLang.put("tig", "tigr�");
iso639_2T_ToFRLang.put("tig", "tigré");
// Tigrinya
iso639_2T_ToENLang.put("tir", "Tigrinya");
@@ -2649,7 +2648,7 @@ public class CountryLanguageScript {
// Tonga (Tonga Islands)
iso639_2T_ToENLang.put("ton", "Tonga (Tonga Islands)");
iso639_2T_ToFRLang.put("ton", "tongan (�les Tonga)");
iso639_2T_ToFRLang.put("ton", "tongan (Îles Tonga)");
iso639_1_To_639_2T.put("to", "ton");
@@ -2675,7 +2674,7 @@ public class CountryLanguageScript {
// Turkmen
iso639_2T_ToENLang.put("tuk", "Turkmen");
iso639_2T_ToFRLang.put("tuk", "turkm�ne");
iso639_2T_ToFRLang.put("tuk", "turkmène");
iso639_1_To_639_2T.put("tk", "tuk");
@@ -2695,7 +2694,7 @@ public class CountryLanguageScript {
// Altaic (Other)
iso639_2T_ToENLang.put("tut", "Altaic (Other)");
iso639_2T_ToFRLang.put("tut", "alta�ques, autres langues");
iso639_2T_ToFRLang.put("tut", "altaïques, autres langues");
// Tuvalu
iso639_2T_ToENLang.put("tvl", "Tuvalu");
@@ -2717,7 +2716,7 @@ public class CountryLanguageScript {
// Uighur
iso639_2T_ToENLang.put("uig", "Uighur");
iso639_2T_ToFRLang.put("uig", "ou�gour");
iso639_2T_ToFRLang.put("uig", "ouïgour");
iso639_1_To_639_2T.put("ug", "uig");
@@ -2733,7 +2732,7 @@ public class CountryLanguageScript {
// Undetermined
iso639_2T_ToENLang.put("und", "Undetermined ");
iso639_2T_ToFRLang.put("und", "ind�termin�e");
iso639_2T_ToFRLang.put("und", "indéterminée");
// Urdu
iso639_2T_ToENLang.put("urd", "Urdu");
@@ -2749,7 +2748,7 @@ public class CountryLanguageScript {
// Vai
iso639_2T_ToENLang.put("vai", "Vai");
iso639_2T_ToFRLang.put("vai", "va�");
iso639_2T_ToFRLang.put("vai", "vaï");
// Venda
iso639_2T_ToENLang.put("ven", "Venda");
@@ -2761,9 +2760,9 @@ public class CountryLanguageScript {
iso639_1_To_639_2T.put("vi", "vie");
// Volap�k
iso639_2T_ToENLang.put("vol", "Volap�k");
iso639_2T_ToFRLang.put("vol", "volap�k");
// Volapük
iso639_2T_ToENLang.put("vol", "Volapük");
iso639_2T_ToFRLang.put("vol", "volapük");
iso639_1_To_639_2T.put("vo", "vol");
@@ -2843,7 +2842,7 @@ public class CountryLanguageScript {
// Zapotec
iso639_2T_ToENLang.put("zap", "Zapotec");
iso639_2T_ToFRLang.put("zap", "zapot�que");
iso639_2T_ToFRLang.put("zap", "zapotèque");
// Zenaga
iso639_2T_ToENLang.put("zen", "Zenaga");
@@ -2865,7 +2864,7 @@ public class CountryLanguageScript {
// Zande
iso639_2T_ToENLang.put("znd", "Zande");
iso639_2T_ToFRLang.put("znd", "zand�");
iso639_2T_ToFRLang.put("znd", "zandé");
// Zulu
iso639_2T_ToENLang.put("zul", "Zulu");
@@ -3049,7 +3048,7 @@ public class CountryLanguageScript {
iso15924ToName.put("Pq", "Klingon pIQaD");
iso15924ToName.put("Hu", "K�k Turki runes");
iso15924ToName.put("Hu", "Kök Turki runes");
iso15924ToName.put("Kl", "Koleruttu");
@@ -3071,7 +3070,7 @@ public class CountryLanguageScript {
iso15924ToName.put("Lg", "Latin (Gaelic variant)");
iso15924ToName.put("Lp", "Lepcha (R�ng)");
iso15924ToName.put("Lp", "Lepcha (Róng)");
iso15924ToName.put("Na", "Linear A");

+ 8
- 10
src/codegen/org/apache/fop/fonts/base14/Courier.java View File

@@ -1,7 +1,6 @@
/*
* $Id$
*
* Copyright 1999-2003 The Apache Software Foundation.
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -24,10 +22,10 @@
package org.apache.fop.fonts.base14;

import org.apache.fop.fonts.FontType;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.Typeface;
import org.apache.fop.fonts.CodePointMapping;

public class Courier extends Font {
public class Courier extends Typeface {
private final static String fontName = "Courier";
private final static String encoding = "WinAnsiEncoding";
private final static int capHeight = 562;
@@ -314,9 +312,9 @@ public class Courier extends Font {
}

public String getFontName() {
return fontName;
return fontName;
}
public FontType getFontType() {
return FontType.TYPE1;
}
@@ -355,15 +353,15 @@ public class Courier extends Font {
//for( int i = 0; i < arr.length; i++) arr[i] *= size;
return arr;
}
public boolean hasKerningInfo() {
return false;
}
public java.util.Map getKerningInfo() {
return java.util.Collections.EMPTY_MAP;
}
public char mapChar(char c) {
char d = mapping.mapChar(c);
if(d != 0) {

+ 8
- 10
src/codegen/org/apache/fop/fonts/base14/CourierBold.java View File

@@ -1,7 +1,6 @@
/*
* $Id$
*
* Copyright 1999-2003 The Apache Software Foundation.
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -24,10 +22,10 @@
package org.apache.fop.fonts.base14;

import org.apache.fop.fonts.FontType;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.Typeface;
import org.apache.fop.fonts.CodePointMapping;

public class CourierBold extends Font {
public class CourierBold extends Typeface {
private final static String fontName = "Courier-Bold";
private final static String encoding = "WinAnsiEncoding";
private final static int capHeight = 562;
@@ -314,9 +312,9 @@ public class CourierBold extends Font {
}

public String getFontName() {
return fontName;
return fontName;
}
public FontType getFontType() {
return FontType.TYPE1;
}
@@ -355,15 +353,15 @@ public class CourierBold extends Font {
//for( int i = 0; i < arr.length; i++) arr[i] *= size;
return arr;
}
public boolean hasKerningInfo() {
return false;
}
public java.util.Map getKerningInfo() {
return java.util.Collections.EMPTY_MAP;
}
public char mapChar(char c) {
char d = mapping.mapChar(c);
if(d != 0) {

+ 8
- 10
src/codegen/org/apache/fop/fonts/base14/CourierBoldOblique.java View File

@@ -1,7 +1,6 @@
/*
* $Id$
*
* Copyright 1999-2003 The Apache Software Foundation.
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -24,10 +22,10 @@
package org.apache.fop.fonts.base14;

import org.apache.fop.fonts.FontType;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.Typeface;
import org.apache.fop.fonts.CodePointMapping;

public class CourierBoldOblique extends Font {
public class CourierBoldOblique extends Typeface {
private final static String fontName = "Courier-BoldOblique";
private final static String encoding = "WinAnsiEncoding";
private final static int capHeight = 562;
@@ -314,9 +312,9 @@ public class CourierBoldOblique extends Font {
}

public String getFontName() {
return fontName;
return fontName;
}
public FontType getFontType() {
return FontType.TYPE1;
}
@@ -355,15 +353,15 @@ public class CourierBoldOblique extends Font {
//for( int i = 0; i < arr.length; i++) arr[i] *= size;
return arr;
}
public boolean hasKerningInfo() {
return false;
}
public java.util.Map getKerningInfo() {
return java.util.Collections.EMPTY_MAP;
}
public char mapChar(char c) {
char d = mapping.mapChar(c);
if(d != 0) {

+ 8
- 10
src/codegen/org/apache/fop/fonts/base14/CourierOblique.java View File

@@ -1,7 +1,6 @@
/*
* $Id$
*
* Copyright 1999-2003 The Apache Software Foundation.
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -24,10 +22,10 @@
package org.apache.fop.fonts.base14;

import org.apache.fop.fonts.FontType;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.Typeface;
import org.apache.fop.fonts.CodePointMapping;

public class CourierOblique extends Font {
public class CourierOblique extends Typeface {
private final static String fontName = "Courier-Oblique";
private final static String encoding = "WinAnsiEncoding";
private final static int capHeight = 562;
@@ -314,9 +312,9 @@ public class CourierOblique extends Font {
}

public String getFontName() {
return fontName;
return fontName;
}
public FontType getFontType() {
return FontType.TYPE1;
}
@@ -355,15 +353,15 @@ public class CourierOblique extends Font {
//for( int i = 0; i < arr.length; i++) arr[i] *= size;
return arr;
}
public boolean hasKerningInfo() {
return false;
}
public java.util.Map getKerningInfo() {
return java.util.Collections.EMPTY_MAP;
}
public char mapChar(char c) {
char d = mapping.mapChar(c);
if(d != 0) {

+ 8
- 10
src/codegen/org/apache/fop/fonts/base14/Helvetica.java View File

@@ -1,7 +1,6 @@
/*
* $Id$
*
* Copyright 1999-2003 The Apache Software Foundation.
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -24,10 +22,10 @@
package org.apache.fop.fonts.base14;

import org.apache.fop.fonts.FontType;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.Typeface;
import org.apache.fop.fonts.CodePointMapping;

public class Helvetica extends Font {
public class Helvetica extends Typeface {
private final static String fontName = "Helvetica";
private final static String encoding = "WinAnsiEncoding";
private final static int capHeight = 718;
@@ -282,9 +280,9 @@ public class Helvetica extends Font {
}

public String getFontName() {
return fontName;
return fontName;
}
public FontType getFontType() {
return FontType.TYPE1;
}
@@ -323,15 +321,15 @@ public class Helvetica extends Font {
//for( int i = 0; i < arr.length; i++) arr[i] *= size;
return arr;
}
public boolean hasKerningInfo() {
return false;
}
public java.util.Map getKerningInfo() {
return java.util.Collections.EMPTY_MAP;
}
public char mapChar(char c) {
char d = mapping.mapChar(c);
if(d != 0) {

+ 8
- 10
src/codegen/org/apache/fop/fonts/base14/HelveticaBold.java View File

@@ -1,7 +1,6 @@
/*
* $Id$
*
* Copyright 1999-2003 The Apache Software Foundation.
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -24,10 +22,10 @@
package org.apache.fop.fonts.base14;

import org.apache.fop.fonts.FontType;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.Typeface;
import org.apache.fop.fonts.CodePointMapping;

public class HelveticaBold extends Font {
public class HelveticaBold extends Typeface {
private final static String fontName = "Helvetica-Bold";
private final static String encoding = "WinAnsiEncoding";
private final static int capHeight = 718;
@@ -282,9 +280,9 @@ public class HelveticaBold extends Font {
}

public String getFontName() {
return fontName;
return fontName;
}
public FontType getFontType() {
return FontType.TYPE1;
}
@@ -323,15 +321,15 @@ public class HelveticaBold extends Font {
//for( int i = 0; i < arr.length; i++) arr[i] *= size;
return arr;
}
public boolean hasKerningInfo() {
return false;
}
public java.util.Map getKerningInfo() {
return java.util.Collections.EMPTY_MAP;
}
public char mapChar(char c) {
char d = mapping.mapChar(c);
if(d != 0) {

+ 8
- 10
src/codegen/org/apache/fop/fonts/base14/HelveticaBoldOblique.java View File

@@ -1,7 +1,6 @@
/*
* $Id$
*
* Copyright 1999-2003 The Apache Software Foundation.
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -24,10 +22,10 @@
package org.apache.fop.fonts.base14;

import org.apache.fop.fonts.FontType;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.Typeface;
import org.apache.fop.fonts.CodePointMapping;

public class HelveticaBoldOblique extends Font {
public class HelveticaBoldOblique extends Typeface {
private final static String fontName = "Helvetica-BoldOblique";
private final static String encoding = "WinAnsiEncoding";
private final static int capHeight = 718;
@@ -282,9 +280,9 @@ public class HelveticaBoldOblique extends Font {
}

public String getFontName() {
return fontName;
return fontName;
}
public FontType getFontType() {
return FontType.TYPE1;
}
@@ -323,15 +321,15 @@ public class HelveticaBoldOblique extends Font {
//for( int i = 0; i < arr.length; i++) arr[i] *= size;
return arr;
}
public boolean hasKerningInfo() {
return false;
}
public java.util.Map getKerningInfo() {
return java.util.Collections.EMPTY_MAP;
}
public char mapChar(char c) {
char d = mapping.mapChar(c);
if(d != 0) {

+ 8
- 10
src/codegen/org/apache/fop/fonts/base14/HelveticaOblique.java View File

@@ -1,7 +1,6 @@
/*
* $Id$
*
* Copyright 1999-2003 The Apache Software Foundation.
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -24,10 +22,10 @@
package org.apache.fop.fonts.base14;

import org.apache.fop.fonts.FontType;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.Typeface;
import org.apache.fop.fonts.CodePointMapping;

public class HelveticaOblique extends Font {
public class HelveticaOblique extends Typeface {
private final static String fontName = "Helvetica-Oblique";
private final static String encoding = "WinAnsiEncoding";
private final static int capHeight = 718;
@@ -282,9 +280,9 @@ public class HelveticaOblique extends Font {
}

public String getFontName() {
return fontName;
return fontName;
}
public FontType getFontType() {
return FontType.TYPE1;
}
@@ -323,15 +321,15 @@ public class HelveticaOblique extends Font {
//for( int i = 0; i < arr.length; i++) arr[i] *= size;
return arr;
}
public boolean hasKerningInfo() {
return false;
}
public java.util.Map getKerningInfo() {
return java.util.Collections.EMPTY_MAP;
}
public char mapChar(char c) {
char d = mapping.mapChar(c);
if(d != 0) {

+ 8
- 10
src/codegen/org/apache/fop/fonts/base14/Symbol.java View File

@@ -1,7 +1,6 @@
/*
* $Id$
*
* Copyright 1999-2003 The Apache Software Foundation.
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -24,10 +22,10 @@
package org.apache.fop.fonts.base14;

import org.apache.fop.fonts.FontType;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.Typeface;
import org.apache.fop.fonts.CodePointMapping;

public class Symbol extends Font {
public class Symbol extends Typeface {
private final static String fontName = "Symbol";
private final static String encoding = null;
private final static int capHeight = 1010;
@@ -241,9 +239,9 @@ public class Symbol extends Font {
}

public String getFontName() {
return fontName;
return fontName;
}
public FontType getFontType() {
return FontType.TYPE1;
}
@@ -282,15 +280,15 @@ public class Symbol extends Font {
//for( int i = 0; i < arr.length; i++) arr[i] *= size;
return arr;
}
public boolean hasKerningInfo() {
return false;
}
public java.util.Map getKerningInfo() {
return java.util.Collections.EMPTY_MAP;
}
public char mapChar(char c) {
char d = mapping.mapChar(c);
if(d != 0) {

+ 8
- 10
src/codegen/org/apache/fop/fonts/base14/TimesBold.java View File

@@ -1,7 +1,6 @@
/*
* $Id$
*
* Copyright 1999-2003 The Apache Software Foundation.
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -24,10 +22,10 @@
package org.apache.fop.fonts.base14;

import org.apache.fop.fonts.FontType;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.Typeface;
import org.apache.fop.fonts.CodePointMapping;

public class TimesBold extends Font {
public class TimesBold extends Typeface {
private final static String fontName = "Times-Bold";
private final static String encoding = "WinAnsiEncoding";
private final static int capHeight = 676;
@@ -282,9 +280,9 @@ public class TimesBold extends Font {
}

public String getFontName() {
return fontName;
return fontName;
}
public FontType getFontType() {
return FontType.TYPE1;
}
@@ -323,15 +321,15 @@ public class TimesBold extends Font {
//for( int i = 0; i < arr.length; i++) arr[i] *= size;
return arr;
}
public boolean hasKerningInfo() {
return false;
}
public java.util.Map getKerningInfo() {
return java.util.Collections.EMPTY_MAP;
}
public char mapChar(char c) {
char d = mapping.mapChar(c);
if(d != 0) {

+ 8
- 10
src/codegen/org/apache/fop/fonts/base14/TimesBoldItalic.java View File

@@ -1,7 +1,6 @@
/*
* $Id$
*
* Copyright 1999-2003 The Apache Software Foundation.
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -24,10 +22,10 @@
package org.apache.fop.fonts.base14;

import org.apache.fop.fonts.FontType;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.Typeface;
import org.apache.fop.fonts.CodePointMapping;

public class TimesBoldItalic extends Font {
public class TimesBoldItalic extends Typeface {
private final static String fontName = "Times-BoldItalic";
private final static String encoding = "WinAnsiEncoding";
private final static int capHeight = 669;
@@ -282,9 +280,9 @@ public class TimesBoldItalic extends Font {
}

public String getFontName() {
return fontName;
return fontName;
}
public FontType getFontType() {
return FontType.TYPE1;
}
@@ -323,15 +321,15 @@ public class TimesBoldItalic extends Font {
//for( int i = 0; i < arr.length; i++) arr[i] *= size;
return arr;
}
public boolean hasKerningInfo() {
return false;
}
public java.util.Map getKerningInfo() {
return java.util.Collections.EMPTY_MAP;
}
public char mapChar(char c) {
char d = mapping.mapChar(c);
if(d != 0) {

+ 8
- 10
src/codegen/org/apache/fop/fonts/base14/TimesItalic.java View File

@@ -1,7 +1,6 @@
/*
* $Id$
*
* Copyright 1999-2003 The Apache Software Foundation.
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -24,10 +22,10 @@
package org.apache.fop.fonts.base14;

import org.apache.fop.fonts.FontType;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.Typeface;
import org.apache.fop.fonts.CodePointMapping;

public class TimesItalic extends Font {
public class TimesItalic extends Typeface {
private final static String fontName = "Times-Italic";
private final static String encoding = "WinAnsiEncoding";
private final static int capHeight = 653;
@@ -282,9 +280,9 @@ public class TimesItalic extends Font {
}

public String getFontName() {
return fontName;
return fontName;
}
public FontType getFontType() {
return FontType.TYPE1;
}
@@ -323,15 +321,15 @@ public class TimesItalic extends Font {
//for( int i = 0; i < arr.length; i++) arr[i] *= size;
return arr;
}
public boolean hasKerningInfo() {
return false;
}
public java.util.Map getKerningInfo() {
return java.util.Collections.EMPTY_MAP;
}
public char mapChar(char c) {
char d = mapping.mapChar(c);
if(d != 0) {

+ 8
- 10
src/codegen/org/apache/fop/fonts/base14/TimesRoman.java View File

@@ -1,7 +1,6 @@
/*
* $Id$
*
* Copyright 1999-2003 The Apache Software Foundation.
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -24,10 +22,10 @@
package org.apache.fop.fonts.base14;

import org.apache.fop.fonts.FontType;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.Typeface;
import org.apache.fop.fonts.CodePointMapping;

public class TimesRoman extends Font {
public class TimesRoman extends Typeface {
private final static String fontName = "Times-Roman";
private final static String encoding = "WinAnsiEncoding";
private final static int capHeight = 662;
@@ -282,9 +280,9 @@ public class TimesRoman extends Font {
}

public String getFontName() {
return fontName;
return fontName;
}
public FontType getFontType() {
return FontType.TYPE1;
}
@@ -323,15 +321,15 @@ public class TimesRoman extends Font {
//for( int i = 0; i < arr.length; i++) arr[i] *= size;
return arr;
}
public boolean hasKerningInfo() {
return false;
}
public java.util.Map getKerningInfo() {
return java.util.Collections.EMPTY_MAP;
}
public char mapChar(char c) {
char d = mapping.mapChar(c);
if(d != 0) {

+ 8
- 10
src/codegen/org/apache/fop/fonts/base14/ZapfDingbats.java View File

@@ -1,7 +1,6 @@
/*
* $Id$
*
* Copyright 1999-2003 The Apache Software Foundation.
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -24,10 +22,10 @@
package org.apache.fop.fonts.base14;

import org.apache.fop.fonts.FontType;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.Typeface;
import org.apache.fop.fonts.CodePointMapping;

public class ZapfDingbats extends Font {
public class ZapfDingbats extends Typeface {
private final static String fontName = "ZapfDingbats";
private final static String encoding = null;
private final static int capHeight = 820;
@@ -253,9 +251,9 @@ public class ZapfDingbats extends Font {
}

public String getFontName() {
return fontName;
return fontName;
}
public FontType getFontType() {
return FontType.TYPE1;
}
@@ -294,15 +292,15 @@ public class ZapfDingbats extends Font {
//for( int i = 0; i < arr.length; i++) arr[i] *= size;
return arr;
}
public boolean hasKerningInfo() {
return false;
}
public java.util.Map getKerningInfo() {
return java.util.Collections.EMPTY_MAP;
}
public char mapChar(char c) {
char d = mapping.mapChar(c);
if(d != 0) {

+ 5
- 117
src/java/org/apache/fop/apps/Document.java View File

@@ -20,40 +20,22 @@ package org.apache.fop.apps;

// Java
import java.util.Map;
import java.io.IOException;
import java.util.Set;
import java.util.HashSet;
import java.util.logging.Logger;


// FOP
import org.apache.fop.apps.FOUserAgent;

import org.apache.fop.area.AreaTree;
import org.apache.fop.area.AreaTreeControl;
import org.apache.fop.area.AreaTreeModel;

import org.apache.fop.fo.extensions.Bookmarks;
import org.apache.fop.fo.FOInputHandler;
import org.apache.fop.fo.FOTreeControl;
import org.apache.fop.fo.FOTreeEvent;
import org.apache.fop.fo.FOTreeListener;
import org.apache.fop.fo.pagination.PageSequence;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.FontMetrics;
import org.apache.fop.layout.LayoutStrategy;

// SAX
import org.xml.sax.SAXException;

// Avalon
import org.apache.avalon.framework.logger.Logger;

/**
* Class storing information for the FOP Document being processed, and managing
* the processing of it.
*/
public class Document implements FOTreeControl, FOTreeListener,
AreaTreeControl {
public class Document {

/** The parent Driver object */
private Driver driver;
@@ -67,32 +49,13 @@ public class Document implements FOTreeControl, FOTreeListener,
/** look up a font-name to get a font (that implements FontMetrics at least) */
private Map fonts;

/**
* the LayoutStrategy to be used to process this document
* TODO: this actually belongs in the RenderContext class, when it is
* created
*/
private LayoutStrategy layoutStrategy = null;

/** The current AreaTree for the PageSequence being rendered. */
public AreaTree areaTree;
/** The AreaTreeModel for the PageSequence being rendered. */
public AreaTreeModel atModel;

private Bookmarks bookmarks = null;

/**
* The current set of id's in the FO tree.
* This is used so we know if the FO tree contains duplicates.
*/
private Set idReferences = new HashSet();

/**
* Structure handler used to notify structure events
* such as start end element.
*/
public FOInputHandler foInputHandler;

private Logger log;
/**
* Main constructor
* @param driver the Driver object that is the "parent" of this Document
@@ -102,6 +65,7 @@ public class Document implements FOTreeControl, FOTreeListener,
this.triplets = new java.util.HashMap();
this.fonts = new java.util.HashMap();
this.usedFonts = new java.util.HashMap();
log = Logger.getLogger(Fop.fopPackage);
}

/**
@@ -281,21 +245,6 @@ public class Document implements FOTreeControl, FOTreeListener,
return (FontMetrics)fonts.get(fontName);
}

/**
* Set the LayoutStrategy to be used to process this Document
* @param ls the LayoutStrategy object to be used to process this Document
*/
public void setLayoutStrategy(LayoutStrategy ls) {
this.layoutStrategy = ls;
}

/**
* @return this Document's LayoutStrategy object
*/
public LayoutStrategy getLayoutStrategy () {
return layoutStrategy;
}

/**
* Public accessor for the parent Driver of this Document
* @return the parent Driver for this Document
@@ -304,60 +253,6 @@ public class Document implements FOTreeControl, FOTreeListener,
return driver;
}

/**
* Required by the FOTreeListener interface. It handles an
* FOTreeEvent that is fired when a PageSequence object has been completed.
* @param event the FOTreeEvent that was fired
* @throws FOPException for errors in building the PageSequence
*/
public void foPageSequenceComplete (FOTreeEvent event) throws FOPException {
PageSequence pageSeq = event.getPageSequence();
areaTree.addBookmarksToAreaTree();
layoutStrategy.format(pageSeq, areaTree);
}

/**
* Required by the FOTreeListener interface. It handles an FOTreeEvent that
* is fired when the Document has been completely parsed.
* @param event the FOTreeEvent that was fired
* @throws SAXException for parsing errors
*/
public void foDocumentComplete (FOTreeEvent event) throws SAXException {
//processAreaTree(atModel);
try {
areaTree.endDocument();
driver.getRenderer().stopRenderer();
} catch (IOException ex) {
throw new SAXException(ex);
}
}

/**
* Get the area tree for this layout handler.
*
* @return the area tree for this document
*/
public AreaTree getAreaTree() {
return areaTree;
}

/**
* Set the Bookmarks object for this Document
* @param bookmarks the Bookmarks object containing the bookmarks for this
* Document
*/
public void setBookmarks(Bookmarks bookmarks) {
this.bookmarks = bookmarks;
}

/**
* Public accessor for the Bookmarks for this Document
* @return the Bookmarks for this Document
*/
public Bookmarks getBookmarks() {
return bookmarks;
}

/**
* Retuns the set of ID references.
* @return the ID references
@@ -366,18 +261,11 @@ public class Document implements FOTreeControl, FOTreeListener,
return idReferences;
}

/**
* @return the FOInputHandler for parsing this FO Tree
*/
public FOInputHandler getFOInputHandler() {
return foInputHandler;
}

/**
* @return the Logger to be used for processing this Document
*/
public Logger getLogger() {
return getDriver().getLogger();
return log;
}

/**

+ 136
- 7
src/java/org/apache/fop/apps/Driver.java View File

@@ -30,6 +30,8 @@ import org.xml.sax.XMLReader;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.fo.FOTree;
import org.apache.fop.layout.AreaTree;
import org.apache.fop.render.Renderer;
import org.apache.fop.render.awt.AWTRenderer;
import org.apache.fop.version.Version;
import org.apache.fop.xml.FoXmlSerialHandler;
import org.apache.fop.xml.Namespaces;
@@ -73,6 +75,7 @@ public class Driver {
private boolean _errorDump = false;
private Configuration configuration = null;
private FOPOptions options = null;
private FOUserAgent userAgent = null;
private InputHandler inputHandler;
private XMLReader parser;
@@ -91,6 +94,12 @@ public class Driver {
private Thread areaThread;
private Thread renderThread;

/** the renderer type code given by setRenderer */
private int rendererType = NOT_SET;

/** the renderer to use to output the area tree */
private Renderer renderer;


/**
* Error handling, version and logging initialization.
@@ -99,14 +108,16 @@ public class Driver {
String version = Version.getVersion();
configuration = new Configuration();
options = new FOPOptions(configuration);
userAgent = new FOUserAgent();
_errorDump = configuration.isTrue("debugMode");
logger.config(version);
}
public Driver(String[] args, Configuration config, FOPOptions options) {
public Driver(Configuration config, FOPOptions options) {
String version = Version.getVersion();
configuration = config;
this.options = options;
userAgent = new FOUserAgent();
_errorDump = configuration.isTrue("debugMode");
logger.config(version);
}
@@ -185,15 +196,133 @@ public class Driver {
this.inputHandler = inputHandler;
}

protected FOUserAgent getUserAgent() {
return userAgent;
}

/**
* Sets the parser features.
* @param parser the XMLReader used to parse the input
* @throws FOPException
* Shortcut to set the rendering type to use. Must be one of
* <ul>
* <li>RENDER_PDF</li>
* <li>RENDER_AWT</li>
* <li>RENDER_PRINT</li>
* <li>RENDER_MIF</li>
* <li>RENDER_XML</li>
* <li>RENDER_PCL</li>
* <li>RENDER_PS</li>
* <li>RENDER_TXT</li>
* <li>RENDER_SVG</li>
* <li>RENDER_RTF</li>
* </ul>
* @param renderer the type of renderer to use
* @throws IllegalArgumentException if an unsupported renderer type was required.
*/
public void setRenderer(int renderer) throws IllegalArgumentException {
rendererType = renderer;
switch (renderer) {
// case RENDER_PDF:
// setRenderer("org.apache.fop.render.pdf.PDFRenderer");
// break;
case RENDER_AWT:
throw new IllegalArgumentException("Use renderer form of setRenderer() for AWT");
// case RENDER_PRINT:
// setRenderer("org.apache.fop.render.awt.AWTPrintRenderer");
// break;
// case RENDER_PCL:
// setRenderer("org.apache.fop.render.pcl.PCLRenderer");
// break;
// case RENDER_PS:
// setRenderer("org.apache.fop.render.ps.PSRenderer");
// break;
// case RENDER_TXT:
// setRenderer("org.apache.fop.render.txt.TXTRenderer()");
// break;
// case RENDER_MIF:
// //foInputHandler will be set later
// break;
// case RENDER_XML:
// setRenderer("org.apache.fop.render.xml.XMLRenderer");
// break;
// case RENDER_SVG:
// setRenderer("org.apache.fop.render.svg.SVGRenderer");
// break;
// case RENDER_RTF:
// //foInputHandler will be set later
// break;
default:
rendererType = NOT_SET;
throw new IllegalArgumentException("Unknown renderer type " + renderer);
}
}

/**
* Set the Renderer to use.
* @param renderer the renderer instance to use (Note: Logger must be set at this point)
*/
public void setRenderer(Renderer renderer) {
// AWTStarter calls this function directly
if (renderer instanceof AWTRenderer) {
rendererType = RENDER_AWT;
}
renderer.setProducer(Version.getVersion());
renderer.setUserAgent(getUserAgent());
this.renderer = renderer;
}

/**
* Returns the currently active renderer.
* @return the renderer
*/
public Renderer getRenderer() {
return renderer;
}

/**
* Set the class name of the Renderer to use as well as the
* producer string for those renderers that can make use of it.
* @param rendererClassName classname of the renderer to use such as
* "org.apache.fop.render.pdf.PDFRenderer"
* @exception IllegalArgumentException if the classname was invalid.
* @see #setRenderer(int)
*/
public void setRenderer(String rendererClassName)
throws IllegalArgumentException {
try {
renderer = (Renderer)Class.forName(rendererClassName).newInstance();
renderer.setProducer(Version.getVersion());
renderer.setUserAgent(getUserAgent());
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException("Could not find "
+ rendererClassName);
} catch (InstantiationException e) {
throw new IllegalArgumentException("Could not instantiate "
+ rendererClassName);
} catch (IllegalAccessException e) {
throw new IllegalArgumentException("Could not access "
+ rendererClassName);
} catch (ClassCastException e) {
throw new IllegalArgumentException(rendererClassName
+ " is not a renderer");
}
}

/**
* DOES NOTHING
* TODO Eliminate or actualise
*/
public synchronized void reset() {
}

/**
* Render the FO document read by a SAX Parser from an InputHandler
* @param inputHandler the input handler containing the source and
* parser information.
* @throws FOPException if anything goes wrong.
*/
/*
public void setParserFeatures(XMLReader parser) throws FOPException {
public synchronized void render(InputHandler inputHandler)
throws FOPException {
throw new FOPException("Attempting to run null 'render' method");
}
*/

/**
* Prints stack trace of an exception

+ 1
- 25
src/java/org/apache/fop/apps/FOUserAgent.java View File

@@ -20,16 +20,12 @@ package org.apache.fop.apps;

// Java
import java.util.Map;
import java.io.IOException;
import java.io.InputStream;

// Avalon
import org.apache.avalon.framework.logger.LogEnabled;
import org.apache.avalon.framework.logger.Logger;

// FOP
import org.apache.fop.pdf.PDFEncryptionParams;

/**
* The User Agent for fo.
* This user agent is used by the processing to obtain user configurable
@@ -58,7 +54,6 @@ public class FOUserAgent implements LogEnabled {
/** Map containing XML handlers for various document types */
public Map handlers = new java.util.HashMap();
private String baseURL;
private PDFEncryptionParams pdfEncryptionParams;
private float px2mm = 0.35277777777777777778f; //72dpi (=25.4/dpi)

/**
@@ -72,7 +67,6 @@ public class FOUserAgent implements LogEnabled {

/**
* Returns the logger to use.
* @see org.apache.avalon.framework.logger.AbstractLogEnabled#getLogger()
* (todo) This breaks IoC/SoC. Should be improved.
*/
public Logger getLogger() {
@@ -99,32 +93,14 @@ public class FOUserAgent implements LogEnabled {
}
}

/**
* Returns the parameters for PDF encryption.
* @return the PDF encryption parameters, null if not applicable
*/
public PDFEncryptionParams getPDFEncryptionParams() {
return pdfEncryptionParams;
}

/**
* Sets the parameters for PDF encryption.
* @param pdfEncryptionParams the PDF encryption parameters, null to
* disable PDF encryption
*/
public void setPDFEncryptionParams(PDFEncryptionParams pdfEncryptionParams) {
this.pdfEncryptionParams = pdfEncryptionParams;
}


/**
* Get an input stream for a reference.
* Temporary solution until API better.
* @param uri URI to access
* @return InputStream for accessing the resource.
* @throws IOException in case of an I/O problem
*/
public InputStream getStream(String uri) throws IOException {
public InputStream getStream(String uri) {
return null;
}


+ 40
- 24
src/java/org/apache/fop/apps/Fop.java View File

@@ -49,7 +49,41 @@ public class Fop {
public Configuration configuration = new Configuration();

public static void main(String[] args) {
Fop fopInstance = new Fop();
fopInstance.run();
}

/**
* Gets the parser Class name.
*
* @return a String with the value of the property
* <code>org.xml.sax.parser</code> or the default value
* <code>org.apache.xerces.parsers.SAXParser</code>.
*/
public static final String getParserClassName() {
String parserClassName = null;
try {
parserClassName = System.getProperty("org.xml.sax.parser");
} catch (SecurityException se) {}

if (parserClassName == null) {
parserClassName = "org.apache.xerces.parsers.SAXParser";
}
return parserClassName;
}
String[] args = null;

public Fop() {
run();
}
public Fop(String[] args) {
this.args = args;
run();
}
public void run() {
long endtotal, endfree, gctotal, gcfree;
Properties properties;
try {
@@ -84,8 +118,12 @@ public class Fop {

try {
configuration = new Configuration();
options = new FOPOptions(configuration, args);
driver = new Driver(args, configuration, options);
if (args == null) {
options = new FOPOptions(configuration);
} else {
options = new FOPOptions(configuration, args);
}
driver = new Driver(configuration, options);
driver.run();
System.out.println("Back from driver.run()");
System.out.println("Elapsed time: " +
@@ -125,27 +163,5 @@ public class Fop {
}
}

/**
* Gets the parser Class name.
*
* @return a String with the value of the property
* <code>org.xml.sax.parser</code> or the default value
* <code>org.apache.xerces.parsers.SAXParser</code>.
*/
public static final String getParserClassName() {
String parserClassName = null;
try {
parserClassName = System.getProperty("org.xml.sax.parser");
} catch (SecurityException se) {}

if (parserClassName == null) {
parserClassName = "org.apache.xerces.parsers.SAXParser";
}
return parserClassName;
}

private Fop() {
}

}


+ 246
- 21
src/java/org/apache/fop/fonts/Font.java View File

@@ -1,51 +1,276 @@
/*
* $Id: Font.java,v 1.2 2003/03/06 17:43:05 jeremias Exp $
*
* Copyright 1999-2003 The Apache Software Foundation.
*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
*/

/* $Id$ */

package org.apache.fop.fonts;

// FOP
import java.util.Map;




/**
* Base class for PDF font classes
* This class holds font state information and provides access to the font
* metrics.
*/
public abstract class Font implements FontMetrics {
public class Font {

/** Default fallback key */
public static final String DEFAULT_FONT = "any,normal,400";
/** Normal font weight */
public static final int NORMAL = 400;
/** Bold font weight */
public static final int BOLD = 700;

private String fontName;
private int fontSize;
//private String fontFamily;
//private String fontStyle;
//private int fontWeight;

/**
* normal or small-caps font
*/
//private int fontVariant;

private FontMetrics metric;

/**
* Main constructor
* @param key key of the font
* @param met font metrics
* @param fontSize font size
*/
public Font(String key, FontMetrics met, int fontSize) {
this.fontName = key;
this.metric = met;
this.fontSize = fontSize;
}

/**
* Returns the font's ascender.
* @return the ascender
*/
public int getAscender() {
return metric.getAscender(fontSize) / 1000;
}

/**
* Returns the font's CapHeight.
* @return the capital height
*/
public int getCapHeight() {
return metric.getCapHeight(fontSize) / 1000;
}

/**
* Returns the font's Descender.
* @return the descender
*/
public int getDescender() {
return metric.getDescender(fontSize) / 1000;
}

/**
* Returns the font's name.
* @return the font name
*/
public String getFontName() {
return fontName;
}

/**
* Returns the font size
* @return the font size
*/
public int getFontSize() {
return fontSize;
}

/**
* Get the encoding of the font.
* @return the encoding
* Returns the XHeight
* @return the XHeight
*/
public abstract String getEncoding();
public int getXHeight() {
return metric.getXHeight(fontSize) / 1000;
}

/**
* Map a Unicode character to a code point in the font.
* Returns the font's kerning table
* @return the kerning table
*/
public Map getKerning() {
Map ret = metric.getKerningInfo();
if (ret != null) {
return ret;
} else {
return java.util.Collections.EMPTY_MAP;
}
}

/**
* Returns the width of a character
* @param charnum character to look up
* @return width of the character
*/
public int getWidth(int charnum) {
// returns width of given character number in millipoints
return (metric.getWidth(charnum, fontSize) / 1000);
}

/**
* Map a java character (unicode) to a font character.
* Default uses CodePointMapping.
* @param c character to map
* @return the mapped character
*/
public abstract char mapChar(char c);
public char mapChar(char c) {

if (metric instanceof org.apache.fop.fonts.Typeface) {
return ((org.apache.fop.fonts.Typeface)metric).mapChar(c);
}

// Use default CodePointMapping
char d = CodePointMapping.getMapping("WinAnsiEncoding").mapChar(c);
if (d != 0) {
c = d;
} else {
c = '#';
}

return c;
}

/**
* @see java.lang.Object#toString()
*/
public String toString() {
StringBuffer sbuf = new StringBuffer();
sbuf.append('(');
/*
sbuf.append(fontFamily);
sbuf.append(',');*/
sbuf.append(fontName);
sbuf.append(',');
sbuf.append(fontSize);
/*
sbuf.append(',');
sbuf.append(fontStyle);
sbuf.append(',');
sbuf.append(fontWeight);*/
sbuf.append(')');
return sbuf.toString();
}

/**
* Determines whether the font is a multibyte font.
* @return True if it is multibyte
* Helper method for getting the width of a unicode char
* from the current fontstate.
* This also performs some guessing on widths on various
* versions of space that might not exists in the font.
* @param c character to inspect
* @param fs FontState to use
* @return the width of the character
*/
public boolean isMultiByte() {
return false;
public int getCharWidth(char c) {
int width;

if ((c == '\n') || (c == '\r') || (c == '\t') || (c == '\u00A0')) {
width = getCharWidth(' ');
} else {
width = getWidth(mapChar(c));
if (width <= 0) {
// Estimate the width of spaces not represented in
// the font
int em = getWidth(mapChar('m'));
int en = getWidth(mapChar('n'));
if (em <= 0) {
em = 500 * getFontSize();
}
if (en <= 0) {
en = em - 10;
}

if (c == ' ') {
width = em;
}
if (c == '\u2000') {
width = en;
}
if (c == '\u2001') {
width = em;
}
if (c == '\u2002') {
width = em / 2;
}
if (c == '\u2003') {
width = getFontSize();
}
if (c == '\u2004') {
width = em / 3;
}
if (c == '\u2005') {
width = em / 4;
}
if (c == '\u2006') {
width = em / 6;
}
if (c == '\u2007') {
width = getCharWidth(' ');
}
if (c == '\u2008') {
width = getCharWidth('.');
}
if (c == '\u2009') {
width = em / 5;
}
if (c == '\u200A') {
width = 5;
}
if (c == '\u200B') {
width = 100;
}
if (c == '\u202F') {
width = getCharWidth(' ') / 2;
}
if (c == '\u3000') {
width = getCharWidth(' ') * 2;
}
}
}

return width;
}

/**
* Calculates the word width.
*/
public int getWordWidth(String word) {
if (word == null)
return 0;
int wordLength = word.length();
int width = 0;
char[] characters = new char[wordLength];
word.getChars(0, wordLength, characters, 0);
for (int i = 0; i < wordLength; i++) {
width += getCharWidth(characters[i]);
}
return width;
}

}



+ 9
- 9
src/java/org/apache/fop/fonts/FontDescriptor.java View File

@@ -1,21 +1,21 @@
/*
* $Id: FontDescriptor.java,v 1.2 2003/03/06 17:43:05 jeremias Exp $
*
* Copyright 1999-2003 The Apache Software Foundation.
*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
*/

/* $Id$ */
package org.apache.fop.fonts;

/**

+ 9
- 9
src/java/org/apache/fop/fonts/FontMetrics.java View File

@@ -1,21 +1,21 @@
/*
* $Id: FontMetrics.java,v 1.2 2003/03/06 17:43:05 jeremias Exp $
*
* Copyright 1999-2003 The Apache Software Foundation.
*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
*/

/* $Id$ */
package org.apache.fop.fonts;

import java.util.Map;

+ 9
- 9
src/java/org/apache/fop/fonts/FontType.java View File

@@ -1,21 +1,21 @@
/*
* $Id: FontType.java,v 1.2 2003/03/06 17:43:05 jeremias Exp $
*
* Copyright 1999-2003 The Apache Software Foundation.
*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
*/

/* $Id$ */
package org.apache.fop.fonts;

import org.apache.avalon.framework.ValuedEnum;

+ 9
- 9
src/java/org/apache/fop/fonts/Glyphs.java View File

@@ -1,21 +1,21 @@
/*
* $Id: Glyphs.java,v 1.10 2003/03/06 17:43:05 jeremias Exp $
*
* Copyright 1999-2003 The Apache Software Foundation.
*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
*/

/* $Id$ */
package org.apache.fop.fonts;

/**

+ 492
- 522
src/java/org/apache/fop/render/AbstractRenderer.java
File diff suppressed because it is too large
View File


+ 0
- 16
src/java/org/apache/fop/render/PrintRenderer.java View File

@@ -19,9 +19,6 @@
package org.apache.fop.render;

// FOP
import org.apache.fop.apps.Document;
import org.apache.fop.fo.FOTreeControl;
import org.apache.fop.fonts.FontSetup;

// Java
import java.util.List;
@@ -29,20 +26,7 @@ import java.util.List;
/** Abstract base class of "Print" type renderers. */
public abstract class PrintRenderer extends AbstractRenderer {

/** Font configuration */
protected FOTreeControl fontInfo;

/** list of fonts */
protected List fontList = null;

/**
* Set up the font info
*
* @param fontInfo font info to set up
*/
public void setupFontInfo(FOTreeControl foTreeControl) {
this.fontInfo = foTreeControl;
FontSetup.setup((Document)fontInfo, fontList);
}

}

+ 0
- 37
src/java/org/apache/fop/render/Renderer.java View File

@@ -27,15 +27,6 @@ import java.util.Map;
// FOP
import org.apache.fop.apps.FOPException;
import org.apache.fop.area.PageViewport;
import org.apache.fop.area.Title;
import org.apache.fop.area.TreeExt;
import org.apache.fop.area.inline.Container;
import org.apache.fop.area.inline.InlineParent;
import org.apache.fop.area.inline.Leader;
import org.apache.fop.area.inline.Space;
import org.apache.fop.area.inline.Viewport;
import org.apache.fop.area.inline.TextArea;
import org.apache.fop.fo.FOTreeControl;
import org.apache.fop.apps.FOUserAgent;

/**
@@ -87,13 +78,6 @@ public interface Renderer {
*/
void setUserAgent(FOUserAgent agent);

/**
* Set up the given FontInfo.
*
* @param fontInfo The fonts
*/
void setupFontInfo(FOTreeControl foTreeControl);

/**
* Set up renderer options.
*
@@ -142,13 +126,6 @@ public interface Renderer {
*/
boolean supportsOutOfOrder();

/**
* Tells the renderer to render an extension element.
*
* @param ext The extension element to be rendered
*/
void renderExtension(TreeExt ext);

/**
* This is called if the renderer supports out of order rendering. The
* renderer should prepare the page so that a page further on in the set of
@@ -160,13 +137,6 @@ public interface Renderer {
*/
void preparePage(PageViewport page);

/**
* Tells the renderer that a new page sequence starts.
*
* @param seqTitle The title of the page sequence
*/
void startPageSequence(Title seqTitle);

/**
* Tells the renderer to render a particular page. A renderer typically
* reponds by packing up the current page and writing it immediately to the
@@ -179,12 +149,5 @@ public interface Renderer {
void renderPage(PageViewport page)
throws IOException, FOPException;

/**
* Tells the renderer to render an inline container.
*
* @param cont The inline container area
*/
void renderContainer(Container cont);

}


+ 3
- 3
src/java/org/apache/fop/render/awt/AWTFontMetrics.java View File

@@ -157,7 +157,7 @@ public class AWTFontMetrics {
*/
public int getXHeight(String family, int style, int size) {
setFont(family, style, size);
return (int)(FONT_FACTOR * xHeight);
return (FONT_FACTOR * xHeight);
}

/**
@@ -178,7 +178,7 @@ public class AWTFontMetrics {
if (i <= 32) {
w = (int)(1.4 * fmt.charWidth(i) * FONT_FACTOR);
} else {
w = (int)(fmt.charWidth(i) * FONT_FACTOR);
w = (fmt.charWidth(i) * FONT_FACTOR);
}
return w;
}
@@ -227,7 +227,7 @@ public class AWTFontMetrics {
if ((this.style != style) || !this.family.equals(family)
|| this.size != s) {
if (family.equals(this.family)) {
f1 = f1.deriveFont(style, (float)s);
f1 = f1.deriveFont(style, s);
} else {
f1 = new Font(family, style, s);
}

+ 251
- 258
src/java/org/apache/fop/render/awt/AWTRenderer.java View File

@@ -48,19 +48,8 @@ import java.util.Vector;
import org.apache.fop.apps.Document;
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.InputHandler;
import org.apache.fop.area.Area;
import org.apache.fop.area.Page;
import org.apache.fop.area.PageViewport;
import org.apache.fop.area.RegionViewport;
import org.apache.fop.area.Trait;
import org.apache.fop.area.inline.TextArea;
import org.apache.fop.datatypes.ColorType;
import org.apache.fop.fo.FOTreeControl;
import org.apache.fop.image.FopImage;
import org.apache.fop.image.ImageFactory;
import org.apache.fop.render.AbstractRenderer;
import org.apache.fop.traits.BorderProps;
import org.apache.fop.render.awt.FontMetricsMapper;
import org.apache.fop.render.awt.viewer.PreviewDialog;
import org.apache.fop.render.awt.viewer.Translator;

@@ -125,13 +114,13 @@ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable
return translator;
}

public void setupFontInfo(FOTreeControl foTreeControl) {
// create a temp Image to test font metrics on
fontInfo = (Document) foTreeControl;
BufferedImage fontImage =
new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
FontSetup.setup(fontInfo, fontImage.createGraphics());
}
// public void setupFontInfo(FOTreeControl foTreeControl) {
// // create a temp Image to test font metrics on
// fontInfo = (Document) foTreeControl;
// BufferedImage fontImage =
// new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
// FontSetup.setup(fontInfo, fontImage.createGraphics());
// }

public int getPageNumber() {
return pageNumber;
@@ -205,65 +194,64 @@ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable
return frame;
}

/** This method override only stores the PageViewport in a vector.
* No actual rendering performed -- this is done by getPageImage(pageNum) instead.
* @param pageViewport the <code>PageViewport</code> object supplied by the Area Tree
* @see org.apache.fop.render.Renderer
*/
public void renderPage(PageViewport pageViewport) throws IOException, FOPException {
pageViewportList.add(pageViewport);
pageList.add(pageViewport.getPage().clone());
bufferedImageList.add(getPageImage(pageViewport));
}

public BufferedImage getBufferedPageImage(int pageNum) throws FOPException {
return (BufferedImage) bufferedImageList.get(pageNum);
}

/** Generates a desired page from the renderer's page viewport vector.
* @param pageNum the 0-based page number to generate
* @return the <code>java.awt.image.BufferedImage</code> corresponding to the page
* @throws FOPException in case of an out-of-range page number requested
*/
public BufferedImage getPageImage(PageViewport pageViewport) throws FOPException {
Page page = pageViewport.getPage();

Rectangle2D bounds = pageViewport.getViewArea();
pageWidth = (int) Math.round(bounds.getWidth() / 1000f );
pageHeight = (int) Math.round(bounds.getHeight() / 1000f );
/*
System.out.println("(Page) X, Y, Width, Height: " + bounds.getX()
+ " " + bounds.getY()
+ " " + bounds.getWidth()
+ " " + bounds.getHeight());
*/
currentPageImage =
new BufferedImage((int)((pageWidth * (int)scaleFactor) / 100),
(int)((pageHeight * (int)scaleFactor) / 100),
BufferedImage.TYPE_INT_RGB);

Graphics2D graphics = currentPageImage.createGraphics();
graphics.setRenderingHint (RenderingHints.KEY_FRACTIONALMETRICS,
RenderingHints.VALUE_FRACTIONALMETRICS_ON);

// transform page based on scale factor supplied
AffineTransform at = graphics.getTransform();
at.scale(scaleFactor / 100.0, scaleFactor / 100.0);
graphics.setTransform(at);

// draw page frame
graphics.setColor(Color.white);
graphics.fillRect(0, 0, pageWidth, pageHeight);
graphics.setColor(Color.black);
graphics.drawRect(-1, -1, pageWidth + 2, pageHeight + 2);
graphics.drawLine(pageWidth + 2, 0, pageWidth + 2, pageHeight + 2);
graphics.drawLine(pageWidth + 3, 1, pageWidth + 3, pageHeight + 3);
graphics.drawLine(0, pageHeight + 2, pageWidth + 2, pageHeight + 2);
graphics.drawLine(1, pageHeight + 3, pageWidth + 3, pageHeight + 3);

renderPageAreas(page);
return currentPageImage;
}
// /** This method override only stores the PageViewport in a vector.
// * No actual rendering performed -- this is done by getPageImage(pageNum) instead.
// * @param pageViewport the <code>PageViewport</code> object supplied by the Area Tree
// * @see org.apache.fop.render.Renderer
// */
// public void renderPage(PageViewport pageViewport) throws IOException, FOPException {
// pageViewportList.add(pageViewport);
// pageList.add(pageViewport.getPage().clone());
// bufferedImageList.add(getPageImage(pageViewport));
// }

// public BufferedImage getBufferedPageImage(int pageNum) {
// return (BufferedImage) bufferedImageList.get(pageNum);
// }
//
// /** Generates a desired page from the renderer's page viewport vector.
// * @return the <code>java.awt.image.BufferedImage</code> corresponding to the page
// * @throws FOPException in case of an out-of-range page number requested
// */
// public BufferedImage getPageImage(PageViewport pageViewport) throws FOPException {
// Page page = pageViewport.getPage();
//
// Rectangle2D bounds = pageViewport.getViewArea();
// pageWidth = (int) Math.round(bounds.getWidth() / 1000f );
// pageHeight = (int) Math.round(bounds.getHeight() / 1000f );
///*
// System.out.println("(Page) X, Y, Width, Height: " + bounds.getX()
// + " " + bounds.getY()
// + " " + bounds.getWidth()
// + " " + bounds.getHeight());
//*/
// currentPageImage =
// new BufferedImage((int)((pageWidth * (int)scaleFactor) / 100),
// (int)((pageHeight * (int)scaleFactor) / 100),
// BufferedImage.TYPE_INT_RGB);
//
// Graphics2D graphics = currentPageImage.createGraphics();
// graphics.setRenderingHint (RenderingHints.KEY_FRACTIONALMETRICS,
// RenderingHints.VALUE_FRACTIONALMETRICS_ON);
//
// // transform page based on scale factor supplied
// AffineTransform at = graphics.getTransform();
// at.scale(scaleFactor / 100.0, scaleFactor / 100.0);
// graphics.setTransform(at);
//
// // draw page frame
// graphics.setColor(Color.white);
// graphics.fillRect(0, 0, pageWidth, pageHeight);
// graphics.setColor(Color.black);
// graphics.drawRect(-1, -1, pageWidth + 2, pageHeight + 2);
// graphics.drawLine(pageWidth + 2, 0, pageWidth + 2, pageHeight + 2);
// graphics.drawLine(pageWidth + 3, 1, pageWidth + 3, pageHeight + 3);
// graphics.drawLine(0, pageHeight + 2, pageWidth + 2, pageHeight + 2);
// graphics.drawLine(1, pageHeight + 3, pageWidth + 3, pageHeight + 3);
//
// renderPageAreas(page);
// return currentPageImage;
// }

/** Generates a desired page from the renderer's page viewport vector.
* @param pageNum the 0-based page number to generate
@@ -276,190 +264,195 @@ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable
+ ") requested; only " + pageViewportList.size()
+ " page(s) available.");
}
PageViewport pageViewport = (PageViewport) pageViewportList.get(pageNum);
Page page = (Page) pageList.get(pageNum);
Rectangle2D bounds = pageViewport.getViewArea();
pageWidth = (int) Math.round(bounds.getWidth() / 1000f );
pageHeight = (int) Math.round(bounds.getHeight() / 1000f );
/*
System.out.println("(Page) X, Y, Width, Height: " + bounds.getX()
+ " " + bounds.getY()
+ " " + bounds.getWidth()
+ " " + bounds.getHeight());
*/
currentPageImage =
new BufferedImage((int)((pageWidth * (int)scaleFactor) / 100),
(int)((pageHeight * (int)scaleFactor) / 100),
BufferedImage.TYPE_INT_RGB);
Graphics2D graphics = currentPageImage.createGraphics();
graphics.setRenderingHint (RenderingHints.KEY_FRACTIONALMETRICS,
RenderingHints.VALUE_FRACTIONALMETRICS_ON);
// transform page based on scale factor supplied
AffineTransform at = graphics.getTransform();
at.scale(scaleFactor / 100.0, scaleFactor / 100.0);
graphics.setTransform(at);
// draw page frame
graphics.setColor(Color.white);
graphics.fillRect(0, 0, pageWidth, pageHeight);
graphics.setColor(Color.black);
graphics.drawRect(-1, -1, pageWidth + 2, pageHeight + 2);
graphics.drawLine(pageWidth + 2, 0, pageWidth + 2, pageHeight + 2);
graphics.drawLine(pageWidth + 3, 1, pageWidth + 3, pageHeight + 3);
graphics.drawLine(0, pageHeight + 2, pageWidth + 2, pageHeight + 2);
graphics.drawLine(1, pageHeight + 3, pageWidth + 3, pageHeight + 3);
renderPageAreas(page);
// PageViewport pageViewport = (PageViewport) pageViewportList.get(pageNum);
// Page page = (Page) pageList.get(pageNum);
//
// Rectangle2D bounds = pageViewport.getViewArea();
// pageWidth = (int) Math.round(bounds.getWidth() / 1000f );
// pageHeight = (int) Math.round(bounds.getHeight() / 1000f );
///*
// System.out.println("(Page) X, Y, Width, Height: " + bounds.getX()
// + " " + bounds.getY()
// + " " + bounds.getWidth()
// + " " + bounds.getHeight());
//*/
// currentPageImage =
// new BufferedImage((int)((pageWidth * (int)scaleFactor) / 100),
// (int)((pageHeight * (int)scaleFactor) / 100),
// BufferedImage.TYPE_INT_RGB);
//
// Graphics2D graphics = currentPageImage.createGraphics();
// graphics.setRenderingHint (RenderingHints.KEY_FRACTIONALMETRICS,
// RenderingHints.VALUE_FRACTIONALMETRICS_ON);
//
// // transform page based on scale factor supplied
// AffineTransform at = graphics.getTransform();
// at.scale(scaleFactor / 100.0, scaleFactor / 100.0);
// graphics.setTransform(at);
//
// // draw page frame
// graphics.setColor(Color.white);
// graphics.fillRect(0, 0, pageWidth, pageHeight);
// graphics.setColor(Color.black);
// graphics.drawRect(-1, -1, pageWidth + 2, pageHeight + 2);
// graphics.drawLine(pageWidth + 2, 0, pageWidth + 2, pageHeight + 2);
// graphics.drawLine(pageWidth + 3, 1, pageWidth + 3, pageHeight + 3);
// graphics.drawLine(0, pageHeight + 2, pageWidth + 2, pageHeight + 2);
// graphics.drawLine(1, pageHeight + 3, pageWidth + 3, pageHeight + 3);
//
// renderPageAreas(page);
return currentPageImage;
}

/**
* Handle the traits for a region
* This is used to draw the traits for the given page region.
* (See Sect. 6.4.1.2 of XSL-FO spec.)
* @param region the RegionViewport whose region is to be drawn
*/
protected void handleRegionTraits(RegionViewport region) {
Rectangle2D viewArea = region.getViewArea();
int startX = (int) Math.round((viewArea.getX() / 1000f)
* (scaleFactor / 100f));
int startY = (int) Math.round((viewArea.getY() / 1000f)
* (scaleFactor / 100f));
// for rounding to work correctly, need to take into account
// fractional portion of X and Y.
int width = (int) Math.round(((viewArea.getX() + viewArea.getWidth()) / 1000f)
* (scaleFactor / 100f)) - startX;
int height = (int) Math.round(((viewArea.getY() + viewArea.getHeight()) / 1000f)
* (scaleFactor / 100f)) - startY;
if (region.getRegion() != null) {
System.out.print("\nRegion type = " + region.getRegion().getRegionClass());
}
System.out.println(" X, Width, Y, Height: " + startX
+ " " + width
+ " " + startY
+ " " + height
);
drawBackAndBorders(region, startX, startY, width, height);
}
/**
* Draw the background and borders.
* This draws the background and border traits for an area given
* the position.
*
* @param block the area to get the traits from
* @param startx the start x position
* @param starty the start y position
* @param width the width of the area
* @param height the height of the area
*/
protected void drawBackAndBorders(Area block,
int startx, int starty,
int width, int height) {
// draw background then border
Graphics2D graphics = currentPageImage.createGraphics();
Trait.Background back;
back = (Trait.Background) block.getTrait(Trait.BACKGROUND);
if (back != null) {
if (back.getColor() != null) {
graphics.setColor(back.getColor().getAWTColor());
graphics.fillRect(startx, starty, width, height);
}
if (back.getURL() != null) { // TODO: implement
ImageFactory fact = ImageFactory.getInstance();
FopImage fopimage = fact.getImage(back.getURL(), userAgent);
if (fopimage != null && fopimage.load(FopImage.DIMENSIONS, userAgent.getLogger())) {
if (back.getRepeat() == BackgroundRepeat.REPEAT) {
// create a pattern for the image
} else {
// place once
Rectangle2D pos;
pos = new Rectangle2D.Float((startx + back.getHoriz()) * 1000,
(starty + back.getVertical()) * 1000,
fopimage.getWidth() * 1000,
fopimage.getHeight() * 1000);
// putImage(back.getURL(), pos);
}
}
}
}
BorderProps bps = (BorderProps) block.getTrait(Trait.BORDER_BEFORE);
if (bps != null) {
int borderWidth = (int) Math.round((bps.width / 1000f) * (scaleFactor / 100f));
graphics.setColor(bps.color.getAWTColor());
graphics.fillRect(startx, starty, width, borderWidth);
}
bps = (BorderProps) block.getTrait(Trait.BORDER_AFTER);
if (bps != null) {
int borderWidth = (int) Math.round((bps.width / 1000f) * (scaleFactor / 100f));
int sy = starty + height;
graphics.setColor(bps.color.getAWTColor());
graphics.fillRect(startx, starty + height - borderWidth,
width, borderWidth);
}
bps = (BorderProps) block.getTrait(Trait.BORDER_START);
if (bps != null) {
int borderWidth = (int) Math.round((bps.width / 1000f) * (scaleFactor / 100f));
graphics.setColor(bps.color.getAWTColor());
graphics.fillRect(startx, starty, borderWidth, height);
}
bps = (BorderProps) block.getTrait(Trait.BORDER_END);
if (bps != null) {
int borderWidth = (int) Math.round((bps.width / 1000f) * (scaleFactor / 100f));
int sx = startx + width;
graphics.setColor(bps.color.getAWTColor());
graphics.fillRect(startx + width - borderWidth, starty,
borderWidth, height);
}
}
// /**
// * Handle the traits for a region
// * This is used to draw the traits for the given page region.
// * (See Sect. 6.4.1.2 of XSL-FO spec.)
// * @param region the RegionViewport whose region is to be drawn
// */
// protected void handleRegionTraits(RegionViewport region) {
// Rectangle2D viewArea = region.getViewArea();
//
// int startX = (int) Math.round((viewArea.getX() / 1000f)
// * (scaleFactor / 100f));
// int startY = (int) Math.round((viewArea.getY() / 1000f)
// * (scaleFactor / 100f));
// // for rounding to work correctly, need to take into account
// // fractional portion of X and Y.
// int width = (int) Math.round(((viewArea.getX() + viewArea.getWidth()) / 1000f)
// * (scaleFactor / 100f)) - startX;
// int height = (int) Math.round(((viewArea.getY() + viewArea.getHeight()) / 1000f)
// * (scaleFactor / 100f)) - startY;
//
// if (region.getRegion() != null) {
// System.out.print("\nRegion type = " + region.getRegion().getRegionClass());
// }
//
// System.out.println(" X, Width, Y, Height: " + startX
// + " " + width
// + " " + startY
// + " " + height
// );
//
// drawBackAndBorders(region, startX, startY, width, height);
// }
// /**
// * Draw the background and borders.
// * This draws the background and border traits for an area given
// * the position.
// *
// * @param block the area to get the traits from
// * @param startx the start x position
// * @param starty the start y position
// * @param width the width of the area
// * @param height the height of the area
// */
// protected void drawBackAndBorders(Area block,
// int startx, int starty,
// int width, int height) {
//
// // draw background then border
// Graphics2D graphics = currentPageImage.createGraphics();
// Trait.Background back;
// back = (Trait.Background) block.getTrait(Trait.BACKGROUND);
// if (back != null) {
//
// if (back.getColor() != null) {
// graphics.setColor(back.getColor().getAWTColor());
// graphics.fillRect(startx, starty, width, height);
// }
// if (back.getURL() != null) { // TODO: implement
// ImageFactory fact = ImageFactory.getInstance();
// FopImage fopimage = fact.getImage(back.getURL(), userAgent);
// if (fopimage != null && fopimage.load(FopImage.DIMENSIONS, userAgent.getLogger())) {
// if (back.getRepeat() == BackgroundRepeat.REPEAT) {
// // create a pattern for the image
// } else {
// // place once
// Rectangle2D pos;
// pos = new Rectangle2D.Float((startx + back.getHoriz()) * 1000,
// (starty + back.getVertical()) * 1000,
// fopimage.getWidth() * 1000,
// fopimage.getHeight() * 1000);
//// putImage(back.getURL(), pos);
// }
// }
// }
// }
//
// BorderProps bps = (BorderProps) block.getTrait(Trait.BORDER_BEFORE);
// if (bps != null) {
// int borderWidth = (int) Math.round((bps.width / 1000f) * (scaleFactor / 100f));
// graphics.setColor(bps.color.getAWTColor());
// graphics.fillRect(startx, starty, width, borderWidth);
// }
// bps = (BorderProps) block.getTrait(Trait.BORDER_AFTER);
// if (bps != null) {
// int borderWidth = (int) Math.round((bps.width / 1000f) * (scaleFactor / 100f));
// int sy = starty + height;
// graphics.setColor(bps.color.getAWTColor());
// graphics.fillRect(startx, starty + height - borderWidth,
// width, borderWidth);
// }
// bps = (BorderProps) block.getTrait(Trait.BORDER_START);
// if (bps != null) {
// int borderWidth = (int) Math.round((bps.width / 1000f) * (scaleFactor / 100f));
// graphics.setColor(bps.color.getAWTColor());
// graphics.fillRect(startx, starty, borderWidth, height);
// }
// bps = (BorderProps) block.getTrait(Trait.BORDER_END);
// if (bps != null) {
// int borderWidth = (int) Math.round((bps.width / 1000f) * (scaleFactor / 100f));
// int sx = startx + width;
// graphics.setColor(bps.color.getAWTColor());
// graphics.fillRect(startx + width - borderWidth, starty,
// borderWidth, height);
// }
//
// }
/**
* @see org.apache.fop.render.Renderer#renderText(TextArea)
*/
public void renderText(TextArea text) {
System.out.println("In render text: " + text.getTextArea());

Graphics2D graphics = currentPageImage.createGraphics();
String fontName = (String) text.getTrait(Trait.FONT_NAME);
int size = ((Integer) text.getTrait(Trait.FONT_SIZE)).intValue();
// Typeface f = (Typeface) fontInfo.getFonts().get(fontName);
ColorType ct = (ColorType) text.getTrait(Trait.COLOR);

FontMetricsMapper mapper = (FontMetricsMapper)
fontInfo.getMetricsFor(fontName);
if (mapper == null) {
mapper = new FontMetricsMapper("MonoSpaced", java.awt.Font.PLAIN,
graphics);
}

// graphics.setColor(ct.getAWTColor());
// graphics.setFont(mapper.getFont(size));
graphics.setColor(java.awt.Color.black);
graphics.setFont(new java.awt.Font("monospaced", java.awt.Font.PLAIN,
10));
int rx = currentBlockIPPosition;
int bl = currentBPPosition + text.getOffset();

int newx = (int) (rx + 500) / 1000;
int newy = (int) (pageHeight - (bl + 500) / 1000);
String s = text.getTextArea();
// graphics.drawString(s, newx, newy);
graphics.drawString(s, 220, 200);

// TODO: render text decorations
currentBlockIPPosition += text.getWidth();
// /**
// * @see org.apache.fop.render.Renderer#renderText(TextArea)
// */
// public void renderText(TextArea text) {
// System.out.println("In render text: " + text.getTextArea());
//
// Graphics2D graphics = currentPageImage.createGraphics();
// String fontName = (String) text.getTrait(Trait.FONT_NAME);
// int size = ((Integer) text.getTrait(Trait.FONT_SIZE)).intValue();
//// Typeface f = (Typeface) fontInfo.getFonts().get(fontName);
// ColorType ct = (ColorType) text.getTrait(Trait.COLOR);
//
// FontMetricsMapper mapper = (FontMetricsMapper)
// fontInfo.getMetricsFor(fontName);
// if (mapper == null) {
// mapper = new FontMetricsMapper("MonoSpaced", java.awt.Font.PLAIN,
// graphics);
// }
//
//// graphics.setColor(ct.getAWTColor());
//// graphics.setFont(mapper.getFont(size));
// graphics.setColor(java.awt.Color.black);
// graphics.setFont(new java.awt.Font("monospaced", java.awt.Font.PLAIN,
// 10));
//
// int rx = currentBlockIPPosition;
// int bl = currentBPPosition + text.getOffset();
//
// int newx = (int) (rx + 500) / 1000;
// int newy = (int) (pageHeight - (bl + 500) / 1000);
//
// String s = text.getTextArea();
//// graphics.drawString(s, newx, newy);
// graphics.drawString(s, 220, 200);
//
// // TODO: render text decorations
// currentBlockIPPosition += text.getWidth();
// }
public void renderPage(PageViewport page)
throws IOException, FOPException {
}

}

+ 1
- 1
src/java/org/apache/fop/render/awt/viewer/Command.java View File

@@ -38,7 +38,7 @@ import java.net.URL;
*/
public class Command extends AbstractAction {

private static final String IMAGE_DIR = "images/";
private static final String IMAGE_DIR = "resources/awt_viewere/images/";

/**
* Creates <code>Command</code> object with a given name and

+ 1
- 1
src/java/org/apache/fop/render/awt/viewer/PreviewDialogAboutBox.java View File

@@ -36,7 +36,7 @@ import java.awt.event.WindowEvent;
import java.awt.event.ActionEvent;

//FOP
import org.apache.fop.apps.Version;
import org.apache.fop.version.Version;

/**
* AWT Viewer's "About" dialog.

Loading…
Cancel
Save