--- /dev/null
+#############################################################################
+# 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
+
--- /dev/null
+#############################################################################
+# 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
--- /dev/null
+#############################################################################
+# 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
--- /dev/null
+#############################################################################
+# 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
--- /dev/null
+#############################################################################
+# 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
--- /dev/null
+#############################################################################
+# 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
--- /dev/null
+#############################################################################
+# 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
--- /dev/null
+#############################################################################
+# 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
--- /dev/null
+#############################################################################
+# 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
--- /dev/null
+#############################################################################
+# 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
+
<!-- $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!
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"/>;
}
public String getFontName() {
- return fontName;
+ return fontName;
}
-
+
public FontType getFontType() {
return FontType.TYPE1;
}
//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) {
/*
* $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
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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)");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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)");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
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");
// 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");
// 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");
// 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");
// 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");
// 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 ");
// 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");
// 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");
// 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)");
// 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");
// 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");
// 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)");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
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");
// 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");
// 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");
iso15924ToName.put("Pq", "Klingon pIQaD");
- iso15924ToName.put("Hu", "K�k Turki runes");
+ iso15924ToName.put("Hu", "Kök Turki runes");
iso15924ToName.put("Kl", "Koleruttu");
iso15924ToName.put("Lg", "Latin (Gaelic variant)");
- iso15924ToName.put("Lp", "Lepcha (R�ng)");
+ iso15924ToName.put("Lp", "Lepcha (Róng)");
iso15924ToName.put("Na", "Linear A");
/*
* $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.
* See the License for the specific language governing permissions and
* limitations under the License.
*
- *
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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;
}
public String getFontName() {
- return fontName;
+ return fontName;
}
-
+
public FontType getFontType() {
return FontType.TYPE1;
}
//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) {
/*
* $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.
* See the License for the specific language governing permissions and
* limitations under the License.
*
- *
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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;
}
public String getFontName() {
- return fontName;
+ return fontName;
}
-
+
public FontType getFontType() {
return FontType.TYPE1;
}
//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) {
/*
* $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.
* See the License for the specific language governing permissions and
* limitations under the License.
*
- *
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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;
}
public String getFontName() {
- return fontName;
+ return fontName;
}
-
+
public FontType getFontType() {
return FontType.TYPE1;
}
//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) {
/*
* $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.
* See the License for the specific language governing permissions and
* limitations under the License.
*
- *
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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;
}
public String getFontName() {
- return fontName;
+ return fontName;
}
-
+
public FontType getFontType() {
return FontType.TYPE1;
}
//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) {
/*
* $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.
* See the License for the specific language governing permissions and
* limitations under the License.
*
- *
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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;
}
public String getFontName() {
- return fontName;
+ return fontName;
}
-
+
public FontType getFontType() {
return FontType.TYPE1;
}
//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) {
/*
* $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.
* See the License for the specific language governing permissions and
* limitations under the License.
*
- *
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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;
}
public String getFontName() {
- return fontName;
+ return fontName;
}
-
+
public FontType getFontType() {
return FontType.TYPE1;
}
//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) {
/*
* $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.
* See the License for the specific language governing permissions and
* limitations under the License.
*
- *
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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;
}
public String getFontName() {
- return fontName;
+ return fontName;
}
-
+
public FontType getFontType() {
return FontType.TYPE1;
}
//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) {
/*
* $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.
* See the License for the specific language governing permissions and
* limitations under the License.
*
- *
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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;
}
public String getFontName() {
- return fontName;
+ return fontName;
}
-
+
public FontType getFontType() {
return FontType.TYPE1;
}
//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) {
/*
* $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.
* See the License for the specific language governing permissions and
* limitations under the License.
*
- *
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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;
}
public String getFontName() {
- return fontName;
+ return fontName;
}
-
+
public FontType getFontType() {
return FontType.TYPE1;
}
//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) {
/*
* $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.
* See the License for the specific language governing permissions and
* limitations under the License.
*
- *
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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;
}
public String getFontName() {
- return fontName;
+ return fontName;
}
-
+
public FontType getFontType() {
return FontType.TYPE1;
}
//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) {
/*
* $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.
* See the License for the specific language governing permissions and
* limitations under the License.
*
- *
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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;
}
public String getFontName() {
- return fontName;
+ return fontName;
}
-
+
public FontType getFontType() {
return FontType.TYPE1;
}
//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) {
/*
* $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.
* See the License for the specific language governing permissions and
* limitations under the License.
*
- *
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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;
}
public String getFontName() {
- return fontName;
+ return fontName;
}
-
+
public FontType getFontType() {
return FontType.TYPE1;
}
//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) {
/*
* $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.
* See the License for the specific language governing permissions and
* limitations under the License.
*
- *
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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;
}
public String getFontName() {
- return fontName;
+ return fontName;
}
-
+
public FontType getFontType() {
return FontType.TYPE1;
}
//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) {
/*
* $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.
* See the License for the specific language governing permissions and
* limitations under the License.
*
- *
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Automatically generated by font-file.xsl. DO NOT EDIT!
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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;
}
public String getFontName() {
- return fontName;
+ return fontName;
}
-
+
public FontType getFontType() {
return FontType.TYPE1;
}
//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) {
// 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;
/** 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
this.triplets = new java.util.HashMap();
this.fonts = new java.util.HashMap();
this.usedFonts = new java.util.HashMap();
+ log = Logger.getLogger(Fop.fopPackage);
}
/**
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
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
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;
}
/**
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;
private boolean _errorDump = false;
private Configuration configuration = null;
private FOPOptions options = null;
+ private FOUserAgent userAgent = null;
private InputHandler inputHandler;
private XMLReader parser;
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.
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);
}
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
// 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
/** 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)
/**
/**
* Returns the logger to use.
- * @see org.apache.avalon.framework.logger.AbstractLogEnabled#getLogger()
* (todo) This breaks IoC/SoC. Should be improved.
*/
public Logger getLogger() {
}
}
- /**
- * 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;
}
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 {
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: " +
}
}
- /**
- * 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() {
- }
-
}
/*
- * $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;
}
}
+
/*
- * $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;
/**
/*
- * $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;
/*
- * $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;
/*
- * $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;
/**
package org.apache.fop.render;
-// Java
-import java.awt.geom.Rectangle2D;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Date;
import java.util.Map;
-import java.util.List;
-import java.util.Iterator;
-
+import java.util.logging.Logger;
// XML
import org.w3c.dom.Document;
// FOP
-import org.apache.fop.apps.FOPException;
-import org.apache.fop.area.Area;
-import org.apache.fop.area.BeforeFloat;
-import org.apache.fop.area.Block;
-import org.apache.fop.area.BlockViewport;
-import org.apache.fop.area.BodyRegion;
-import org.apache.fop.area.CTM;
-import org.apache.fop.area.Flow;
-import org.apache.fop.area.Footnote;
-import org.apache.fop.area.LineArea;
-import org.apache.fop.area.MainReference;
-import org.apache.fop.area.Span;
-import org.apache.fop.area.Page;
+import org.apache.fop.area.CoordTransformer;
import org.apache.fop.area.PageViewport;
import org.apache.fop.area.RegionViewport;
-import org.apache.fop.area.RegionReference;
-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.ForeignObject;
-import org.apache.fop.area.inline.Image;
-import org.apache.fop.area.inline.InlineArea;
-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.area.inline.Character;
import org.apache.fop.apps.FOUserAgent;
-import org.apache.fop.fo.Constants;
-import org.apache.fop.fo.FOTreeControl;
-import org.apache.fop.fo.pagination.Region;
+import org.apache.fop.apps.Fop;
-// Avalon
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
* top level processing of the area tree and adds some abstract methods to
* handle viewports. This keeps track of the current block and inline position.
*/
-public abstract class AbstractRenderer extends AbstractLogEnabled
- implements Renderer, Configurable, Constants {
+public abstract class AbstractRenderer
+ implements Renderer, Configurable {
/**
* user agent
*/
protected int containingIPPosition = 0;
+
+ protected Logger log = Logger.getLogger(Fop.fopPackage);
+
/**
* @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
*/
creator = inCreator;
}
- /**
- * @see org.apache.fop.render.Renderer
- */
- public abstract void setupFontInfo(FOTreeControl foTreeControl);
+// /**
+// * @see org.apache.fop.render.Renderer
+// */
+// public abstract void setupFontInfo(FOTreeControl foTreeControl);
/**
* @see org.apache.fop.render.Renderer
return false;
}
- /**
- * @param ext (todo) Description of the Parameter
- * @see org.apache.fop.render.Renderer
- */
- public void renderExtension(TreeExt ext) { }
+// /**
+// * @param ext (todo) Description of the Parameter
+// * @see org.apache.fop.render.Renderer
+// */
+// public void renderExtension(TreeExt ext) { }
/**
* Prepare a page for rendering. This is called if the renderer supports
*/
public void preparePage(PageViewport page) { }
- /**
- * Utility method to convert a page sequence title to a string. Some
- * renderers may only be able to use a string title. A title is a sequence
- * of inline areas that this method attempts to convert to an equivalent
- * string.
- *
- * @param title The Title to convert
- * @return An expanded string representing the title
- */
- protected String convertTitleToString(Title title) {
- List children = title.getInlineAreas();
- String str = convertToString(children);
- return str.trim();
- }
-
- private String convertToString(List children) {
- StringBuffer sb = new StringBuffer();
- for (int count = 0; count < children.size(); count++) {
- InlineArea inline = (InlineArea) children.get(count);
- if (inline instanceof Character) {
- sb.append(((Character) inline).getChar());
- } else if (inline instanceof TextArea) {
- sb.append(((TextArea) inline).getTextArea());
- } else if (inline instanceof InlineParent) {
- sb.append(convertToString(
- ((InlineParent) inline).getChildAreas()));
- } else {
- sb.append(" ");
- }
- }
- return sb.toString();
- }
-
- /** @see org.apache.fop.render.Renderer */
- public void startPageSequence(Title seqTitle) {
- //do nothing
- }
+// /**
+// * Utility method to convert a page sequence title to a string. Some
+// * renderers may only be able to use a string title. A title is a sequence
+// * of inline areas that this method attempts to convert to an equivalent
+// * string.
+// *
+// * @param title The Title to convert
+// * @return An expanded string representing the title
+// */
+// protected String convertTitleToString(Title title) {
+// List children = title.getInlineAreas();
+// String str = convertToString(children);
+// return str.trim();
+// }
+//
+// private String convertToString(List children) {
+// StringBuffer sb = new StringBuffer();
+// for (int count = 0; count < children.size(); count++) {
+// InlineArea inline = (InlineArea) children.get(count);
+// if (inline instanceof Character) {
+// sb.append(((Character) inline).getChar());
+// } else if (inline instanceof TextArea) {
+// sb.append(((TextArea) inline).getTextArea());
+// } else if (inline instanceof InlineParent) {
+// sb.append(convertToString(
+// ((InlineParent) inline).getChildAreas()));
+// } else {
+// sb.append(" ");
+// }
+// }
+// return sb.toString();
+// }
+//
+// /** @see org.apache.fop.render.Renderer */
+// public void startPageSequence(Title seqTitle) {
+// //do nothing
+// }
// normally this would be overriden to create a page in the
// output
- /** @see org.apache.fop.render.Renderer */
- public void renderPage(PageViewport page)
- throws IOException, FOPException {
-
- Page p = page.getPage();
- renderPageAreas(p);
- }
-
- /**
- * Renders page areas.
- *
- * @param page The page whos page areas are to be rendered
- */
- protected void renderPageAreas(Page page) {
- /* Spec does not appear to specify whether fo:region-body should
- appear above or below side regions in cases of overlap. FOP
- decision is to have fo:region-body on top, hence it is rendered
- last here. */
- RegionViewport viewport;
- viewport = page.getRegionViewport(Region.BEFORE_CODE);
- renderRegionViewport(viewport);
- viewport = page.getRegionViewport(Region.START_CODE);
- renderRegionViewport(viewport);
- viewport = page.getRegionViewport(Region.END_CODE);
- renderRegionViewport(viewport);
- viewport = page.getRegionViewport(Region.AFTER_CODE);
- renderRegionViewport(viewport);
- viewport = page.getRegionViewport(Region.BODY_CODE);
- renderRegionViewport(viewport);
- }
-
- /**
- * Renders a region viewport. <p>
- *
- * The region may clip the area and it establishes a position from where
- * the region is placed.</p>
- *
- * @param port The region viewport to be rendered
- */
- protected void renderRegionViewport(RegionViewport port) {
- if (port != null) {
- Rectangle2D view = port.getViewArea();
- // The CTM will transform coordinates relative to
- // this region-reference area into page coords, so
- // set origin for the region to 0,0.
- currentBPPosition = 0;
- currentIPPosition = 0;
- currentBlockIPPosition = currentIPPosition;
-
- RegionReference region = port.getRegion();
- handleRegionTraits(port);
-
- // shouldn't the viewport have the CTM
- startVParea(region.getCTM());
- // do after starting viewport area
- if (region.getRegionClass() == Region.BODY_CODE) {
- renderBodyRegion((BodyRegion) region);
- } else {
- renderRegion(region);
- }
- endVParea();
- }
- }
+// /** @see org.apache.fop.render.Renderer */
+// public void renderPage(PageViewport page)
+// throws IOException, FOPException {
+//
+// Page p = page.getPage();
+// renderPageAreas(p);
+// }
+
+// /**
+// * Renders page areas.
+// *
+// * @param page The page whos page areas are to be rendered
+// */
+// protected void renderPageAreas(Page page) {
+// /* Spec does not appear to specify whether fo:region-body should
+// appear above or below side regions in cases of overlap. FOP
+// decision is to have fo:region-body on top, hence it is rendered
+// last here. */
+// RegionViewport viewport;
+// viewport = page.getRegionViewport(Region.BEFORE_CODE);
+// renderRegionViewport(viewport);
+// viewport = page.getRegionViewport(Region.START_CODE);
+// renderRegionViewport(viewport);
+// viewport = page.getRegionViewport(Region.END_CODE);
+// renderRegionViewport(viewport);
+// viewport = page.getRegionViewport(Region.AFTER_CODE);
+// renderRegionViewport(viewport);
+// viewport = page.getRegionViewport(Region.BODY_CODE);
+// renderRegionViewport(viewport);
+// }
+
+// /**
+// * Renders a region viewport. <p>
+// *
+// * The region may clip the area and it establishes a position from where
+// * the region is placed.</p>
+// *
+// * @param port The region viewport to be rendered
+// */
+// protected void renderRegionViewport(RegionViewport port) {
+// if (port != null) {
+// Rectangle2D view = port.getViewArea();
+// // The CoordTransformer will transform coordinates relative to
+// // this region-reference area into page coords, so
+// // set origin for the region to 0,0.
+// currentBPPosition = 0;
+// currentIPPosition = 0;
+// currentBlockIPPosition = currentIPPosition;
+//
+// RegionReference region = port.getRegion();
+// handleRegionTraits(port);
+//
+// // shouldn't the viewport have the CoordTransformer
+// startVParea(region.getCoordTransformer());
+// // do after starting viewport area
+// if (region.getRegionClass() == Region.BODY_CODE) {
+// renderBodyRegion((BodyRegion) region);
+// } else {
+// renderRegion(region);
+// }
+// endVParea();
+// }
+// }
/**
* (todo) Description of the Method
*
* @param ctm The coordinate transformation matrix to use
*/
- protected void startVParea(CTM ctm) { }
+ protected void startVParea(CoordTransformer ctm) { }
/**
* Handle the traits for a region
*/
protected void endVParea() { }
- /**
- * Renders a region reference area.
- *
- * @param region The region reference area
- */
- protected void renderRegion(RegionReference region) {
- List blocks = region.getBlocks();
-
- renderBlocks(null, blocks);
-
- }
-
- /**
- * Renders a body region area.
- *
- * @param region The body region
- */
- protected void renderBodyRegion(BodyRegion region) {
- BeforeFloat bf = region.getBeforeFloat();
- if (bf != null) {
- renderBeforeFloat(bf);
- }
- MainReference mr = region.getMainReference();
- if (mr != null) {
- renderMainReference(mr);
- }
- Footnote foot = region.getFootnote();
- if (foot != null) {
- renderFootnote(foot);
- }
- }
-
- /**
- * Renders a before float area.
- *
- * @param bf The before float area
- */
- protected void renderBeforeFloat(BeforeFloat bf) {
- List blocks = bf.getChildAreas();
- if (blocks != null) {
- renderBlocks(null, blocks);
- Block sep = bf.getSeparator();
- if (sep != null) {
- renderBlock(sep);
- }
- }
- }
-
- /**
- * Renders a footnote
- *
- * @param footnote The footnote
- */
- protected void renderFootnote(Footnote footnote) {
- List blocks = footnote.getChildAreas();
- if (blocks != null) {
- Block sep = footnote.getSeparator();
- if (sep != null) {
- renderBlock(sep);
- }
- renderBlocks(null, blocks);
- }
- }
-
- /**
- * Renders the main reference area.
- * <p>
- * The main reference area contains a list of spans that are
- * stacked on the page.
- * The spans contain a list of normal flow reference areas
- * that are positioned into columns.
- * </p>
- *
- * @param mr The main reference area
- */
- protected void renderMainReference(MainReference mr) {
- int saveIPPos = currentIPPosition;
-
- Span span = null;
- List spans = mr.getSpans();
- for (int count = 0; count < spans.size(); count++) {
- span = (Span) spans.get(count);
- int offset = (mr.getWidth()
- - (span.getColumnCount() - 1) * mr.getColumnGap())
- / span.getColumnCount() + mr.getColumnGap();
- for (int c = 0; c < span.getColumnCount(); c++) {
- Flow flow = (Flow) span.getFlow(c);
-
- renderFlow(flow);
- currentIPPosition += offset;
- }
- currentIPPosition = saveIPPos;
- currentBPPosition += span.getHeight();
- }
- }
-
- /**
- * Renders a flow reference area.
- *
- * @param flow The flow reference area
- */
- protected void renderFlow(Flow flow) {
- // the normal flow reference area contains stacked blocks
- List blocks = flow.getChildAreas();
- if (blocks != null) {
- renderBlocks(null, blocks);
- }
- }
-
- /**
- * Handle block traits.
- * This method is called when the correct ip and bp posiiton is
- * set. This should be overridden to draw border and background
- * traits for the block area.
- *
- * @param block the block area
- */
- protected void handleBlockTraits(Block block) {
- // draw border and background
- }
-
- /**
- * Renders a block viewport.
- *
- * @param bv The block viewport
- * @param children The children to render within the block viewport
- */
- protected void renderBlockViewport(BlockViewport bv, List children) {
- // clip and position viewport if necessary
- if (bv.getPositioning() == Block.ABSOLUTE) {
- // save positions
- int saveIP = currentIPPosition;
- int saveBP = currentBPPosition;
-
- CTM ctm = bv.getCTM();
- currentIPPosition = 0;
- currentBPPosition = 0;
-
- startVParea(ctm);
- handleBlockTraits(bv);
- renderBlocks(bv, children);
- endVParea();
-
- // clip if necessary
-
- currentIPPosition = saveIP;
- currentBPPosition = saveBP;
- } else {
- // save position and offset
- int saveIP = currentIPPosition;
- int saveBP = currentBPPosition;
-
- handleBlockTraits(bv);
- renderBlocks(bv, children);
-
- currentIPPosition = saveIP;
- currentBPPosition = saveBP + bv.getHeight();
- }
- }
-
- /**
- * Renders a list of block areas.
- *
- * @param parent the parent block if the parent is a block, otherwise
- * a null value.
- * @param blocks The block areas
- */
- protected void renderBlocks(Block parent, List blocks) {
- // the position of the containing block is used for
- // absolutely positioned areas
- int contBP = currentBPPosition;
- int contIP = currentIPPosition;
- containingBPPosition = contBP;
- containingIPPosition = contIP;
-
- for (int count = 0; count < blocks.size(); count++) {
- Object obj = blocks.get(count);
- if (obj instanceof Block) {
- containingBPPosition = contBP;
- containingIPPosition = contIP;
- renderBlock((Block) obj);
- containingBPPosition = contBP;
- containingIPPosition = contIP;
- } else {
- // a line area is rendered from the top left position
- // of the line, each inline object is offset from there
- LineArea line = (LineArea) obj;
- currentBlockIPPosition =
- currentIPPosition + line.getStartIndent();
- renderLineArea(line);
- currentBPPosition += line.getHeight();
- }
- }
- }
-
- /**
- * Renders a block area.
- *
- * @param block The block area
- */
- protected void renderBlock(Block block) {
- List children = block.getChildAreas();
- if (children == null) {
- handleBlockTraits(block);
- // simply move position
- currentBPPosition += block.getHeight();
- } else if (block instanceof BlockViewport) {
- renderBlockViewport((BlockViewport) block, children);
- } else {
- // save position and offset
- int saveIP = currentIPPosition;
- int saveBP = currentBPPosition;
-
- if (block.getPositioning() == Block.ABSOLUTE) {
- currentIPPosition = containingIPPosition + block.getXOffset();
- currentBPPosition = containingBPPosition + block.getYOffset();
-
- handleBlockTraits(block);
-
- renderBlocks(block, children);
-
- // absolute blocks do not effect the layout
- currentBPPosition = saveBP;
- } else {
- // relative blocks are offset
- currentIPPosition += block.getXOffset();
- currentBPPosition += block.getYOffset();
-
- handleBlockTraits(block);
-
- renderBlocks(block, children);
-
- // stacked and relative blocks effect stacking
- currentBPPosition = saveBP + block.getHeight();
- }
- currentIPPosition = saveIP;
- }
- }
-
- /**
- * Renders a line area. <p>
- *
- * A line area may have grouped styling for its children such as underline,
- * background.</p>
- *
- * @param line The line area
- */
- protected void renderLineArea(LineArea line) {
- List children = line.getInlineAreas();
-
- for (int count = 0; count < children.size(); count++) {
- InlineArea inline = (InlineArea) children.get(count);
- renderInlineArea(inline);
- }
- }
-
- protected void renderInlineArea(InlineArea inlineArea) {
- if (inlineArea instanceof TextArea) {
- renderText((TextArea) inlineArea);
- } else if (inlineArea instanceof InlineParent) {
- renderInlineParent((InlineParent) inlineArea);
- } else if (inlineArea instanceof Space) {
- renderInlineSpace((Space) inlineArea);
- } else if (inlineArea instanceof Character) {
- renderCharacter((Character) inlineArea);
- } else if (inlineArea instanceof Viewport) {
- renderViewport((Viewport) inlineArea);
- } else if (inlineArea instanceof Leader) {
- renderLeader((Leader) inlineArea);
- }
- }
-
-
- /** @see org.apache.fop.render.Renderer */
- protected void renderCharacter(Character ch) {
- currentBlockIPPosition += ch.getWidth();
- }
-
- /** @see org.apache.fop.render.Renderer */
- protected void renderInlineSpace(Space space) {
- // an inline space moves the inline progression position
- // for the current block by the width or height of the space
- // it may also have styling (only on this object) that needs
- // handling
- currentBlockIPPosition += space.getWidth();
- }
-
- /** @see org.apache.fop.render.Renderer */
- protected void renderLeader(Leader area) {
- currentBlockIPPosition += area.getWidth();
- }
-
- /** @see org.apache.fop.render.Renderer */
- protected void renderText(TextArea text) {
- currentBlockIPPosition += text.getWidth();
- }
-
- /** @see org.apache.fop.render.Renderer */
- protected void renderInlineParent(InlineParent ip) {
- int saveIP = currentBlockIPPosition;
- Iterator iter = ip.getChildAreas().iterator();
- while (iter.hasNext()) {
- renderInlineArea((InlineArea) iter.next());
- }
- currentBlockIPPosition = saveIP + ip.getWidth();
- }
-
- /** @see org.apache.fop.render.Renderer */
- protected void renderViewport(Viewport viewport) {
- Area content = viewport.getContent();
- int saveBP = currentBPPosition;
- currentBPPosition += viewport.getOffset();
- Rectangle2D contpos = viewport.getContentPosition();
- if (content instanceof Image) {
- renderImage((Image) content, contpos);
- } else if (content instanceof Container) {
- renderContainer((Container) content);
- } else if (content instanceof ForeignObject) {
- renderForeignObject((ForeignObject) content, contpos);
- }
- currentBlockIPPosition += viewport.getWidth();
- currentBPPosition = saveBP;
- }
-
- /**
- * Renders an image area.
- *
- * @param image The image
- * @param pos The target position of the image
- * (todo) Make renderImage() protected
- */
- public void renderImage(Image image, Rectangle2D pos) {
- // Default: do nothing.
- // Some renderers (ex. Text) don't support images.
- }
-
- /** @see org.apache.fop.render.Renderer */
- public void renderContainer(Container cont) {
- int saveIP = currentIPPosition;
- currentIPPosition = currentBlockIPPosition;
- int saveBlockIP = currentBlockIPPosition;
- int saveBP = currentBPPosition;
-
- List blocks = cont.getBlocks();
- renderBlocks(null, blocks);
- currentIPPosition = saveIP;
- currentBlockIPPosition = saveBlockIP;
- currentBPPosition = saveBP;
- }
-
- /**
- * Renders a foreign object area.
- *
- * @param fo The foreign object area
- * @param pos The target position of the foreign object
- * (todo) Make renderForeignObject() protected
- */
- public void renderForeignObject(ForeignObject fo, Rectangle2D pos) {
- // Default: do nothing.
- // Some renderers (ex. Text) don't support foreign objects.
- }
-
- /**
- * Set the default xml handler for the given mime type.
- * @param mime MIME type
- * @param handler XMLHandler to use
- */
- public void setDefaultXMLHandler(FOUserAgent foua, String mime,
- XMLHandler handler) {
- foua.defaults.put(mime, handler);
- }
+// /**
+// * Renders a region reference area.
+// *
+// * @param region The region reference area
+// */
+// protected void renderRegion(RegionReference region) {
+// List blocks = region.getBlocks();
+//
+// renderBlocks(null, blocks);
+//
+// }
+
+// /**
+// * Renders a body region area.
+// *
+// * @param region The body region
+// */
+// protected void renderBodyRegion(BodyRegion region) {
+// BeforeFloat bf = region.getBeforeFloat();
+// if (bf != null) {
+// renderBeforeFloat(bf);
+// }
+// MainReference mr = region.getMainReference();
+// if (mr != null) {
+// renderMainReference(mr);
+// }
+// Footnote foot = region.getFootnote();
+// if (foot != null) {
+// renderFootnote(foot);
+// }
+// }
+
+// /**
+// * Renders a before float area.
+// *
+// * @param bf The before float area
+// */
+// protected void renderBeforeFloat(BeforeFloat bf) {
+// List blocks = bf.getChildAreas();
+// if (blocks != null) {
+// renderBlocks(null, blocks);
+// Block sep = bf.getSeparator();
+// if (sep != null) {
+// renderBlock(sep);
+// }
+// }
+// }
+
+// /**
+// * Renders a footnote
+// *
+// * @param footnote The footnote
+// */
+// protected void renderFootnote(Footnote footnote) {
+// List blocks = footnote.getChildAreas();
+// if (blocks != null) {
+// Block sep = footnote.getSeparator();
+// if (sep != null) {
+// renderBlock(sep);
+// }
+// renderBlocks(null, blocks);
+// }
+// }
+
+// /**
+// * Renders the main reference area.
+// * <p>
+// * The main reference area contains a list of spans that are
+// * stacked on the page.
+// * The spans contain a list of normal flow reference areas
+// * that are positioned into columns.
+// * </p>
+// *
+// * @param mr The main reference area
+// */
+// protected void renderMainReference(MainReference mr) {
+// int saveIPPos = currentIPPosition;
+//
+// Span span = null;
+// List spans = mr.getSpans();
+// for (int count = 0; count < spans.size(); count++) {
+// span = (Span) spans.get(count);
+// int offset = (mr.getWidth()
+// - (span.getColumnCount() - 1) * mr.getColumnGap())
+// / span.getColumnCount() + mr.getColumnGap();
+// for (int c = 0; c < span.getColumnCount(); c++) {
+// Flow flow = (Flow) span.getFlow(c);
+//
+// renderFlow(flow);
+// currentIPPosition += offset;
+// }
+// currentIPPosition = saveIPPos;
+// currentBPPosition += span.getHeight();
+// }
+// }
+
+// /**
+// * Renders a flow reference area.
+// *
+// * @param flow The flow reference area
+// */
+// protected void renderFlow(Flow flow) {
+// // the normal flow reference area contains stacked blocks
+// List blocks = flow.getChildAreas();
+// if (blocks != null) {
+// renderBlocks(null, blocks);
+// }
+// }
+
+// /**
+// * Handle block traits.
+// * This method is called when the correct ip and bp posiiton is
+// * set. This should be overridden to draw border and background
+// * traits for the block area.
+// *
+// * @param block the block area
+// */
+// protected void handleBlockTraits(Block block) {
+// // draw border and background
+// }
+
+// /**
+// * Renders a block viewport.
+// *
+// * @param bv The block viewport
+// * @param children The children to render within the block viewport
+// */
+// protected void renderBlockViewport(BlockViewport bv, List children) {
+// // clip and position viewport if necessary
+// if (bv.getPositioning() == Block.ABSOLUTE) {
+// // save positions
+// int saveIP = currentIPPosition;
+// int saveBP = currentBPPosition;
+//
+// CoordTransformer ctm = bv.getCoordTransformer();
+// currentIPPosition = 0;
+// currentBPPosition = 0;
+//
+// startVParea(ctm);
+// handleBlockTraits(bv);
+// renderBlocks(bv, children);
+// endVParea();
+//
+// // clip if necessary
+//
+// currentIPPosition = saveIP;
+// currentBPPosition = saveBP;
+// } else {
+// // save position and offset
+// int saveIP = currentIPPosition;
+// int saveBP = currentBPPosition;
+//
+// handleBlockTraits(bv);
+// renderBlocks(bv, children);
+//
+// currentIPPosition = saveIP;
+// currentBPPosition = saveBP + bv.getHeight();
+// }
+// }
+
+// /**
+// * Renders a list of block areas.
+// *
+// * @param parent the parent block if the parent is a block, otherwise
+// * a null value.
+// * @param blocks The block areas
+// */
+// protected void renderBlocks(Block parent, List blocks) {
+// // the position of the containing block is used for
+// // absolutely positioned areas
+// int contBP = currentBPPosition;
+// int contIP = currentIPPosition;
+// containingBPPosition = contBP;
+// containingIPPosition = contIP;
+//
+// for (int count = 0; count < blocks.size(); count++) {
+// Object obj = blocks.get(count);
+// if (obj instanceof Block) {
+// containingBPPosition = contBP;
+// containingIPPosition = contIP;
+// renderBlock((Block) obj);
+// containingBPPosition = contBP;
+// containingIPPosition = contIP;
+// } else {
+// // a line area is rendered from the top left position
+// // of the line, each inline object is offset from there
+// LineArea line = (LineArea) obj;
+// currentBlockIPPosition =
+// currentIPPosition + line.getStartIndent();
+// renderLineArea(line);
+// currentBPPosition += line.getHeight();
+// }
+// }
+// }
+//
+// /**
+// * Renders a block area.
+// *
+// * @param block The block area
+// */
+// protected void renderBlock(Block block) {
+// List children = block.getChildAreas();
+// if (children == null) {
+// handleBlockTraits(block);
+// // simply move position
+// currentBPPosition += block.getHeight();
+// } else if (block instanceof BlockViewport) {
+// renderBlockViewport((BlockViewport) block, children);
+// } else {
+// // save position and offset
+// int saveIP = currentIPPosition;
+// int saveBP = currentBPPosition;
+//
+// if (block.getPositioning() == Block.ABSOLUTE) {
+// currentIPPosition = containingIPPosition + block.getXOffset();
+// currentBPPosition = containingBPPosition + block.getYOffset();
+//
+// handleBlockTraits(block);
+//
+// renderBlocks(block, children);
+//
+// // absolute blocks do not effect the layout
+// currentBPPosition = saveBP;
+// } else {
+// // relative blocks are offset
+// currentIPPosition += block.getXOffset();
+// currentBPPosition += block.getYOffset();
+//
+// handleBlockTraits(block);
+//
+// renderBlocks(block, children);
+//
+// // stacked and relative blocks effect stacking
+// currentBPPosition = saveBP + block.getHeight();
+// }
+// currentIPPosition = saveIP;
+// }
+// }
+//
+// /**
+// * Renders a line area. <p>
+// *
+// * A line area may have grouped styling for its children such as underline,
+// * background.</p>
+// *
+// * @param line The line area
+// */
+// protected void renderLineArea(LineArea line) {
+// List children = line.getInlineAreas();
+//
+// for (int count = 0; count < children.size(); count++) {
+// InlineArea inline = (InlineArea) children.get(count);
+// renderInlineArea(inline);
+// }
+// }
+//
+// protected void renderInlineArea(InlineArea inlineArea) {
+// if (inlineArea instanceof TextArea) {
+// renderText((TextArea) inlineArea);
+// } else if (inlineArea instanceof InlineParent) {
+// renderInlineParent((InlineParent) inlineArea);
+// } else if (inlineArea instanceof Space) {
+// renderInlineSpace((Space) inlineArea);
+// } else if (inlineArea instanceof Character) {
+// renderCharacter((Character) inlineArea);
+// } else if (inlineArea instanceof Viewport) {
+// renderViewport((Viewport) inlineArea);
+// } else if (inlineArea instanceof Leader) {
+// renderLeader((Leader) inlineArea);
+// }
+// }
+//
+//
+// /** @see org.apache.fop.render.Renderer */
+// protected void renderCharacter(Character ch) {
+// currentBlockIPPosition += ch.getWidth();
+// }
+//
+// /** @see org.apache.fop.render.Renderer */
+// protected void renderInlineSpace(Space space) {
+// // an inline space moves the inline progression position
+// // for the current block by the width or height of the space
+// // it may also have styling (only on this object) that needs
+// // handling
+// currentBlockIPPosition += space.getWidth();
+// }
+//
+// /** @see org.apache.fop.render.Renderer */
+// protected void renderLeader(Leader area) {
+// currentBlockIPPosition += area.getWidth();
+// }
+//
+// /** @see org.apache.fop.render.Renderer */
+// protected void renderText(TextArea text) {
+// currentBlockIPPosition += text.getWidth();
+// }
+//
+// /** @see org.apache.fop.render.Renderer */
+// protected void renderInlineParent(InlineParent ip) {
+// int saveIP = currentBlockIPPosition;
+// Iterator iter = ip.getChildAreas().iterator();
+// while (iter.hasNext()) {
+// renderInlineArea((InlineArea) iter.next());
+// }
+// currentBlockIPPosition = saveIP + ip.getWidth();
+// }
+//
+// /** @see org.apache.fop.render.Renderer */
+// protected void renderViewport(Viewport viewport) {
+// Area content = viewport.getContent();
+// int saveBP = currentBPPosition;
+// currentBPPosition += viewport.getOffset();
+// Rectangle2D contpos = viewport.getContentPosition();
+// if (content instanceof Image) {
+// renderImage((Image) content, contpos);
+// } else if (content instanceof Container) {
+// renderContainer((Container) content);
+// } else if (content instanceof ForeignObject) {
+// renderForeignObject((ForeignObject) content, contpos);
+// }
+// currentBlockIPPosition += viewport.getWidth();
+// currentBPPosition = saveBP;
+// }
+//
+// /**
+// * Renders an image area.
+// *
+// * @param image The image
+// * @param pos The target position of the image
+// * (todo) Make renderImage() protected
+// */
+// public void renderImage(Image image, Rectangle2D pos) {
+// // Default: do nothing.
+// // Some renderers (ex. Text) don't support images.
+// }
+//
+// /** @see org.apache.fop.render.Renderer */
+// public void renderContainer(Container cont) {
+// int saveIP = currentIPPosition;
+// currentIPPosition = currentBlockIPPosition;
+// int saveBlockIP = currentBlockIPPosition;
+// int saveBP = currentBPPosition;
+//
+// List blocks = cont.getBlocks();
+// renderBlocks(null, blocks);
+// currentIPPosition = saveIP;
+// currentBlockIPPosition = saveBlockIP;
+// currentBPPosition = saveBP;
+// }
+//
+// /**
+// * Renders a foreign object area.
+// *
+// * @param fo The foreign object area
+// * @param pos The target position of the foreign object
+// * (todo) Make renderForeignObject() protected
+// */
+// public void renderForeignObject(ForeignObject fo, Rectangle2D pos) {
+// // Default: do nothing.
+// // Some renderers (ex. Text) don't support foreign objects.
+// }
+//
+// /**
+// * Set the default xml handler for the given mime type.
+// * @param mime MIME type
+// * @param handler XMLHandler to use
+// */
+// public void setDefaultXMLHandler(FOUserAgent foua, String mime,
+// XMLHandler handler) {
+// foua.defaults.put(mime, handler);
+// }
/**
* Add an xml handler for the given mime type and xml namespace.
handler.handleXML(ctx, doc, namespace);
} catch (Throwable t) {
// could not handle document
- getLogger().error("Some XML content will be ignored. "
- + "Could not render XML", t);
+ log.severe("Some XML content will be ignored. "
+ + "Could not render XML\n" + t.getMessage());
}
} else {
// no handler found for document
- getLogger().warn("Some XML content will be ignored. "
+ log.warning("Some XML content will be ignored. "
+ "No handler defined for XML: " + namespace);
}
}
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;
/** 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);
- }
-
}
// 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;
/**
*/
void setUserAgent(FOUserAgent agent);
- /**
- * Set up the given FontInfo.
- *
- * @param fontInfo The fonts
- */
- void setupFontInfo(FOTreeControl foTreeControl);
-
/**
* Set up renderer options.
*
*/
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
*/
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
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);
-
}
*/
public int getXHeight(String family, int style, int size) {
setFont(family, style, size);
- return (int)(FONT_FACTOR * xHeight);
+ return (FONT_FACTOR * xHeight);
}
/**
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;
}
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);
}
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;
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;
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
+ ") 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 {
}
+
}
*/
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
import java.awt.event.ActionEvent;
//FOP
-import org.apache.fop.apps.Version;
+import org.apache.fop.version.Version;
/**
* AWT Viewer's "About" dialog.