cvs commit: xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc RtfTableRow.java

2003-07-04 Thread vmote
vmote   2003/07/03 23:28:34

  Modified:src/java/org/apache/fop/rtf/rtflib/rtfdoc RtfTableRow.java
  Log:
  extract method adjustBorderProperties from writeRtfContent, primarily to satisfy 
checkstyle requirements for method size.
  
  Revision  ChangesPath
  1.7   +25 -20
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableRow.java
  
  Index: RtfTableRow.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableRow.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RtfTableRow.java  3 Jul 2003 19:14:47 -   1.6
  +++ RtfTableRow.java  4 Jul 2003 06:28:34 -   1.7
  @@ -177,25 +177,8 @@
   
   writePaddingAttributes();
   
  -// if we have attributes, manipulate border properties
   final RtfTable parentTable = (RtfTable) parent;
  -if (attrib != null  parentTable != null) {
  -
  -//if table is only one row long
  -if (isFirstRow()  parentTable.isHighestRow(id)) {
  -attrib.unset(ITableAttributes.ROW_BORDER_HORIZONTAL);
  -//or if row is the first row
  -} else if (isFirstRow()) {
  -attrib.unset(ITableAttributes.ROW_BORDER_BOTTOM);
  -//or if row is the last row
  -} else if (parentTable.isHighestRow(id)) {
  -attrib.unset(ITableAttributes.ROW_BORDER_TOP);
  -//else the row is an inside row
  -} else {
  -attrib.unset(ITableAttributes.ROW_BORDER_BOTTOM);
  -attrib.unset(ITableAttributes.ROW_BORDER_TOP);
  -}
  -}
  +adjustBorderProperties(parentTable);
   
   writeAttributes(attrib, ITableAttributes.ROW_BORDER);
   writeAttributes(attrib, ITableAttributes.CELL_BORDER);
  @@ -203,7 +186,8 @@
   
   /**
* Added by Boris POUDEROUS on 07/02/2002
  - * in order to get the indexes of the cells preceding a cell that contains 
a nested table.
  + * in order to get the indexes of the cells preceding a cell that
  + * contains a nested table.
* Thus, the cells of the extra row will be merged with the cells above.
*/
   boolean nestedTableFound = false;
  @@ -313,6 +297,27 @@
   
   // now children can write themselves, we have the correct RTF prefix code
   super.writeRtfContent();
  +}
  +
  +private void adjustBorderProperties(RtfTable parentTable) {
  +// if we have attributes, manipulate border properties
  +if (attrib != null  parentTable != null) {
  +
  +//if table is only one row long
  +if (isFirstRow()  parentTable.isHighestRow(id)) {
  +attrib.unset(ITableAttributes.ROW_BORDER_HORIZONTAL);
  +//or if row is the first row
  +} else if (isFirstRow()) {
  +attrib.unset(ITableAttributes.ROW_BORDER_BOTTOM);
  +//or if row is the last row
  +} else if (parentTable.isHighestRow(id)) {
  +attrib.unset(ITableAttributes.ROW_BORDER_TOP);
  +//else the row is an inside row
  +} else {
  +attrib.unset(ITableAttributes.ROW_BORDER_BOTTOM);
  +attrib.unset(ITableAttributes.ROW_BORDER_TOP);
  +}
  +}
   }
   
   /**
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/src/java/org/apache/fop/rtf/rtflib/tools ImageConstants.java

2003-07-04 Thread vmote
vmote   2003/07/04 00:04:50

  Modified:src/java/org/apache/fop/rtf/rtflib/interfaces
ITableColumnsInfo.java
   src/java/org/apache/fop/rtf/rtflib/rtfdoc RtfTemplate.java
RtfText.java
   src/java/org/apache/fop/rtf/rtflib/tools ImageConstants.java
  Log:
  style changes only, mostly javadoc comments and refactoring of names
  
  Revision  ChangesPath
  1.6   +2 -1  
xml-fop/src/java/org/apache/fop/rtf/rtflib/interfaces/ITableColumnsInfo.java
  
  Index: ITableColumnsInfo.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/interfaces/ITableColumnsInfo.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ITableColumnsInfo.java30 Jun 2003 22:00:53 -  1.5
  +++ ITableColumnsInfo.java4 Jul 2003 07:04:49 -   1.6
  @@ -63,6 +63,7 @@
*/
   
   public interface ITableColumnsInfo {
  +/** value for invalid column width */
   float INVALID_COLUM_WIDTH = 200f;
   
   /** reset the column iteration index, meant to be called when creating a new 
row */
  
  
  
  1.5   +4 -4  
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTemplate.java
  
  Index: RtfTemplate.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTemplate.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RtfTemplate.java  30 Jun 2003 01:31:15 -  1.4
  +++ RtfTemplate.java  4 Jul 2003 07:04:50 -   1.5
  @@ -95,9 +95,9 @@
   
   
   /**
  - *Set the template file and adjust tha path separator
  - *
  - [EMAIL PROTECTED] templateFilePath The full path of the template
  + * Set the template file and adjust tha path separator
  + * @param templateFilePath The full path of the template
  + * @throws IOException for I/O problems
**/
   public void setTemplateFilePath(String templateFilePath) throws IOException {
   // no validity checks here - leave this to the RTF client
  
  
  
  1.6   +93 -48xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfText.java
  
  Index: RtfText.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfText.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RtfText.java  2 Jul 2003 16:59:54 -   1.5
  +++ RtfText.java  4 Jul 2003 07:04:50 -   1.6
  @@ -80,81 +80,113 @@
   private static final int CHAR_BOLD_END = 131;
   
   /** members */
  -private String m_text;
  -private final RtfAttributes m_attr;
  +private String text;
  +private final RtfAttributes attr;
   
   
   /** RtfText attributes: attribute names are RTF control word names to avoid
*  additional mapping */
  +/** constant for bold */
   public static final String ATTR_BOLD = b;
  +/** constant for italic */
   public static final String ATTR_ITALIC = i;
  +/** constant for underline */
   public static final String ATTR_UNDERLINE = ul;
  +/** constant for font size */
   public static final String ATTR_FONT_SIZE = fs;
  +/** constant for font family */
   public static final String ATTR_FONT_FAMILY = f;
  +/** constant for font color */
   public static final String ATTR_FONT_COLOR = cf;
  +/** constant for background color */
   public static final String ATTR_BACKGROUND_COLOR = chcbpat; // Added by Boris 
on 06/25//02
   
   /** RtfText attributes: alignment attributes */
  -public static String ALIGN_CENTER = qc;
  -public static String ALIGN_LEFT = ql;
  -public static String ALIGN_RIGHT = qr;
  -public static String ALIGN_JUSTIFIED = qj;
  -public static String ALIGN_DISTRIBUTED = qd;
  +/** constant for align center */
  +public static final String ALIGN_CENTER = qc;
  +/** constant for align left */
  +public static final String ALIGN_LEFT = ql;
  +/** constant for align right */
  +public static final String ALIGN_RIGHT = qr;
  +/** constant for align justified */
  +public static final String ALIGN_JUSTIFIED = qj;
  +/** constant for align distributed */
  +public static final String ALIGN_DISTRIBUTED = qd;
   
   /** RtfText attributes: border attributes */
   //added by Chris Scott
  -public static String BDR_BOTTOM_SINGLE = brdrb\\brsp40\\brdrs;
  -public static String BDR_BOTTOM_DOUBLE = brdrb\\brsp40\\brdrdb;
  -public static String BDR_BOTTOM_EMBOSS = brdrb\\brsp40\\brdremboss;
  -public static String BDR_BOTTOM_DOTTED = brdrb\\brsp40\\brdrdot;
  -public static String BDR_BOTTOM_DASH = brdrb\\brsp40\\brdrdash;
  +/** constant for bottom single 

Re: Build environment for alt.design

2003-07-04 Thread Glen Mazza
[Happy Independence Day, fellow Americans!]

--- Peter B. West [EMAIL PROTECTED] wrote:
 The basic build principles that I will implement
 include:
 
 * No code generation or modification for normal
 builds.
 * All generated code and data maintained in CVS.
 

I don't think you have to bother with this.  This is
akin to storing binaries in CVS--kind of messy.

 This is primarily to ease the introduction to the
 code for newcomers, 
 but also to rationalise the basic working
 environment for development. 

But Peter--isn't the developer IQ  work ethic
required to constructively help on FOTreeBuilding,
Area Tree/Layout, Rendering, etc. far greater than
whatever would be needed to understand automatic code
generation?

I am too stupid  lazy to look into build/src for
autogenerated code but Hey, FOP Team, let me help
you out on that Area Tree redesign you have there is
a contradiction.  

As a relative newcomer, I can tell you--There is a
*ton* of FOP I still don't understand--Area Tree
creations, fonts, Renderer's etc. (and *feel free* to
make that more understandable!) But this has 0.00% to
do with autogenerated code. 

Rather, I just haven't gotten to those areas of code
yet, also I wouldn't be surprised if cerebral
limitations also kick in more than I would like along
the way.  So with every other potential developer.

 Once the code generation step is separated, normal
 builds can monitor 
 the state of the generated code by a) checking
 creation dates of 
 generated files and their sources and b) performing
 cvs diffs against 
 the repository.  For a normal build, I would simply
 check timestamps, 
 while for a distribution build I would enforce a
 repository check.
 
 In the normal case, inconsistencies in the generated
 code would halt the 
 build.  A property could be defined to override this
 from the command 
 line or from build-local.properties.
 

All this to avoid a minute or two of extra build
time?--it doesn't seem worth the headache.

Glen


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



Re: JPEG images in Postscript

2003-07-04 Thread Jeremias Maerki
Moving to fop-dev because it gets technical...

After a lot of searching I think I know what's wrong. It's not the
ASCII-85 filter behaving wrong. Chris' JPEG images contain trailing
zero's after the FFD9 (EOI, end of image marker) which fill the images
up to 16384 bytes. Now, I guess the error happens because the DCTDecode
filter stops working after encountering the EOI marker. Because there is
still some data unprocessed and because of the way images are currently
written to PostScript this leads to an error.

I'm currently figuring out how best to solve this. I'm looking at the
code from jpeg2ps which doesn't seem to have a problem with these JPEG
files. The code in there is made to ignore any trailing bytes but
processes the whole stream twice if I interpret correctly. Maybe looking
for the EOI marker in our code and cutting off there is better
performance-wise. But jpeg2ps' code is on the safe side in any case.
Preferences anyone?

On 01.07.2003 17:59:52 Jeremias Maerki wrote:
 Correction: I've just dropped my current ASCII85OutputStream in the
 maintenance branch but the bug persists. There's must be another one.
 Will investigate.
 
 On 01.07.2003 17:18:20 Jeremias Maerki wrote:
  Almost suspected itI believe it's a bug in the ASCII-85 encoder
  which I've fixed in the redesign but haven't been able to upload, yet.
  I'll be able to fix the bug for the maintenance branch later this week.


Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



error compiling HEAD (need GraphicsConfiguration.java)

2003-07-04 Thread Glen Mazza
I can't compile the CVS - HEAD of FOP.  Unless I've
gotten something wrong, this file:

http://cvs.apache.org/viewcvs.cgi/xml-fop/src/java/org/apache/fop/svg/PDFGraphicsConfiguration.java?rev=1.1content-type=text/vnd.viewcvs-markup

is extending a GraphicsConfiguration.java that
apparently needs to be added to CVS.

Thanks,
Glen

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



Re: Build environment for alt.design

2003-07-04 Thread Ralph LaChance
At 12:20 PM 7/4/2003, you wrote:
[Happy Independence Day, fellow Americans!]
and I always like to remind fellow Americans that
the British call this Thanksgiving Day...


' Best,
-Ralph LaChance


In theory, there is no difference between
theory and practice, but in practice there is.
(Jan L.A. van de Snepsheut (1953-1994), late of CalTech)



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


Re: error compiling HEAD (need GraphicsConfiguration.java)

2003-07-04 Thread Glen Mazza
Never mind.  xml-fop/src/java-1.4 directory needed
updating.  Had to do a cvs update w/ -d option first.

Glen

--- Glen Mazza [EMAIL PROTECTED] wrote:
 I can't compile the CVS - HEAD of FOP.  Unless I've
 gotten something wrong, this file:
 

http://cvs.apache.org/viewcvs.cgi/xml-fop/src/java/org/apache/fop/svg/PDFGraphicsConfiguration.java?rev=1.1content-type=text/vnd.viewcvs-markup
 
 is extending a GraphicsConfiguration.java that
 apparently needs to be added to CVS.
 
 Thanks,
 Glen
 


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



cvs commit: xml-fop/src/java/org/apache/fop/fo FOTreeBuilder.java

2003-07-04 Thread gmazza
gmazza  2003/07/04 11:45:48

  Modified:src/java/org/apache/fop/apps Driver.java
   src/java/org/apache/fop/fo FOTreeBuilder.java
  Log:
  FOTreeBuilder's ElementMapping initialization moved from Driver to FOTreeBuilder 
class.
  
  For embedded coding, AddElementMapping() functions retained in Driver class but 
reimplemented to just wrap the FOTreeBuilder versions.
  
  Revision  ChangesPath
  1.8   +3 -136xml-fop/src/java/org/apache/fop/apps/Driver.java
  
  Index: Driver.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/Driver.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Driver.java   29 Jun 2003 19:34:33 -  1.7
  +++ Driver.java   4 Jul 2003 18:45:48 -   1.8
  @@ -81,13 +81,7 @@
   // Java
   import java.io.BufferedReader;
   import java.io.IOException;
  -import java.io.InputStream;
  -import java.io.InputStreamReader;
   import java.io.OutputStream;
  -import java.io.Reader;
  -import java.util.Enumeration;
  -import java.util.Iterator;
  -import java.util.List;
   import java.util.Map;
   
   /**
  @@ -277,7 +271,6 @@
   }
   treeBuilder = new FOTreeBuilder();
   treeBuilder.setUserAgent(getUserAgent());
  -setupDefaultMappings();
   }
   
   /**
  @@ -392,31 +385,6 @@
   }
   
   /**
  - * Sets all the element and property list mappings to their default values.
  - *
  - */
  -public void setupDefaultMappings() {
  -addElementMapping(org.apache.fop.fo.FOElementMapping);
  -addElementMapping(org.apache.fop.svg.SVGElementMapping);
  -addElementMapping(org.apache.fop.extensions.ExtensionElementMapping);
  -
  -// add mappings from available services
  -Iterator providers =
  -Service.providers(org.apache.fop.fo.ElementMapping.class);
  -if (providers != null) {
  -while (providers.hasNext()) {
  -String str = (String)providers.next();
  -try {
  -addElementMapping(str);
  -} catch (IllegalArgumentException e) {
  -getLogger().warn(Error while adding element mapping, e);
  -}
  -
  -}
  -}
  -}
  -
  -/**
* Shortcut to set the rendering type to use. Must be one of
* ul
* liRENDER_PDF/li
  @@ -539,7 +507,7 @@
* @param mapping the element mappingto add
*/
   public void addElementMapping(ElementMapping mapping) {
  -mapping.addToBuilder(treeBuilder);
  +treeBuilder.addElementMapping(mapping);
   }
   
   /**
  @@ -547,25 +515,8 @@
* @param mappingClassName the class name representing the element mapping.
* @throws IllegalArgumentException if there was not such element mapping.
*/
  -public void addElementMapping(String mappingClassName)
  -throws IllegalArgumentException {
  -try {
  -ElementMapping mapping =
  -(ElementMapping)Class.forName(mappingClassName).newInstance();
  -addElementMapping(mapping);
  -} catch (ClassNotFoundException e) {
  -throw new IllegalArgumentException(Could not find 
  -   + mappingClassName);
  -} catch (InstantiationException e) {
  -throw new IllegalArgumentException(Could not instantiate 
  -   + mappingClassName);
  -} catch (IllegalAccessException e) {
  -throw new IllegalArgumentException(Could not access 
  -   + mappingClassName);
  -} catch (ClassCastException e) {
  -throw new IllegalArgumentException(mappingClassName
  -   +  is not an ElementMapping);
  -}
  +public void addElementMapping(String mappingClassName) {
  +treeBuilder.addElementMapping(mappingClassName);
   }
   
   /**
  @@ -698,90 +649,6 @@
   } else {
   render(reader, source);
   }
  -}
  -
  -}
  -
  -// code stolen from org.apache.batik.util and modified slightly
  -// does what sun.misc.Service probably does, but it cannot be relied on.
  -// hopefully will be part of standard jdk sometime.
  -
  -/**
  - * This class loads services present in the class path.
  - */
  -class Service {
  -
  -private static Map providerMap = new java.util.Hashtable();
  -
  -public static synchronized Iterator providers(Class cls) {
  -ClassLoader cl = cls.getClassLoader();
  -// null if loaded by bootstrap class loader
  -if (cl == null) {
  -cl = ClassLoader.getSystemClassLoader();
  -}
  -String serviceFile = META-INF/services/ + 

cvs commit: xml-fop/src/org/apache/fop/render/ps PSRenderer.java

2003-07-04 Thread jeremias
jeremias2003/07/04 11:53:41

  Modified:src/org/apache/fop/render/ps Tag: fop-0_20_2-maintain
PSRenderer.java
  Log:
  Bugfix for certain JPEG images that contain garbage after the EOI marker.
  Adds error handling in case rendering an image fails in PS interpreter.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.15.2.21 +30 -16xml-fop/src/org/apache/fop/render/ps/Attic/PSRenderer.java
  
  Index: PSRenderer.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/ps/Attic/PSRenderer.java,v
  retrieving revision 1.15.2.20
  retrieving revision 1.15.2.21
  diff -u -r1.15.2.20 -r1.15.2.21
  --- PSRenderer.java   20 Jun 2003 13:34:48 -  1.15.2.20
  +++ PSRenderer.java   4 Jul 2003 18:53:40 -   1.15.2.21
  @@ -624,6 +624,23 @@
   
   write(x +   + (y - h) +  translate);
   write(w +   + h +  scale);
  +
  +write(mark {{);
  +// Template: (RawData is used for the EOF signal only)
  +// write(/RawData currentfile first filter filter def);
  +// write(/Data RawData second filter third filter [...] def);
  +if (img instanceof JpegImage) {
  +write(/RawData currentfile /ASCII85Decode filter def);
  +write(/Data RawData   /DCTDecode filter def);
  +} else {
  +if (this.psLevel = 3) {
  +write(/RawData currentfile /ASCII85Decode filter def);
  +write(/Data RawData /FlateDecode filter def);
  +} else {
  +write(/RawData currentfile /ASCII85Decode filter def);
  +write(/Data RawData /RunLengthDecode filter def);
  +}
  +}
   write();
   write(  /ImageType 1);
   write(  /Width  + img.getWidth());
  @@ -643,22 +660,17 @@
   write(  /ImageMatrix [ + img.getWidth() +  0 0 -
 + img.getHeight() +  0  + img.getHeight() + ]);
   
  -if (img instanceof JpegImage) {
  -write(  /DataSource currentfile /ASCII85Decode filter /DCTDecode 
filter);
  -} else {
  -if (this.psLevel = 3) {
  -write(  /DataSource currentfile /ASCII85Decode filter 
/FlateDecode filter);
  -} else {
  -write(  /DataSource currentfile /ASCII85Decode filter 
/RunLengthDecode filter);
  -}
  -}
  -// write(  /DataSource currentfile /ASCIIHexDecode filter /FlateDecode 
filter);
  -// write(  /DataSource currentfile /ASCIIHexDecode filter 
/RunLengthDecode filter);
  -// write(  /DataSource currentfile /ASCIIHexDecode filter);
  -// write(  /DataSource currentfile /ASCII85Decode filter);
  -// write(  /DataSource currentfile /RunLengthDecode filter);
  +write(  /DataSource Data);
   write();
   write(image);
  +/* the following two lines could be enabled if something still goes 
wrong
  + * write(Data closefile);
  + * write(RawData flushfile);
  + */
  +write(} stopped {handleerror} if);
  +write(  cleartomark);
  +write(  RawData flushfile);
  +write(} exec);
   
   /*
* for (int y=0; yimg.getHeight(); y++) {
  @@ -679,7 +691,9 @@
   // imgmap[0] = 1;
   OutputStream out = this.out;
   out = new ASCII85OutputStream(out);
  -if (!(img instanceof JpegImage)) {
  +if (img instanceof JpegImage) {
  +//nop
  +} else {
   if (this.psLevel = 3) {
   out = new FlateEncodeOutputStream(out);
   } else {
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/src/org/apache/fop/render/ps PSRenderer.java

2003-07-04 Thread jeremias
jeremias2003/07/04 12:07:43

  Modified:src/org/apache/fop/render/ps Tag: fop-0_20_2-maintain
PSRenderer.java
  Log:
  Make Distiller complain less.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.15.2.22 +2 -3  xml-fop/src/org/apache/fop/render/ps/Attic/PSRenderer.java
  
  Index: PSRenderer.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/ps/Attic/PSRenderer.java,v
  retrieving revision 1.15.2.21
  retrieving revision 1.15.2.22
  diff -u -r1.15.2.21 -r1.15.2.22
  --- PSRenderer.java   4 Jul 2003 18:53:40 -   1.15.2.21
  +++ PSRenderer.java   4 Jul 2003 19:07:43 -   1.15.2.22
  @@ -625,7 +625,7 @@
   write(x +   + (y - h) +  translate);
   write(w +   + h +  scale);
   
  -write(mark {{);
  +write({{);
   // Template: (RawData is used for the EOF signal only)
   // write(/RawData currentfile first filter filter def);
   // write(/Data RawData second filter third filter [...] def);
  @@ -668,7 +668,6 @@
* write(RawData flushfile);
*/
   write(} stopped {handleerror} if);
  -write(  cleartomark);
   write(  RawData flushfile);
   write(} exec);
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Java source encoding (was Re: [RTF] Jfor integration)

2003-07-04 Thread J.Pietschmann
Bertrand Delacretaz wrote:
Sure - it is by accident that comments in the jfor source code contains 
non-ASCII chars (in people's names IIRC).
OOps, I didn't think about that. We could
a) Force ISO-8859-1 for all Java source files in the build file.
   Is this a discrimination of, ummm, non-western contributors
   who might want to have their names in their native script
   in the files?
b) Keep a list of Java source files which need a different encoding
  and force ISO-8859-1 on the rest
