Re: PS Interpreter
Thanks for the update, Victor. I absolutely want to have a look at this. So this is really the foundation to make Type 1 fonts available on the fly without generating font metric XML files by hand. Very cool. It'll be fun to see if I can get some basic ops working to paint some simple shapes to a Graphics2D interface. On 07.10.2004 03:54:33 Victor Mote wrote: FWIW, the FOray PostScript interpreter is now able to successfully parse any Type 1 font that I have thrown at it, store the data structures, and retrieve them. This includes the ability to parse the encrypted portion of the font, whether in binary or ASCII hexadecimal. The FOray font package is therefore now able to correctly gather the FontBBox and StemV values for a PDF. (The ItalicAngle has also been elusive -- it is actually in the PFM file under the name etmSlant. The FOray package now parses and uses it as well.) I think this means that all of the elusive, estimated pieces are now correctly computed using 1) either a PFA or PFB file and 2) a PFM file. This will also help in future subsetting work, and font embedding enhancements (like converting ASCII hex fonts to binary to make the file smaller). Since the parsing takes some extra time and memory, I may need to provide ways to cripple or partially cripple this process for users who don't want to pay that much for the benefit. An AFM parser is still needed, primarily so that users can conveniently override values if they need to. But I think the backwards-compatible ability to not require an AFM file is nice. The PostScript parser itself is pretty rudimentary. After pulling the errors and obvious non-operator items out of the list, there appear to be 352 operators for Level 2 compliance. I have only implemented 42 of them so far. However, a lot of the brain-bending part of the design work is done, and I think it should be a good starting place for other PostScript-related projects, like EPS conversion. Here is the ViewCVS link to the PSInterpreter: http://cvs.sourceforge.net/viewcvs.py/foray/foray/foray-ps/src/java/org/fora y/ps/PSInterpreter.java?view=markup The other files are in the same directory. I'll probably leave it alone until I need more from it, but I wanted to update Jeremias and anyone else who is interested. Victor Mote Jeremias Maerki
Re: PS Interpreter
Jeremias Maerki wrote: Thanks for the update, Victor. I absolutely want to have a look at this. So this is really the foundation to make Type 1 fonts available on the fly without generating font metric XML files by hand. Very cool. It'll be fun to see if I can get some basic ops working to paint some simple shapes to a Graphics2D interface. I'll be watching with interest. Peter On 07.10.2004 03:54:33 Victor Mote wrote: FWIW, the FOray PostScript interpreter is now able to successfully parse any Type 1 font that I have thrown at it, store the data structures, and retrieve them. This includes the ability to parse the encrypted portion of the font, whether in binary or ASCII hexadecimal. -- Peter B. West http://cv.pbw.id.au/
RE: PS Interpreter
Jeremias Maerki wrote: So this is really the foundation to make Type 1 fonts available on the fly without generating font metric XML files by hand. Very cool. Actually, FOray eliminated the intermediate font metric XML files several months ago, and parses the TTF, PFM, PFA, and PFB files on-the-fly. I'll try to add an AFM parser in the next few days, and then I think we'll have the best of all worlds -- you can hand-tune an AFM file if you want to, but otherwise, just use the files that ship with the font. We may have some performance/memory issues that result from this, but I think the code is set up to accommodate some configuration items after I start getting some feedback about what people want. BTW, I want to compliment the people that wrote the original font code. There was really a large amount of good and useful code in there. I spent several months refactoring it to make it cleaner and easier to use, but I came out *way* ahead of starting over again. My current theory about open-source development is that, because so many people work on it, it evolves into something that is a bit convoluted. Every once in a while, you need a refactoring cycle to clean it up (really to impose or reimpose a design after-the-fact). My current theory also includes the idea that nobody really wants to do that work, because it isn't very much fun, and because it is hard to see an immediate benefit. Anyway, my compliments to Tore and Jeremias and the many others who wrote the base code. Victor Mote
PS Interpreter
FWIW, the FOray PostScript interpreter is now able to successfully parse any Type 1 font that I have thrown at it, store the data structures, and retrieve them. This includes the ability to parse the encrypted portion of the font, whether in binary or ASCII hexadecimal. The FOray font package is therefore now able to correctly gather the FontBBox and StemV values for a PDF. (The ItalicAngle has also been elusive -- it is actually in the PFM file under the name etmSlant. The FOray package now parses and uses it as well.) I think this means that all of the elusive, estimated pieces are now correctly computed using 1) either a PFA or PFB file and 2) a PFM file. This will also help in future subsetting work, and font embedding enhancements (like converting ASCII hex fonts to binary to make the file smaller). Since the parsing takes some extra time and memory, I may need to provide ways to cripple or partially cripple this process for users who don't want to pay that much for the benefit. An AFM parser is still needed, primarily so that users can conveniently override values if they need to. But I think the backwards-compatible ability to not require an AFM file is nice. The PostScript parser itself is pretty rudimentary. After pulling the errors and obvious non-operator items out of the list, there appear to be 352 operators for Level 2 compliance. I have only implemented 42 of them so far. However, a lot of the brain-bending part of the design work is done, and I think it should be a good starting place for other PostScript-related projects, like EPS conversion. Here is the ViewCVS link to the PSInterpreter: http://cvs.sourceforge.net/viewcvs.py/foray/foray/foray-ps/src/java/org/fora y/ps/PSInterpreter.java?view=markup The other files are in the same directory. I'll probably leave it alone until I need more from it, but I wanted to update Jeremias and anyone else who is interested. Victor Mote