cvs commit: xml-fop/src/codegen font-file.xsl
jeremias2004/04/03 05:36:08 Modified:src/codegen font-file.xsl Log: New function to determine whether a particular character is available for this font. Revision ChangesPath 1.16 +5 -1 xml-fop/src/codegen/font-file.xsl Index: font-file.xsl === RCS file: /home/cvs/xml-fop/src/codegen/font-file.xsl,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- font-file.xsl 27 Feb 2004 18:53:07 - 1.15 +++ font-file.xsl 3 Apr 2004 13:36:08 - 1.16 @@ -121,6 +121,10 @@ } } +public boolean hasChar(char c) { +return (mapping.mapChar(c) 0); +} + } /xsl:template - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/codegen font-file.xsl
vmote 2003/08/15 11:08:23 Modified:src/codegen font-file.xsl Log: get generated font files to use new Typeface class name Revision ChangesPath 1.14 +9 -9 xml-fop/src/codegen/font-file.xsl Index: font-file.xsl === RCS file: /home/cvs/xml-fop/src/codegen/font-file.xsl,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- font-file.xsl 7 Mar 2003 10:54:17 - 1.13 +++ font-file.xsl 15 Aug 2003 18:08:23 - 1.14 @@ -47,7 +47,7 @@ on behalf of the Apache Software Foundation and was originally created by James Tauber [EMAIL PROTECTED]. For more information on the Apache Software Foundation, please see http://www.apache.org/. --- +-- !-- This file writes the class files for the fonts (Courier.java, Helvetica.java etc.). It uses the information in the font description files (Courier.xml, Helvetica.xml) to do this. In these @@ -70,10 +70,10 @@ package org.apache.fop.fonts.base14; import org.apache.fop.fonts.FontType; -import org.apache.fop.fonts.Font; +import org.apache.fop.fonts.Typeface; import org.apache.fop.fonts.CodePointMapping; -public class xsl:value-of select=class-name/ extends Font { +public class xsl:value-of select=class-name/ extends Typeface { private final static String fontName = xsl:value-of select=font-name/; private final static String encoding = xsl:choosexsl:when test=$encoding != $native-encodingxsl:value-of select=$encoding//xsl:whenxsl:otherwisenull/xsl:otherwise/xsl:choose; private final static int capHeight = xsl:value-of select=cap-height/; @@ -96,9 +96,9 @@ } public String getFontName() { -return fontName; +return fontName; } - + public FontType getFontType() { return FontType.TYPE1; } @@ -137,15 +137,15 @@ //for( int i = 0; i lt; arr.length; i++) arr[i] *= size; return arr; } - + public boolean hasKerningInfo() { return false; } - + public java.util.Map getKerningInfo() { return java.util.Collections.EMPTY_MAP; } - + public char mapChar(char c) { char d = mapping.mapChar(c); if(d != 0) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/codegen xml-lang.xsl font-file.xsl
pbwest 2003/07/08 04:47:12 Modified:src/codegen Tag: FOP_0-20-0_Alt-Design xml-lang.xsl font-file.xsl Log: Modified Id keyword in CDATA to prevent expansion in xsl file. Revision ChangesPath No revision No revision 1.1.2.2 +13 -14xml-fop/src/codegen/Attic/xml-lang.xsl Index: xml-lang.xsl === RCS file: /home/cvs/xml-fop/src/codegen/Attic/xml-lang.xsl,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- xml-lang.xsl 5 Jul 2003 19:58:43 - 1.1.2.1 +++ xml-lang.xsl 8 Jul 2003 11:47:12 - 1.1.2.2 @@ -1,10 +1,9 @@ ?xml version=1.0 encoding=iso-8859-1? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; - xsl:output method=text encoding=iso-8859-1/ - -xsl:variable name=licence![CDATA[/* - * $Id$ + !-- $Id$ -- + xsl:variable name=licence![CDATA[/* + * $Id]]![CDATA[$ * *The Apache Software License, Version 1.1 * @@ -57,16 +56,16 @@ * Automatically generated from xml-lang.xml by xml-lang.xsl. DO NOT EDIT! *! */]] -/xsl:variable - !-- - This XSL file is used to generate the file - org/apache/fop/datatypes/CountryLanguageScript.java - from the input file - xml-lang.xml - found in the conf directory. - -- - xsl:template match=xml-lang -xsl:value-of select=$licence/ +/xsl:variable +!-- + This XSL file is used to generate the file + org/apache/fop/datatypes/CountryLanguageScript.java + from the input file + xml-lang.xml + found in the conf directory. -- +xsl:output method=text encoding=iso-8859-1/ +xsl:template match=xml-lang + xsl:value-of select=$licence/ xsl:variable name=languages xsl:value-of select=count(./languagecodes/language)/ /xsl:variable 1.8.4.2 +5 -5 xml-fop/src/codegen/font-file.xsl Index: font-file.xsl === RCS file: /home/cvs/xml-fop/src/codegen/font-file.xsl,v retrieving revision 1.8.4.1 retrieving revision 1.8.4.2 diff -u -r1.8.4.1 -r1.8.4.2 --- font-file.xsl 5 Jul 2003 20:20:23 - 1.8.4.1 +++ font-file.xsl 8 Jul 2003 11:47:12 - 1.8.4.2 @@ -1,10 +1,9 @@ ?xml version=1.0 encoding=iso-8859-1? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; - - xsl:output method=text/ -xsl:variable name=licence![CDATA[/* - * $Id$ + !-- $Id$ -- + xsl:variable name=licence![CDATA[/* + * $Id]]![CDATA[$ * *The Apache Software License, Version 1.1 * @@ -57,7 +56,8 @@ * Automatically generated by font-file.xsl. DO NOT EDIT! * */]] -/xsl:variable +/xsl:variable +xsl:output method=text/ !-- This file writes the class files for the fonts (Courier.java, Helvetica.java etc.). It uses the information in the font description files (Courier.xml, Helvetica.xml) to do this. In these - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
font-file.xsl
Font gurus, In what circumstances are t1font-file.xsl and ttffontfile.xsl used? -- Peter B. West http://www.powerup.com.au/~pbwest/resume.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: font-file.xsl
Tore, Thanks. That was my impression. It also looks as though charlist.xml has been superseded by glyphlist.xml. Peter Tore Engvig wrote: I don't think t1font-file.xsl and ttffontfile.xsl are in use any more. The first version of font embedding worked just as the creation of the 14 standard fonts: You had to create a metric file, and then use t1font-file.xsl or ttffontfile.xsl to create a java source file containing the metrics (I think the 14 standardfonts stille use font-file.xsl for this purpose?). I don't think these files have been updated lately, and that they will probably generate invalid code - so basically they could be removed. -- Peter B. West http://www.powerup.com.au/~pbwest/resume.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
cvs commit: xml-fop/src/codegen font-file.xsl
pbwest 2003/07/05 13:20:23 Modified:src/codegen Tag: FOP_0-20-0_Alt-Design font-file.xsl Log: Added the licence and its inclusion in the generated file. Revision ChangesPath No revision No revision 1.8.4.1 +114 -35 xml-fop/src/codegen/font-file.xsl Index: font-file.xsl === RCS file: /home/cvs/xml-fop/src/codegen/font-file.xsl,v retrieving revision 1.8 retrieving revision 1.8.4.1 diff -u -r1.8 -r1.8.4.1 --- font-file.xsl 16 Nov 2000 19:19:25 - 1.8 +++ font-file.xsl 5 Jul 2003 20:20:23 - 1.8.4.1 @@ -1,33 +1,88 @@ -!-- -This files writes the class files for the fonts (Courier.java, Helvetica.java etc.). -It uses the information in the font description files (Courier.xml, Helvetica.xml) to this -In these font description files each character is referenced by its adobe name: - char name=A width=667/ -To resolve this name and to find the code for this character it looks up the adobe name in the -file charlist.xml and extracts the WinAnsi code. --- - +?xml version=1.0 encoding=iso-8859-1? xsl:stylesheet version=1.0 -xmlns:xsl=http://www.w3.org/1999/XSL/Transform; -xmlns:lxslt=http://xml.apache.org/xslt; -xmlns:redirect=org.apache.xalan.xslt.extensions.Redirect -extension-element-prefixes=redirect -xsl:output method=text / - -!-- note that match in xsl:key doesn't like document('charlist.xml'), so the charlist - must be merged with the source xml at build time by the Xslt task -- -xsl:key name=adobe-char-map match=/font-metrics/font-mappings/map use=@adobe-name/ - -xsl:template match=font-metrics -xsl:variable name=class-name select=class-name/ -!--redirect:write select=concat('org/apache/fop/render/pdf/fonts/', $class-name, '.java')-- -package org.apache.fop.render.pdf.fonts; +xmlns:xsl=http://www.w3.org/1999/XSL/Transform; -import org.apache.fop.render.pdf.Font; + xsl:output method=text/ +xsl:variable name=licence![CDATA[/* + * $Id$ + * + *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 + *[EMAIL PROTECTED] + * + * 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
cvs commit: xml-fop/src/codegen ttffontfile.xsl propinc.xsl font-file.xsl properties.xsl enumgen.xsl t1font-file.xsl propmaker.xsl code-point-mapping.xsl propmap.xsl genconst.xsl
jeremias2003/03/07 02:54:17 Modified:src/codegen ttffontfile.xsl propinc.xsl font-file.xsl properties.xsl enumgen.xsl t1font-file.xsl propmaker.xsl code-point-mapping.xsl propmap.xsl genconst.xsl Log: Add license header Revision ChangesPath 1.4 +50 -0 xml-fop/src/codegen/ttffontfile.xsl Index: ttffontfile.xsl === RCS file: /home/cvs/xml-fop/src/codegen/ttffontfile.xsl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ttffontfile.xsl 29 Nov 2002 23:18:51 - 1.3 +++ ttffontfile.xsl 7 Mar 2003 10:54:17 - 1.4 @@ -1,4 +1,54 @@ !-- +$Id$ + + 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 + [EMAIL PROTECTED] + +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 [EMAIL PROTECTED]. For more information on the Apache +Software Foundation, please see http://www.apache.org/. +-- +!-- This files writes the class files for the Adobe Type 1 fonts. It uses the information in the font description files (Courier.xml, Helvetica.xml) to this In these font description files each character is referenced by its adobe name: 1.5 +50 -0 xml-fop/src/codegen/propinc.xsl Index: propinc.xsl === RCS file: /home/cvs/xml-fop/src/codegen/propinc.xsl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- propinc.xsl 29 Nov 2002 23:18:51 - 1.4 +++ propinc.xsl 7 Mar 2003 10:54:17 - 1.5 @@ -1,3 +1,53 @@ +!-- +$Id$ + + 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
cvs commit: xml-fop/src/codegen font-file.xsl code-point-mapping.xsl
jeremias2003/01/08 06:11:29 Modified:src/codegen font-file.xsl code-point-mapping.xsl Log: Adjustments for font refactoring Revision ChangesPath 1.12 +29 -15xml-fop/src/codegen/font-file.xsl Index: font-file.xsl === RCS file: /home/cvs/xml-fop/src/codegen/font-file.xsl,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- font-file.xsl 29 Nov 2002 23:18:51 - 1.11 +++ font-file.xsl 8 Jan 2003 14:11:29 - 1.12 @@ -17,10 +17,11 @@ xsl:variable name=glyphs select=document('encodings.xml')/encoding-set/encoding[@id=$encoding]/glyph/ xsl:template match=font-metrics -package org.apache.fop.render.pdf.fonts; +package org.apache.fop.fonts.base14; -import org.apache.fop.render.pdf.Font; -import org.apache.fop.render.pdf.CodePointMapping; +import org.apache.fop.fonts.FontType; +import org.apache.fop.fonts.Font; +import org.apache.fop.fonts.CodePointMapping; public class xsl:value-of select=class-name/ extends Font { private final static String fontName = xsl:value-of select=font-name/; @@ -32,20 +33,24 @@ private final static int firstChar = xsl:value-of select=first-char/; private final static int lastChar = xsl:value-of select=last-char/; private final static int[] width; -private final CodePointMapping mapping -= CodePointMapping.getMapping(xsl:value-of select=$encoding/); +private final CodePointMapping mapping = +CodePointMapping.getMapping(xsl:value-of select=$encoding/); static { width = new int[256]; xsl:apply-templates select=widths/ } -public String encoding() { +public String getEncoding() { return encoding; } -public String fontName() { -return fontName; +public String getFontName() { +return fontName; +} + +public FontType getFontType() { +return FontType.TYPE1; } public int getAscender(int size) { @@ -72,23 +77,32 @@ return lastChar; } -public int width(int i,int size) { +public int getWidth(int i,int size) { return size * width[i]; } -public int[] getWidths(int size) { +public int[] getWidths() { int[] arr = new int[getLastChar()-getFirstChar()+1]; System.arraycopy(width, getFirstChar(), arr, 0, getLastChar()-getFirstChar()+1); -for( int i = 0; i lt; arr.length; i++) arr[i] *= size; +//for( int i = 0; i lt; arr.length; i++) arr[i] *= size; return arr; } - + +public boolean hasKerningInfo() { +return false; +} + +public java.util.Map getKerningInfo() { +return java.util.Collections.EMPTY_MAP; +} + public char mapChar(char c) { char d = mapping.mapChar(c); - if(d != 0) +if(d != 0) { return d; -else - return '#'; +} else { +return '#'; +} } } 1.9 +3 -3 xml-fop/src/codegen/code-point-mapping.xsl Index: code-point-mapping.xsl === RCS file: /home/cvs/xml-fop/src/codegen/code-point-mapping.xsl,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- code-point-mapping.xsl17 Sep 2002 09:28:59 - 1.8 +++ code-point-mapping.xsl8 Jan 2003 14:11:29 - 1.9 @@ -5,9 +5,9 @@ select=document('glyphlist.xml')/glyphlist-set/ xsl:template match=encoding-set -package org.apache.fop.render.pdf; +package org.apache.fop.fonts; + import java.util.Map; -import java.util.HashMap; import java.util.Collections; public class CodePointMapping { @@ -65,7 +65,7 @@ private static Map mappings; static { -mappings = Collections.synchronizedMap(new HashMap()); +mappings = Collections.synchronizedMap(new java.util.HashMap()); } public static CodePointMapping getMapping(String encoding) { CodePointMapping mapping = (CodePointMapping) mappings.get(encoding); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/codegen font-file.xsl
klease 01/08/26 07:23:04 Modified:src/codegen font-file.xsl Log: Use the key function with the external charlist.xml file so no need for mergefile Revision ChangesPath 1.9 +7 -5 xml-fop/src/codegen/font-file.xsl Index: font-file.xsl === RCS file: /home/cvs/xml-fop/src/codegen/font-file.xsl,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- font-file.xsl 2000/11/16 19:19:25 1.8 +++ font-file.xsl 2001/08/26 14:23:04 1.9 @@ -14,10 +14,10 @@ extension-element-prefixes=redirect xsl:output method=text / -!-- note that match in xsl:key doesn't like document('charlist.xml'), so the charlist - must be merged with the source xml at build time by the Xslt task -- -xsl:key name=adobe-char-map match=/font-metrics/font-mappings/map use=@adobe-name/ +!-- Note: this key is used with charlist.xml in a for-each. -- +xsl:key name=adobe-char-map match=map use=@adobe-name/ + xsl:template match=font-metrics xsl:variable name=class-name select=class-name/ !--redirect:write select=concat('org/apache/fop/render/pdf/fonts/', $class-name, '.java')-- @@ -38,8 +38,10 @@ static { width = new int[256]; -xsl:for-each select=widths/charxsl:variable name=char-name select=@name/xsl:variable name=char-num select=key('adobe-char-map',$char-name)/@win-ansi/xsl:if test=$char-num!='-1' width[xsl:value-of select=$char-num/] = xsl:value-of select=@width/; -/xsl:if/xsl:for-each +xsl:for-each select=widths/charxsl:variable name=char-name select=@name/xsl:variable name=char-width select=@width/ +xsl:for-each select=document('charlist.xml')xsl:variable name=char-num select=key('adobe-char-map',$char-name)/@win-ansi/ +xsl:if test=$char-num!='-1'width[xsl:value-of select=$char-num/] = xsl:value-of select=$char-width/; +/xsl:if/xsl:for-each/xsl:for-each } public String encoding() { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]