c) Switch to UTF-8. Eclipse can deal with UTF-8. Users of other
  IDEs are, to a large part, screwed.
J.Pietschmann



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


cvs commit: xml-fop/src/java/org/apache/fop/render/pdf FontSetup.java

2003-07-04 Thread jeremias
jeremias2003/07/04 12:25:51

  Modified:src/java/org/apache/fop/render/pdf FontSetup.java
  Log:
  Use code from the new FontUtil class.
  
  Revision  ChangesPath
  1.4   +2 -21 xml-fop/src/java/org/apache/fop/render/pdf/FontSetup.java
  
  Index: FontSetup.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/pdf/FontSetup.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FontSetup.java3 Apr 2003 12:51:27 -   1.3
  +++ FontSetup.java4 Jul 2003 19:25:51 -   1.4
  @@ -55,6 +55,7 @@
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.fop.fonts.Font;
   import org.apache.fop.fonts.FontDescriptor;
  +import org.apache.fop.fonts.FontUtil;
   import org.apache.fop.fonts.LazyFont;
   import org.apache.fop.layout.FontInfo;
   import org.apache.fop.pdf.PDFDocument;
  @@ -229,27 +230,7 @@
   for (int c = 0; c  triplets.size(); c++) {
   FontTriplet triplet = (FontTriplet)triplets.get(c);
   
  -int weight = 400;
  -try {
  -weight = Integer.parseInt(triplet.getWeight());
  -weight = ((int)weight / 100) * 100;
  -weight = Math.max(weight, 100);
  -weight = Math.min(weight, 900);
  -} catch (NumberFormatException nfe) {
  -//weight is no number, so convert smybolic name to number
  -if (triplet.getWeight().equals(normal)) {
  -weight = 400;
  -} else if (triplet.getWeight().equals(bold)) {
  -weight = 700;
  -} else {
  -throw new IllegalArgumentException(
  -Illegal value for font weight: ' 
  -+ triplet.getWeight()
  -+ '. Use one of: 100, 200, 300, 
  -+ 400, 500, 600, 700, 800, 900, 
  -+ normal (=400), bold (=700));
  -}
  -}
  +int weight = FontUtil.parseCSS2FontWeight(triplet.getWeight());
   //System.out.println(Registering: +triplet+ weight=+weight);
   fontInfo.addFontProperties(internalName,
  triplet.getName(),
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/src/java/org/apache/fop/pdf PDFFactory.java

2003-07-04 Thread jeremias
jeremias2003/07/04 12:45:06

  Modified:src/java/org/apache/fop/pdf PDFFactory.java
  Log:
  Use Commons IO methods
  
  Revision  ChangesPath
  1.4   +6 -2  xml-fop/src/java/org/apache/fop/pdf/PDFFactory.java
  
  Index: PDFFactory.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/pdf/PDFFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PDFFactory.java   3 Apr 2003 12:53:44 -   1.3
  +++ PDFFactory.java   4 Jul 2003 19:45:06 -   1.4
  @@ -50,14 +50,18 @@
*/ 
   package org.apache.fop.pdf;
   
  +// Java
   import java.awt.geom.Rectangle2D;
   import java.io.IOException;
   import java.io.InputStream;
   import java.util.List;
   import java.util.Map;
   
  -import org.apache.fop.util.StreamUtilities;
  +// Apache libs
   import org.apache.avalon.framework.container.ContainerUtil;
  +import org.apache.commons.io.IOUtil;
  +
  +// FOP
   import org.apache.fop.fonts.CIDFont;
   import org.apache.fop.fonts.CustomFont;
   import org.apache.fop.fonts.Font;
  @@ -1163,7 +1167,7 @@
   embeddedFont = new PDFT1Stream();
   ((PDFT1Stream)embeddedFont).setData(pfb);
   } else {
  -byte[] file = StreamUtilities.toByteArray(in, 128000);
  +byte[] file = IOUtil.toByteArray(in);
   embeddedFont = new PDFTTFStream(file.length);
   ((PDFTTFStream)embeddedFont).setData(file, file.length);
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/lib commons-io-dev-20030703.jar commons-io-1.0-dev.jar

2003-07-04 Thread jeremias
jeremias2003/07/04 12:49:34

  Added:   lib  commons-io-dev-20030703.jar
  Removed: lib  commons-io-1.0-dev.jar
  Log:
  Commons IO: Upgrade to a recent snapshot
  
  Revision  ChangesPath
  1.1  xml-fop/lib/commons-io-dev-20030703.jar
  
Binary file
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Java source encoding (was Re: [RTF] Jfor integration)

2003-07-04 Thread Bertrand Delacretaz
Le Vendredi, 4 juil 2003, à 21:12 Europe/Zurich, J.Pietschmann a écrit :

Bertrand Delacretaz wrote:
Sure - it is by accident that comments in the jfor source code 
contains non-ASCII chars (in people's names IIRC).
OOps, I didn't think about that. We could
What I meant is that I think (or rather hope) people are ok to have 
their names spelled slightly wrong in source files.
I don't think it's worth the hassle to worry about encodings just to 
write contributors names.

-Bertrand

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


cvs commit: xml-fop fop.bat

2003-07-04 Thread jeremias
jeremias2003/07/04 12:51:04

  Modified:.fop.bat
  Log:
  Adjust to version change of Commons IO
  
  Revision  ChangesPath
  1.13  +1 -1  xml-fop/fop.bat
  
  Index: fop.bat
  ===
  RCS file: /home/cvs/xml-fop/fop.bat,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- fop.bat   26 May 2003 06:56:07 -  1.12
  +++ fop.bat   4 Jul 2003 19:51:03 -   1.13
  @@ -11,7 +11,7 @@
   set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xalan-2.4.1.jar
   set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\batik.jar
   set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\avalon-framework-4.1.4.jar
  -set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\commons-io-1.0-dev.jar
  +set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\commons-io-dev-20030703.jar
   set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jimi-1.0.jar
   set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_core.jar
   set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_codec.jar
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/src/java/org/apache/fop/util CharUtilities.java

2003-07-04 Thread jeremias
jeremias2003/07/04 12:55:43

  Modified:src/java/org/apache/fop/util CharUtilities.java
  Log:
  Some touch-up for style
  
  Revision  ChangesPath
  1.2   +18 -12xml-fop/src/java/org/apache/fop/util/CharUtilities.java
  
  Index: CharUtilities.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/util/CharUtilities.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CharUtilities.java11 Mar 2003 13:05:39 -  1.1
  +++ CharUtilities.java4 Jul 2003 19:55:43 -   1.2
  @@ -58,7 +58,8 @@
*/
   public class CharUtilities {
   
  -/** Character code used to signal a character boundary in
  +/** 
  + * Character code used to signal a character boundary in
* inline content, such as an inline with borders and padding
* or a nested block object.
*/
  @@ -87,10 +88,17 @@
   
   
   /**
  + * Utility class: Constructor prevents instantiating when subclassed.
  + */
  +protected CharUtilities() {
  +throw new UnsupportedOperationException();
  +}
  +
  +/**
* Return the appropriate CharClass constant for the type
* of the passed character.
* @param c character to inspect
  - * @return int the determined character class
  + * @return the determined character class
*/
   public static int classOf(char c) {
   if (c == CODE_EOT) { return EOT; }
  @@ -107,7 +115,7 @@
* versions of space that might not exists in the font.
* @param c character to inspect
* @param fs FontState to use
  - * @return int the width of the character
  + * @return the width of the character
*/
   public static int getCharWidth(char c, FontState fs) {
   int width;
  @@ -184,7 +192,7 @@
* space with normal behaviour. Normal behaviour means that
* it's not non-breaking.
* @param c character to inspect
  - * @return boolean True if the character is a normal space
  + * @return True if the character is a normal space
*/
   public static boolean isSpace(char c) {
   return (c == ' '
  @@ -207,16 +215,14 @@
* Method to determine if the character is a nonbreaking
* space.
* @param c character to check
  - * @return boolean True if the character is a nbsp
  + * @return True if the character is a nbsp
*/
   public static boolean isNBSP(char c) {
  -if (c == '\u00A0' || c == '\u202F'// narrow no-break space
  -|| c == '\u3000'  // ideographic space
  -|| c == '\uFEFF') {   // zero width no-break space
  -return true;
  -} else {
  -return false;
  -}
  +return
  +(c == '\u00A0'  // no-break space
  +|| c == '\u202F'// narrow no-break space
  +|| c == '\u3000'// ideographic space
  +|| c == '\uFEFF');  // zero width no-break space
   }
   
   /**
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/src/java/org/apache/fop/util CharUtilities.java

2003-07-04 Thread jeremias
jeremias2003/07/04 12:56:18

  Modified:src/java/org/apache/fop/util CharUtilities.java
  Log:
  *** keyword substitution change ***
  
  Revision  ChangesPath
  1.3   +0 -0  xml-fop/src/java/org/apache/fop/util/CharUtilities.java
  
  Index: CharUtilities.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/util/CharUtilities.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/src/java/org/apache/fop/fo FOUserAgent.java

2003-07-04 Thread jeremias
jeremias2003/07/04 12:59:16

  Modified:src/java/org/apache/fop/fo FOUserAgent.java
  Log:
  Make resolution configurable
  
  Revision  ChangesPath
  1.4   +10 -1 xml-fop/src/java/org/apache/fop/fo/FOUserAgent.java
  
  Index: FOUserAgent.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOUserAgent.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FOUserAgent.java  25 Apr 2003 07:06:42 -  1.3
  +++ FOUserAgent.java  4 Jul 2003 19:59:16 -   1.4
  @@ -94,6 +94,7 @@
   private Map handlers = new java.util.HashMap();
   private String baseURL;
   private PDFEncryptionParams pdfEncryptionParams;
  +private float px2mm = 0.3528f; //72dpi (=25.4/dpi)
   
   /**
* Sets the logger.
  @@ -168,7 +169,15 @@
* @return float conversion factor
*/
   public float getPixelUnitToMillimeter() {
  -return 0.3528f;
  +return this.px2mm;
  +}
  +
  +/**
  + * Sets the resolution in dpi.
  + * @param dpi resolution in dpi
  + */
  +public void setResolution(int dpi) {
  +this.px2mm = (float)(25.4 / dpi);
   }
   
   /**
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/src/java/org/apache/fop/fo PropertyListBuilder.java

2003-07-04 Thread jeremias
jeremias2003/07/04 12:59:40

  Modified:src/java/org/apache/fop/fo PropertyListBuilder.java
  Log:
  Style only
  
  Revision  ChangesPath
  1.12  +4 -6  xml-fop/src/java/org/apache/fop/fo/PropertyListBuilder.java
  
  Index: PropertyListBuilder.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/PropertyListBuilder.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- PropertyListBuilder.java  1 May 2003 09:02:17 -   1.11
  +++ PropertyListBuilder.java  4 Jul 2003 19:59:40 -   1.12
  @@ -56,7 +56,7 @@
   
   // FOP
   import org.apache.fop.apps.FOPException;
  -import org.apache.fop.fo.Property.*;
  +import org.apache.fop.fo.Property.Maker;
   
   public class PropertyListBuilder {
   
  @@ -129,7 +129,7 @@
* properties.
* @return PropertyList object containing collection of Properties objects
* appropriate for the FObj
  - * @throws FOPException
  + * @throws FOPException If an error occurs while building the PropertyList
*/
   public PropertyList makeList(String nameSpaceURI, String elementName,
Attributes attributes,
  @@ -203,8 +203,7 @@
   Property prop = null;
   if (subPropertyName == null) {
   prop = propertyMaker.make(propList, attributeValue, parentFO);
  -}
  -else {
  +} else {
   Property baseProperty = findBaseProperty(attributes, propList,
   parentFO, basePropertyName, propertyMaker);
   prop = propertyMaker.make(baseProperty, subPropertyName,
  @@ -213,8 +212,7 @@
   if (prop != null) {
   propList.put(basePropertyName, prop);
   }
  -}
  -catch (FOPException e) {
  +} catch (FOPException e) {
   /[EMAIL PROTECTED] log this exception */
   // log.error(e.getMessage());
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/src/java/org/apache/fop/util ASCII85OutputStream.java RunLengthEncodeOutputStream.java Finalizable.java FlateEncodeOutputStream.java ASCIIHexOutputStream.java ASCII85Constants.java ASCII85InputStream.java

2003-07-04 Thread jeremias
jeremias2003/07/04 13:01:08

  Added:   src/java/org/apache/fop/util ASCII85OutputStream.java
RunLengthEncodeOutputStream.java Finalizable.java
FlateEncodeOutputStream.java
ASCIIHexOutputStream.java ASCII85Constants.java
ASCII85InputStream.java
  Log:
  Move here from org.apache.fop.render.ps
  
  Revision  ChangesPath
  1.1  xml-fop/src/java/org/apache/fop/util/ASCII85OutputStream.java
  
  Index: ASCII85OutputStream.java
  ===
  /*
   * $Id: ASCII85OutputStream.java,v 1.1 2003/07/04 20:01:07 jeremias Exp $
   * 
   *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/.
   */ 
  package org.apache.fop.util;
  
  import java.io.OutputStream;
  import java.io.FilterOutputStream;
  import java.io.IOException;
  
  /**
   * This class applies a ASCII85 encoding to the stream.
   *
   * @author a href=mailto:[EMAIL PROTECTED]Jeremias Maerki/a
   * @version $Id: ASCII85OutputStream.java,v 1.1 2003/07/04 20:01:07 jeremias Exp $
   */
  public class ASCII85OutputStream extends FilterOutputStream
  implements ASCII85Constants, Finalizable {
  
  private static final boolean DEBUG = false;
  
  private int pos = 0;
  private long buffer = 0;
  private int posinline = 0;
  private int bw = 0;
  
  /** @see java.io.FilterOutputStream **/
  public ASCII85OutputStream(OutputStream out) {
  super(out);
  }
  
  /** @see java.io.FilterOutputStream **/
  public void write(int b) throws IOException {
  if (pos == 0) {
  buffer += (b  24)  0xff00L;
  } else if (pos == 1) {
  buffer += (b  16)  0xffL;
  } else if (pos == 2) {
  buffer += (b  8)  0xff00L;
  } else {
  buffer += b  0xffL;
  }
  pos++;
  
  if (pos  3) {
  checkedWrite(convertWord(buffer));
  buffer = 0;
  pos = 0;
  }
  }
  
  /* UNUSED ATM
  private void checkedWrite(int b) throws IOException {

cvs commit: xml-fop/src/java/org/apache/fop/pdf PDFWArray.java

2003-07-04 Thread jeremias
jeremias2003/07/04 13:09:25

  Modified:src/java/org/apache/fop/pdf PDFWArray.java
  Log:
  Use PDFDocument to encode from String to bytes.
  
  Revision  ChangesPath
  1.2   +1 -1  xml-fop/src/java/org/apache/fop/pdf/PDFWArray.java
  
  Index: PDFWArray.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/pdf/PDFWArray.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PDFWArray.java11 Mar 2003 13:05:09 -  1.1
  +++ PDFWArray.java4 Jul 2003 20:09:25 -   1.2
  @@ -120,7 +120,7 @@
* @return byte[] the PDF code
*/
   public byte[] toPDF() {
  -return toPDFString().getBytes();
  +return PDFDocument.encode(toPDFString());
   }
   
   /**
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/src/java/org/apache/fop/pdf TempFileStreamCache.java InMemoryStreamCache.java

2003-07-04 Thread jeremias
jeremias2003/07/04 13:12:59

  Modified:src/java/org/apache/fop/pdf TempFileStreamCache.java
InMemoryStreamCache.java
  Log:
  Remove unused code
  Use IO methods from Commons IO
  
  Revision  ChangesPath
  1.3   +7 -41 xml-fop/src/java/org/apache/fop/pdf/TempFileStreamCache.java
  
  Index: TempFileStreamCache.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/pdf/TempFileStreamCache.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TempFileStreamCache.java  27 Mar 2003 10:27:27 -  1.2
  +++ TempFileStreamCache.java  4 Jul 2003 20:12:59 -   1.3
  @@ -50,17 +50,15 @@
*/ 
   package org.apache.fop.pdf;
   
  -import org.apache.fop.util.StreamUtilities;
  -
  -import java.io.BufferedInputStream;
  -import java.io.BufferedOutputStream;
  -import java.io.FileInputStream;
  -import java.io.FileOutputStream;
  +// Java
   import java.io.InputStream;
   import java.io.OutputStream;
   import java.io.IOException;
   import java.io.File;
   
  +//Commons
  +import org.apache.commons.io.IOUtil;
  +
   /**
* StreamCache implementation that uses temporary files rather than heap.
*/
  @@ -96,8 +94,8 @@
*/
   public OutputStream getOutputStream() throws IOException {
   if (output == null) {
  -output = new BufferedOutputStream(
  -   new FileOutputStream(tempFile));
  +output = new java.io.BufferedOutputStream(
  +   new java.io.FileOutputStream(tempFile));
   }
   return output;
   }
  @@ -110,38 +108,6 @@
   }
   
   /**
  - * Filter the cache with the supplied PDFFilter.
  - *
  - * @param filter the filter to apply
  - * @throws IOException if there is an IO error
  - */
  -public void applyFilter(PDFFilter filter) throws IOException {
  -if (output == null) {
  -return;
  -}
  -
  -output.close();
  -output = null;
  -
  -// need a place to put results
  -File newTempFile =
  -  File.createTempFile(org.apache.fop.pdf.StreamCache-,
  -  .temp);
  -newTempFile.deleteOnExit();
  -
  -// filter may not be buffered
  -BufferedInputStream input =
  -  new BufferedInputStream(new FileInputStream(tempFile));
  -BufferedOutputStream output = new BufferedOutputStream(
  -new FileOutputStream(newTempFile));
  -filter.encode(input, output, (int) tempFile.length());
  -input.close();
  -output.close();
  -tempFile.delete();
  -tempFile = newTempFile;
  -}
  -
  -/**
* Outputs the cached bytes to the given stream.
*
* @param out the output stream to write to
  @@ -158,7 +124,7 @@
   
   // don't need a buffer because streamCopy is buffered
   InputStream input = new java.io.FileInputStream(tempFile);
  -final long bytesCopied = StreamUtilities.streamCopy(input, out);
  +final long bytesCopied = IOUtil.copy(input, out);
   input.close();
   return (int)bytesCopied;
   }
  
  
  
  1.3   +0 -27 xml-fop/src/java/org/apache/fop/pdf/InMemoryStreamCache.java
  
  Index: InMemoryStreamCache.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/pdf/InMemoryStreamCache.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- InMemoryStreamCache.java  27 Mar 2003 10:27:27 -  1.2
  +++ InMemoryStreamCache.java  4 Jul 2003 20:12:59 -   1.3
  @@ -51,7 +51,6 @@
   package org.apache.fop.pdf;
   
   import java.io.ByteArrayOutputStream;
  -import java.io.ByteArrayInputStream;
   import java.io.OutputStream;
   import java.io.IOException;
   
  @@ -105,32 +104,6 @@
   getOutputStream().write(data);
   }
   
  -/**
  - * Filter the cache with the supplied PDFFilter.
  - * @param filter the filter to apply
  - * @throws IOException if an IO error occurs
  - */
  -public void applyFilter(PDFFilter filter) throws IOException {
  -if (output == null) {
  -return;
  -}
  -
  -output.close();
  -
  -// make inputstream from copy of outputted bytes
  -int size = getSize();
  -ByteArrayInputStream input =
  -  new ByteArrayInputStream(output.toByteArray());
  -
  -// reset output
  -output.reset();
  -
  -// run filter
  -filter.encode(input, output, size);
  -input.close();
  -output.close();
  -}
  -
   /**
* Outputs the cached bytes to the given stream.
* @param out the output stream to write to
  
  
  


cvs commit: xml-fop/src/java/org/apache/fop/pdf FlateFilter.java PDFFilter.java ASCIIHexFilter.java ASCII85Filter.java NullFilter.java

2003-07-04 Thread jeremias
jeremias2003/07/04 13:14:22

  Modified:src/java/org/apache/fop/pdf FlateFilter.java PDFFilter.java
ASCIIHexFilter.java ASCII85Filter.java
NullFilter.java
  Log:
  Remove obsolete code
  
  Revision  ChangesPath
  1.3   +1 -31 xml-fop/src/java/org/apache/fop/pdf/FlateFilter.java
  
  Index: FlateFilter.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/pdf/FlateFilter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FlateFilter.java  27 Mar 2003 10:18:05 -  1.2
  +++ FlateFilter.java  4 Jul 2003 20:14:22 -   1.3
  @@ -50,13 +50,10 @@
*/ 
   package org.apache.fop.pdf;
   
  -import org.apache.fop.render.ps.FlateEncodeOutputStream;
  -import org.apache.fop.util.StreamUtilities;
  +import org.apache.fop.util.FlateEncodeOutputStream;
   
   import java.io.OutputStream;
  -import java.io.InputStream;
   import java.io.IOException;
  -import java.util.zip.DeflaterOutputStream;
   
   /**
* A filter to deflate a stream.
  @@ -146,33 +143,6 @@
   return sb.toString();
   }
   return null;
  -}
  -
  -
  -/**
  - * Encode the given data and return it. Note: a side effect of
  - * this method is that it resets the prediction to the default
  - * because these attributes are not supported. So the DecodeParms
  - * should be retrieved after calling this method.
  - *
  - * @param in the input stream to read the data from
  - * @param out the output stream to write the data to
  - * @param length the length of data to read
  - * @throws IOException if there is an error reading or writing to the streams
  - */
  -public void encode(InputStream in, OutputStream out, int length) throws 
IOException {
  -predictor = PREDICTION_NONE;
  -try {
  -DeflaterOutputStream compressedStream =
  -new DeflaterOutputStream(out);
  -StreamUtilities.streamCopy(in, compressedStream, length);
  -compressedStream.flush();
  -compressedStream.close();
  -} catch (IOException e) {
  -//log.error(Fatal error: 
  -//+ e.getMessage(), e);
  -}
  -
   }
   
   /**
  
  
  
  1.3   +0 -11 xml-fop/src/java/org/apache/fop/pdf/PDFFilter.java
  
  Index: PDFFilter.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/pdf/PDFFilter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PDFFilter.java27 Mar 2003 10:18:05 -  1.2
  +++ PDFFilter.java4 Jul 2003 20:14:22 -   1.3
  @@ -50,7 +50,6 @@
*/ 
   package org.apache.fop.pdf;
   
  -import java.io.InputStream;
   import java.io.OutputStream; 
   import java.io.IOException;
   
  @@ -125,16 +124,6 @@
* @return the decode params for the filter
*/
   public abstract String getDecodeParms();
  -
  -/**
  - * encode the given data with the filter
  - *
  - * @param in the input data stream to encode
  - * @param out the output stream to write the result
  - * @param length the length of data to read from the input stream
  - * @throws IOException if there is an error reading or writing the data
  - */
  -public abstract void encode(InputStream in, OutputStream out, int length) 
throws IOException;
   
   /**
* Applies a filter to an OutputStream.
  
  
  
  1.3   +2 -28 xml-fop/src/java/org/apache/fop/pdf/ASCIIHexFilter.java
  
  Index: ASCIIHexFilter.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/pdf/ASCIIHexFilter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ASCIIHexFilter.java   27 Mar 2003 10:18:05 -  1.2
  +++ ASCIIHexFilter.java   4 Jul 2003 20:14:22 -   1.3
  @@ -51,20 +51,16 @@
   package org.apache.fop.pdf;
   
   import java.io.OutputStream;
  -import java.io.InputStream;
  -import java.io.Writer;
  -import java.io.OutputStreamWriter;
   import java.io.IOException;
   
  -import org.apache.fop.render.ps.ASCIIHexOutputStream;
  +import org.apache.fop.util.ASCIIHexOutputStream;
   
   /**
* ASCII Hex filter for PDF streams.
* This filter converts a pdf stream to ASCII hex data.
*/
   public class ASCIIHexFilter extends PDFFilter {
  -private static final String ASCIIHEX_EOD = ;
  -
  +
   /**
* Get the name of this filter.
*
  @@ -88,28 +84,6 @@
*/
   public String getDecodeParms() {
   return null;
  -}
  -
  -/**
  - * Encode the pdf stream using this filter.
  - *
  - * @param in the input stream to read the data from
  - * @param 

cvs commit: xml-fop build.bat

2003-07-04 Thread jeremias
jeremias2003/07/04 13:22:25

  Modified:.build.bat
  Log:
  Restore ANT_HOME afterwards.
  
  Revision  ChangesPath
  1.20  +2 -0  xml-fop/build.bat
  
  Index: build.bat
  ===
  RCS file: /home/cvs/xml-fop/build.bat,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- build.bat 22 Nov 2002 18:07:13 -  1.19
  +++ build.bat 4 Jul 2003 20:22:25 -   1.20
  @@ -12,6 +12,7 @@
   set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xercesImpl-2.2.1.jar
   set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xalan-2.4.1.jar
   
  +set ANT_HOME_BAK=%ANT_HOME%
   set ANT_HOME=%LIBDIR%
   
   echo Building with classpath %LOCALCLASSPATH%
  @@ -20,6 +21,7 @@
   
   %JAVA_HOME%\bin\java.exe -Dant.home=%ANT_HOME% -classpath %LOCALCLASSPATH% 
org.apache.tools.ant.Main %1 %2 %3 %4 %5
   
  +set ANT_HOME=%ANT_HOME_BAK%
   goto end
   
   :error
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/test/java - New directory

2003-07-04 Thread jeremias
jeremias2003/07/04 13:49:49

  xml-fop/test/java - New directory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/test/java/org - New directory

2003-07-04 Thread jeremias
jeremias2003/07/04 13:49:50

  xml-fop/test/java/org - New directory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/test/java/org/apache/fop - New directory

2003-07-04 Thread jeremias
jeremias2003/07/04 13:49:50

  xml-fop/test/java/org/apache/fop - New directory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/test/java/org/apache - New directory

2003-07-04 Thread jeremias
jeremias2003/07/04 13:49:50

  xml-fop/test/java/org/apache - New directory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/test/java/org/apache/fop/util - New directory

2003-07-04 Thread jeremias
jeremias2003/07/04 13:49:50

  xml-fop/test/java/org/apache/fop/util - New directory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/test/java/org/apache/fop BasicPDFTranscoderTestCase.java AbstractFOPTestCase.java BasicDriverTestSuite.java AbstractBasicTranscoderTestCase.java UtilityCodeTestSuite.java BasicPSTranscoderTestCase.java BasicTranscoderTestSuite.java BasicDriverTestCase.java

2003-07-04 Thread jeremias
jeremias2003/07/04 13:50:29

  Added:   test/java/org/apache/fop/util
ASCII85InputStreamTestCase.java
ASCII85OutputStreamTestCase.java
   test/java/org/apache/fop BasicPDFTranscoderTestCase.java
AbstractFOPTestCase.java BasicDriverTestSuite.java
AbstractBasicTranscoderTestCase.java
UtilityCodeTestSuite.java
BasicPSTranscoderTestCase.java
BasicTranscoderTestSuite.java
BasicDriverTestCase.java
  Log:
  Initial set of test cases
  
  Revision  ChangesPath
  1.1  
xml-fop/test/java/org/apache/fop/util/ASCII85InputStreamTestCase.java
  
  Index: ASCII85InputStreamTestCase.java
  ===
  /*
   * $Id: ASCII85InputStreamTestCase.java,v 1.1 2003/07/04 20:50:28 jeremias Exp $
   * 
   *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/.
   */ 
  package org.apache.fop.util;
  
  import java.io.ByteArrayInputStream;
  import java.io.IOException;
  import java.io.InputStream;
  
  import org.apache.commons.io.IOUtil;
  import org.apache.commons.io.output.ByteArrayOutputStream;
  import org.apache.fop.pdf.PDFText;
  
  import junit.framework.TestCase;
  
  /**
   * Test case for ASCII85InputStream.
   * p
   * ATTENTION: Some of the tests here depend on the correct behaviour of
   * ASCII85OutputStream. If something fails here make sure 
   * ASCII85OutputStreamTestCase runs!
   * 
   * @author a href=mailto:[EMAIL PROTECTED]Jeremias Maerki/a
   */
  public class ASCII85InputStreamTestCase extends TestCase {
  
  private static final boolean DEBUG = false;
  
  /**
   * @see junit.framework.TestCase#TestCase(String)
   */
  public ASCII85InputStreamTestCase(String name) {
  super(name);
  }
  
  private byte[] decode(String text) throws Exception {
  byte[] ascii85 = text.getBytes(US-ASCII);
  InputStream in = new ByteArrayInputStream(ascii85);
  InputStream decoder = new ASCII85InputStream(in);
  

cvs commit: xml-fop/src/java/org/apache/fop/render/ps PSRenderer.java

2003-07-04 Thread jeremias
jeremias2003/07/04 13:58:54

  Modified:src/java/org/apache/fop/render/ps PSRenderer.java
  Log:
  Save PS interpreter memory by starting the procs only once.
  
  Revision  ChangesPath
  1.5   +1 -1  xml-fop/src/java/org/apache/fop/render/ps/PSRenderer.java
  
  Index: PSRenderer.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/ps/PSRenderer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PSRenderer.java   20 Jun 2003 10:21:50 -  1.4
  +++ PSRenderer.java   4 Jul 2003 20:58:54 -   1.5
  @@ -369,6 +369,7 @@
   PSProcSets.writeFOPStdProcSet(gen);
   PSProcSets.writeFOPEPSProcSet(gen);
   PSProcSets.writeFontDict(gen, fontInfo);
  +gen.writeln(FOPFonts begin);
   gen.writeDSCComment(DSCConstants.END_SETUP);
   }
   
  @@ -428,7 +429,6 @@
   }
   }
   gen.writeDSCComment(DSCConstants.BEGIN_PAGE_SETUP); 
  -gen.writeln(FOPFonts begin);
   if (rotate) {
   gen.writeln(Math.round(pspageheight) +  0 translate);
   gen.writeln(90 rotate);
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Status update: hyphenation (no, not the pattern file licenses)

2003-07-04 Thread J.Pietschmann
Hi,
as I wrote quite some weeks ago I took an extended look at
hyphenation, with the possible target of creating APL
licensed patterns from our own dictionaries. I also looked
at the current hyphenator.
I finally seem to have grasped how hyphenation and
hyphenation pattern generation from a marked up dictionary
(patgen.web) works. I implemented my own qd hyphenator
which lead to the detection of a few well hidden bugs in
the current hyphenator. Interestingly, nobody seems to care
all that much. Do people proof read their output?
Other problems with the current hyphenator are that it
contains a lot of crufty code, has a few easy to cure
inefficiencies, and it can't handle hyphenations with
consonant shifts and other spelling changes, like in the
old german spelling backen - bak-ken and Schiffahrt -
Schiff-fahrt, despite it seems to claim so. (the new
german spelling does no longer have these features, but
I think there are still languages where this is an issue).
Furthermore, the interaction between the main code and
the hyphenator is somewhat ineffective too, and the main
code does not necessarily have the same understanding on
what consitutes a word than the hyphenator.
In parallel to working on the unit test concept and preparing
for some refactoring in HEAD, I'm working now on providing
a patgen.web rewrite in Java which does not have some of the
restricting features of the original and also on a german
lexicon which has currently roughly 12k stem forms of words
with hyphenation and other information. Help with comleting
the lexicon or with other languages is welcome. Unfortunately
tools for lexicon maintenance, word inflection and
plausibility checks on hyphenated forms are still alpha, at
best. I'll publish them on my Apache home page in a few days.
RT: I believe the lexicon(s), pattern generator, the hyphenator
and perhaps other tools could be useful for other projects.
What would be a sensible approach to encourage reuse?
J.Pietschmann

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


cvs commit: xml-fop/src/java/org/apache/fop/render/ps FlateEncodeOutputStream.java RunLengthEncodeOutputStream.java ASCIIHexOutputStream.java ASCII85OutputStream.java Finalizable.java

2003-07-04 Thread jeremias
jeremias2003/07/04 14:01:36

  Removed: src/java/org/apache/fop/render/ps
FlateEncodeOutputStream.java
RunLengthEncodeOutputStream.java
ASCIIHexOutputStream.java ASCII85OutputStream.java
Finalizable.java
  Log:
  moved to org.apache.fop.util

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Status update: hyphenation (no, not the pattern file licenses)

2003-07-04 Thread Jeremias Maerki

On 04.07.2003 22:59:27 J.Pietschmann wrote:
 Interestingly, nobody seems to care
 all that much. Do people proof read their output?

LOL

snip what=a lot of interesting-sounding stuff/

 RT: I believe the lexicon(s), pattern generator, the hyphenator
 and perhaps other tools could be useful for other projects.
 What would be a sensible approach to encourage reuse?

Well, separate the reusable stuff from the FOP-specific stuff
(package-wise). Other Apache projects have started sub-(sub-)projects.
Maybe we could do something similar if only to encourage decoupling of
utility components that could be used elsewhere. Additional candidates:
PDF library, Transcoders, a free image library etc. etc.

Another question: How does your work relate to the general possibility
to make use of OpenOffice.org's hyphenation stuff.

Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



First JUnit tests in

2003-07-04 Thread Jeremias Maerki
As you will have seen I've checked in the first batch of unit tests.
They don't all seem to work right now. Some problem with DOM and another
with Batik. The Batik one will probably go away by upgrading to 1.5b5.
I haven't looked closely at the other.

At any rate, Gump shouldn't break because of that. I hope to fix that
soon. Right now I'm simply too tired.

Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



cvs commit: xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc RtfColorTable.java RtfParagraph.java

2003-07-04 Thread vmote
vmote   2003/07/04 20:23:24

  Modified:src/java/org/apache/fop/datatypes ColorType.java
   src/java/org/apache/fop/rtf/renderer RTFHandler.java
   src/java/org/apache/fop/rtf/rtflib/rtfdoc RtfColorTable.java
RtfParagraph.java
  Log:
  Changes to implement background color at the paragraph level in RTF output.
  
  Revision  ChangesPath
  1.2   +24 -10xml-fop/src/java/org/apache/fop/datatypes/ColorType.java
  
  Index: ColorType.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/datatypes/ColorType.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ColorType.java11 Mar 2003 13:05:36 -  1.1
  +++ ColorType.java5 Jul 2003 03:23:23 -   1.2
  @@ -3,34 +3,34 @@
* 
*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
  @@ -42,12 +42,12 @@
* (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/.
  - */ 
  + */
   package org.apache.fop.datatypes;
   
   import java.io.Serializable;
  @@ -230,6 +230,20 @@
*/
   public float alpha() {
   return this.alpha;
  +}
  +
  +/**
  + * @param floatValue value (between 0.0 and 1.0) of color channel
  + * @return integer equivalent (between 0 and 255)
  + */
  +public static int convertChannelToInteger (float floatValue) {
  +if (floatValue  1.0) {
  +floatValue = 1.0f;
  +}
  +if (floatValue  0) {
  +floatValue = 0;
  +}
  +return (int) floatValue * 255;
   }
   
   /**
  
  
  
  1.9   +45 -3 xml-fop/src/java/org/apache/fop/rtf/renderer/RTFHandler.java
  
  Index: RTFHandler.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/rtf/renderer/RTFHandler.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- RTFHandler.java   30 Jun 2003 21:04:06 -  1.8
  +++ RTFHandler.java   5 Jul 2003 03:23:23 -   1.9
  @@ -56,6 +56,7 @@
   import java.io.OutputStreamWriter;
   
   import org.apache.fop.apps.FOPException;
  +import org.apache.fop.datatypes.ColorType;
   import org.apache.fop.fo.StructureHandler;
   import org.apache.fop.fo.flow.Block;
   import org.apache.fop.fo.flow.ExternalGraphic;
  @@ -72,6 +73,7 @@
   import org.apache.fop.fo.properties.Constants;
   import org.apache.fop.layout.FontInfo;
   import 

RE: Build environment for alt.design

2003-07-04 Thread Victor Mote
Ralph LaChance wrote:

 At 12:20 PM 7/4/2003, you wrote:
 [Happy Independence Day, fellow Americans!]
 
 and I always like to remind fellow Americans that
 the British call this Thanksgiving Day...

Yep, and we're thankful for Washington et al who made them thankful :-)

Victor Mote

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



RE: Java source encoding (was Re: [RTF] Jfor integration)

2003-07-04 Thread Victor Mote
J.Pietschmann wrote:

 OOps, I didn't think about that. We could
 a) Force ISO-8859-1 for all Java source files in the build file.
 Is this a discrimination of, ummm, non-western contributors
 who might want to have their names in their native script
 in the files?
 b) Keep a list of Java source files which need a different encoding
and force ISO-8859-1 on the rest
 c) Switch to UTF-8. Eclipse can deal with UTF-8. Users of other
IDEs are, to a large part, screwed.

I already chose option #3 for the files in question (probably 2 weeks ago).
If java source files are Unicode, then can a java editor really claim to be
such if it can't handle UTF-8? I guess I don't understand how this became
such an important and heated discussion.

Victor Mote


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



Re: Build environment for alt.design

2003-07-04 Thread Peter B. West
Glen,

Comments below, but to preface, let me say that alt.design has not had 
an Ant build system to date, so there is no penalty in my doing things 
differently, because I have to hack the build.xml anyway.  What I do 
does not impact on HEAD, and provides a testbed for examining a 
different approach.

Glen Mazza wrote:
[Happy Independence Day, fellow Americans!]

--- Peter B. West [EMAIL PROTECTED] wrote:

The basic build principles that I will implement
include:
* No code generation or modification for normal
builds.
* All generated code and data maintained in CVS.


I don't think you have to bother with this.  This is
akin to storing binaries in CVS--kind of messy.
Not at all.  Code generation is kind of messy; well, very messy, and 
very confusing.  I understand the counter-argument, but I disagree with 
it.  This is a Java system, and the source is Java.  I just want that 
source immediately available.

This is primarily to ease the introduction to the
code for newcomers, 
but also to rationalise the basic working
environment for development. 


But Peter--isn't the developer IQ  work ethic
required to constructively help on FOTreeBuilding,
Area Tree/Layout, Rendering, etc. far greater than
whatever would be needed to understand automatic code
generation?
Yes.  But

I am too stupid  lazy to look into build/src for
autogenerated code but Hey, FOP Team, let me help
you out on that Area Tree redesign you have there is
a contradiction.  
Glen, this makes me very uneasy.  If anyone who finds the code 
generation system opaque is stupid, then I am stupid.  If being put off 
delving into it by the opaqueness is laziness, then I am lazy.  I put it 
off for as long as I possibly could.  I know you're not saying that, but 
I, for one, like to know what is going on with the code I get involved 
with.  I don't like the feeling that code is being conjured up as if by 
magic, and I find that off-putting.

As a relative newcomer, I can tell you--There is a
*ton* of FOP I still don't understand--Area Tree
creations, fonts, Renderer's etc. (and *feel free* to
make that more understandable!) But this has 0.00% to
do with autogenerated code. 
I don't claim that it does.  I am simply saying that, in itself, it is 
an obscure area of the system.

Rather, I just haven't gotten to those areas of code
yet, also I wouldn't be surprised if cerebral
limitations also kick in more than I would like along
the way.  So with every other potential developer.
... I don't see Open Source development as a trial by fire.  I don't 
care about developer IQ or work ethic.  Any contribution which is a nett 
benefit to the project is welcome.  I want to make such contributions 
more feasible, rather than less.  In any case, I have often found that 
those who are most diffident about their ability display plenty of it 
when encouraged.

Once the code generation step is separated, normal
builds can monitor 
the state of the generated code by a) checking
creation dates of 
generated files and their sources and b) performing
cvs diffs against 
the repository.  For a normal build, I would simply
check timestamps, 
while for a distribution build I would enforce a
repository check.

In the normal case, inconsistencies in the generated
code would halt the 
build.  A property could be defined to override this
from the command 
line or from build-local.properties.



All this to avoid a minute or two of extra build
time?--it doesn't seem worth the headache.
No, it's not to avoid a small increment of build time.  If basic checks 
of generated code consistency actually took longer, I would still do it. 
 The purpose is to have the Java code from which the system is built 
available on checkout.  The code generation is a background tool for 
intermittent use only, and should be invoked only for the specific 
occasional purpose of generating new code (or data) files for the system.

Peter
--
Peter B. West  http://www.powerup.com.au/~pbwest/resume.html
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


Re: Java source encoding (was Re: [RTF] Jfor integration)

2003-07-04 Thread Peter B. West
Victor Mote wrote:
J.Pietschmann wrote:


OOps, I didn't think about that. We could
a) Force ISO-8859-1 for all Java source files in the build file.
   Is this a discrimination of, ummm, non-western contributors
   who might want to have their names in their native script
   in the files?
b) Keep a list of Java source files which need a different encoding
  and force ISO-8859-1 on the rest
c) Switch to UTF-8. Eclipse can deal with UTF-8. Users of other
  IDEs are, to a large part, screwed.


I already chose option #3 for the files in question (probably 2 weeks ago).
If java source files are Unicode, then can a java editor really claim to be
such if it can't handle UTF-8? I guess I don't understand how this became
such an important and heated discussion.
(I wouldn't say it was heated.)  I am curious about the impact of 
someone working without any formal IDE, and just using (X)Emacs and JDEE 
for development.  As far as I know, XEmacs does not support Unicode, but 
if the non-ASCII characters were restricted to comments, and XEmacs 
thought it was dealing with ISO-8859-15, would there be any actual 
problems?  ASCII nulls aren't gling to appear in such UTF8 are they?

Peter
--
Peter B. West  http://www.powerup.com.au/~pbwest/resume.html
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]