Re: Mocking a test

2010-11-19 Thread Adrian Cumiskey
Hi Medhi,

That's a great suggestion.  I really like to use the Mockito 
(http://code.google.com/p/mockito/) framework in my tests, it has a fluent 
interface that is really easy and comfortable to work with.

Adrian.

Sent from my iPad

On Nov 20, 2010, at 12:08 AM, mehdi houshmand  wrote:

> Hi,
> 
> I've been working on unit testing some of the classes in FOP and I
> think FOP could benefit from using a mocking framework. The goal is
> obviously that every class has a complimentary test class to test
> behaviour and state and mocking a class is a good way to emulate an
> object. I shan't make this into a lecture on the benefits, I've
> enclosed a good URL as to some of the benefits, but I wanted to put it
> to the community for feedback. This would mean including an extra
> JAR(s) file in the libs/ directory (obviously we'll have to be careful
> with licenses), but I'm just floating the idea if anyone has any
> preferred frameworks please do suggest pros/cons.
> 
> http://martinfowler.com/articles/mocksArentStubs.html
> 
> Thanks
> 
> Mehdi


Re: new findbug errors

2010-11-19 Thread Glenn Adams
Nope. It was introduced along with PMD target by Max Berger in June, 2008,
see

http://svn.apache.org/viewvc?view=revision&revision=666967

I only made some enhancements to it, like adding the exclusion file.

G.

On Fri, Nov 19, 2010 at 11:55 AM, Simon Pepping wrote:

> Glenn,
>
> One note: You introduced findbugs as a tool, and you created the
> findbugs target in the build file.
>
> Simon
>
> On Fri, Nov 19, 2010 at 08:28:09AM -0700, Glenn Adams wrote:
> > Thanks! You say:
> >
> > "I note that we have not accepted findbugs as a tool of the project. I
> > think that not all developers are a fan of the tool."
> >
> > Is there an alternative, and equally or more effective tool that is
> > acceptable to more developers, e.g., PMD? If there is, then perhaps we
> > should migrate to it? If not, then perhaps we should make findbugs a
> "tool
> > of the project". Since there has been a "findbugs" target in build.xml
> for a
> > while (at least it was there when I started on the project), it seems
> like
> > it is in some way a "tool of the project".
> >
> > In any case, I believe we should make regular use of findbugs or a
> suitable
> > alternative, and that no commit should occur without verifying that no
> new
> > errors/warnings are being introduced.
>


Re: new findbug errors

2010-11-19 Thread Simon Pepping
Glenn,

One note: You introduced findbugs as a tool, and you created the
findbugs target in the build file.

Simon

On Fri, Nov 19, 2010 at 08:28:09AM -0700, Glenn Adams wrote:
> Thanks! You say:
> 
> "I note that we have not accepted findbugs as a tool of the project. I
> think that not all developers are a fan of the tool."
> 
> Is there an alternative, and equally or more effective tool that is
> acceptable to more developers, e.g., PMD? If there is, then perhaps we
> should migrate to it? If not, then perhaps we should make findbugs a "tool
> of the project". Since there has been a "findbugs" target in build.xml for a
> while (at least it was there when I started on the project), it seems like
> it is in some way a "tool of the project".
> 
> In any case, I believe we should make regular use of findbugs or a suitable
> alternative, and that no commit should occur without verifying that no new
> errors/warnings are being introduced.


Mocking a test

2010-11-19 Thread mehdi houshmand
Hi,

I've been working on unit testing some of the classes in FOP and I
think FOP could benefit from using a mocking framework. The goal is
obviously that every class has a complimentary test class to test
behaviour and state and mocking a class is a good way to emulate an
object. I shan't make this into a lecture on the benefits, I've
enclosed a good URL as to some of the benefits, but I wanted to put it
to the community for feedback. This would mean including an extra
JAR(s) file in the libs/ directory (obviously we'll have to be careful
with licenses), but I'm just floating the idea if anyone has any
preferred frameworks please do suggest pros/cons.

http://martinfowler.com/articles/mocksArentStubs.html

Thanks

Mehdi


Re: new findbug errors

2010-11-19 Thread Glenn Adams
Thanks! You say:

"I note that we have not accepted findbugs as a tool of the project. I
think that not all developers are a fan of the tool."

Is there an alternative, and equally or more effective tool that is
acceptable to more developers, e.g., PMD? If there is, then perhaps we
should migrate to it? If not, then perhaps we should make findbugs a "tool
of the project". Since there has been a "findbugs" target in build.xml for a
while (at least it was there when I started on the project), it seems like
it is in some way a "tool of the project".

In any case, I believe we should make regular use of findbugs or a suitable
alternative, and that no commit should occur without verifying that no new
errors/warnings are being introduced.

Regards,
Glenn

On Fri, Nov 19, 2010 at 8:05 AM, Simon Pepping wrote:

> I committed an exclusion filter that suppresses all existing findbug
> warnings (966). I generated it from the findbugs xml report. Then I
> moved all NM_CONFUSING out of the automatically generated block.
>
> When you get a new findbugs warning, you may
> 1. resolve it;
> 2. leave it unresolved, and add it to the exclusion filter, with
> comment;
> 3. leave it unsolved, and add it to the automatic block of the
> exclusion filter.
>
> I note that we have not accepted findbugs as a tool of the project. I
> think that not all developers are a fan of the tool.
>
> The main template of the xslt script that generated the exclusion
> filter is as follows:
>
> 
>  
>  
>
>  
>  
>
>  

>   Listing the method 'equals' does not work
> 
>
>
>  

>   Listing the field does not work; this makes the
> filter apply to all masked fields 
>
>
>  
>
>
>  
>
>
>  

>  Neither method nor field
>
>  
>  
>
>  
> 
>
> Simon
>
> On Wed, Nov 17, 2010 at 07:24:43PM +0100, Simon Pepping wrote:
> > I will take care of this. I am now squashing the easier
> > findbugs-reported bugs/problems. Then I will add the remaining ones to
> > the exclusion file, such that those that are really excluded can be
> > distinguished from those which have not yet been examined.
>


Re: new findbug errors

2010-11-19 Thread Simon Pepping
I committed an exclusion filter that suppresses all existing findbug
warnings (966). I generated it from the findbugs xml report. Then I
moved all NM_CONFUSING out of the automatically generated block.

When you get a new findbugs warning, you may
1. resolve it;
2. leave it unresolved, and add it to the exclusion filter, with
comment;
3. leave it unsolved, and add it to the automatic block of the
exclusion filter.

I note that we have not accepted findbugs as a tool of the project. I
think that not all developers are a fan of the tool.

The main template of the xslt script that generated the exclusion
filter is as follows:


  
  

  
  

  

   Listing the method 'equals' does not work 


  

   Listing the field does not work; this makes the filter 
apply to all masked fields 


  


  


  

  Neither method nor field

  
  

  


Simon

On Wed, Nov 17, 2010 at 07:24:43PM +0100, Simon Pepping wrote:
> I will take care of this. I am now squashing the easier
> findbugs-reported bugs/problems. Then I will add the remaining ones to
> the exclusion file, such that those that are really excluded can be
> distinguished from those which have not yet been examined.


Re: FOP + JAXB

2010-11-19 Thread Jeremias Maerki
Hi Jason,

yes, generating a SAX stream from JAXB should be easy. But personally, I
would never write Java code that produces XSL-FO for real-life documents
because it would be too tedious and very hard to maintain. In every
single case, I would see to it that I can produce XML data and put that
through an XSLT stylesheet.

Looking at the generated JAXB classes from the plutext SVN repo, I can
see how all inheritable properties have to be repeated for each and
every FO object. Jason, have you thought about how much memory each of
these objects consume? Most of them will not ever be set so are just
wasting space. I really think this approach doesn't make sense. You
would at least be a little better off doing some code generation of your
own to provide Java interfaces and FO object classes that are operating
on an XML DOM as backend. That way, you'd have a sparse approach to
these objects. You might even want to investigate directly working with
FOP's FO tree.

On 19.11.2010 11:59:20 Peter Hancock wrote:
> Hi Jason,
> 
> I can imagine your motivation for creating a representation of an fo
> tree in a java application
> however feeding this into FOP directly would perhaps be a little
> wastful from FOP's point of view:
> FOP uses SAX to parse the fo input and then builds an internal
> representation of the FO tree.
> This is not just a deserialization of the tree into java beans-
> the FO Tree classes provides methods that capture the semantic
> complexity of the fo structure,
> one that cannot be represented in an .xsd.
> 
> Navigating a DOM like structure and then generating the richer FOTree
> would promote an extra layer of processing
> and memory consumption, and is something we would want to avoid when
> dealing with large documents.
> 
> This is not to say there is no value with your approach to generating
> fo.  Maybe you could navigate your tree and generate sax events
> that can be handled by FOP's FOTree builder- I think this can be
> achieved in fairly straigt forward way, although I am no expert in
> chaining SAX processors.
> Perhaps a bit of bridging code maybe required and perhaps FOP would
> benefit from this.
> 
> Hopefully some one else in the FOP community can confirm my thoughts
> here with perhaps a pointer for getting started.
> 
> Pete
> 
> 
> On Fri, Nov 19, 2010 at 4:35 AM, Jason Harrop  wrote:
> > Hello
> >
> > I have used the JAXB tool XJC to generate a set of classes which
> > represent 
> > http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/src/foschema/fop.xsd
> >
> > As wikipedia explains, "Java Architecture for XML Binding (JAXB)
> > allows Java developers to map Java classes to XML representations.
> > JAXB provides two main features: the ability to marshal Java objects
> > into XML and the inverse, i.e. to unmarshal XML back into Java
> > objects".  JAXB is similar to XMLBeans.  It is JSR-222.
> >
> > You can see the Java classes for fop.xsd at
> > http://dev.plutext.org/svn/docx4j/trunk/docx4j/src/xslfo/org/plutext/jaxb/xslfo/
> >
> > My motivation was initially to be able to create somewhat complex
> > layout master set; see
> > http://dev.plutext.org/svn/docx4j/trunk/docx4j/src/main/java/org/docx4j/convert/out/pdf/viaXSLFO/LayoutMasterSetBuilder.java
> >
> > I'm planning to publish the code somewhere as a code base independent
> > from docx4j.  Is there any interest in having it as part of FOP?
> >
> > What if FOP could ingest these Java objects directly (ie without the
> > having to be marshalled first)?
> >
> > If there is no interest, that's fine.  I'll just put the code on
> > Google Code, say.
> >
> > cheers . Jason
> >




Jeremias Maerki



Re: svn commit: r1036179 [1/2] - in /xmlgraphics/fop/trunk

2010-11-19 Thread Jeremias Maerki
Thanks!!!

On 19.11.2010 11:33:21 Simon Pepping wrote:
> I will revert the renaming of public methods. It was not a good idea.
> Sorry for the noise.
> 
> Simon
> 
> On Thu, Nov 18, 2010 at 05:03:34PM +0100, Simon Pepping wrote:
> > It breaks org.krysalis.barcode4j.fop.BarcodeXMLHandler: getNamespace
> > -> getNameSpace (from render.xml.XMLXMLHandler.getNamespace ->
> > getNameSpace
> > 
> > On Thu, Nov 18, 2010 at 04:42:44PM +0100, Simon Pepping wrote:
> > > render.AbstractGenericSVGHandler.getNamespace -> getNameSpace
> > > render.intermediate.extensions.AbstractAction.setID -> setId
> > > render.intermediate.extensions.AbstractAction.getID -> getId
> > > render.intermediate.extensions.AbstractAction.hasID -> hasId
> > > render.intermediate.extensions.AbstractAction.getIDPrefix -> getIdPrefix
> > > render.intermediate.extensions.URIAction.getIDPrefix -> getIdPrefix
> > > render.XMLHandler.getNamespace -> getNameSpace
> > > render.ps.PSImageFormResource.getImageURI -> getImageUri
> > > render.xml.XMLXMLHandler.getNamespace -> getNameSpace
> > > render.afp.AFPRendererImageInfo.getURI -> getUri
> > > fonts.type1.PFMFile.getPostscriptName -> getPostScriptName
> > > tools.TestConverter.setBaseDir -> setBasedir
> > > tools.anttasks.Fop.setUserconfig -> setUserConfig
> > > tools.anttasks.Fop.getUserconfig -> getUserConfig()
> > > tools.anttasks.Fop.setFofile -> setFoFile
> > > tools.anttasks.Fop.getFofile -> getFoFile
> > > tools.anttasks.Fop.setThrowexceptions -> setThrowExceptions
> > > tools.anttasks.Fop.getThrowexceptions -> getThrowExceptions
> > > apps.PageSequenceResults.getID -> getId
> > > fo.FOText.getBaseLineShift -> getBaselineShift
> > > cli.CommandLineOptions.getFOFile -> getFoFile
> > > cli.CommandLineOptions.getXMLFile -> getXmlFile
> > > cli.CommandLineOptions.getXSLFile -> getXslFile
> > > 
> > > On Wed, Nov 17, 2010 at 09:29:06PM +0100, Simon Pepping wrote:
> > > > On Wed, Nov 17, 2010 at 07:45:31PM -, spepp...@apache.org wrote:
> > > > > Author: spepping
> > > > > Date: Wed Nov 17 19:45:27 2010
> > > > > New Revision: 1036179
> > > > > 
> > > > > URL: http://svn.apache.org/viewvc?rev=1036179&view=rev
> > > > > Log:
> > > > > findbugs-reported bug squashing; 959 bugs left (findbugs 1.3.9)
> > > > 
> > > > findbugs reports naming problems in public methods, such as setters
> > > > and getters. I resolved those problems. But in doing so, in principle
> > > > I am changing the public API. I do not think that every public method
> > > > is really in use by other applications. Let me know when I go too far
> > > > in those changes, harming applications that depend on fop.
> > > > 
> > > > Simon
> > > > 




Jeremias Maerki



Re: FOP + JAXB

2010-11-19 Thread Peter Hancock
Hi Jason,

I can imagine your motivation for creating a representation of an fo
tree in a java application
however feeding this into FOP directly would perhaps be a little
wastful from FOP's point of view:
FOP uses SAX to parse the fo input and then builds an internal
representation of the FO tree.
This is not just a deserialization of the tree into java beans-
the FO Tree classes provides methods that capture the semantic
complexity of the fo structure,
one that cannot be represented in an .xsd.

Navigating a DOM like structure and then generating the richer FOTree
would promote an extra layer of processing
and memory consumption, and is something we would want to avoid when
dealing with large documents.

This is not to say there is no value with your approach to generating
fo.  Maybe you could navigate your tree and generate sax events
that can be handled by FOP's FOTree builder- I think this can be
achieved in fairly straigt forward way, although I am no expert in
chaining SAX processors.
Perhaps a bit of bridging code maybe required and perhaps FOP would
benefit from this.

Hopefully some one else in the FOP community can confirm my thoughts
here with perhaps a pointer for getting started.

Pete


On Fri, Nov 19, 2010 at 4:35 AM, Jason Harrop  wrote:
> Hello
>
> I have used the JAXB tool XJC to generate a set of classes which
> represent 
> http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/src/foschema/fop.xsd
>
> As wikipedia explains, "Java Architecture for XML Binding (JAXB)
> allows Java developers to map Java classes to XML representations.
> JAXB provides two main features: the ability to marshal Java objects
> into XML and the inverse, i.e. to unmarshal XML back into Java
> objects".  JAXB is similar to XMLBeans.  It is JSR-222.
>
> You can see the Java classes for fop.xsd at
> http://dev.plutext.org/svn/docx4j/trunk/docx4j/src/xslfo/org/plutext/jaxb/xslfo/
>
> My motivation was initially to be able to create somewhat complex
> layout master set; see
> http://dev.plutext.org/svn/docx4j/trunk/docx4j/src/main/java/org/docx4j/convert/out/pdf/viaXSLFO/LayoutMasterSetBuilder.java
>
> I'm planning to publish the code somewhere as a code base independent
> from docx4j.  Is there any interest in having it as part of FOP?
>
> What if FOP could ingest these Java objects directly (ie without the
> having to be marshalled first)?
>
> If there is no interest, that's fine.  I'll just put the code on
> Google Code, say.
>
> cheers . Jason
>


Re: svn commit: r1036179 [1/2] - in /xmlgraphics/fop/trunk

2010-11-19 Thread Simon Pepping
I will revert the renaming of public methods. It was not a good idea.
Sorry for the noise.

Simon

On Thu, Nov 18, 2010 at 05:03:34PM +0100, Simon Pepping wrote:
> It breaks org.krysalis.barcode4j.fop.BarcodeXMLHandler: getNamespace
> -> getNameSpace (from render.xml.XMLXMLHandler.getNamespace ->
> getNameSpace
> 
> On Thu, Nov 18, 2010 at 04:42:44PM +0100, Simon Pepping wrote:
> > render.AbstractGenericSVGHandler.getNamespace -> getNameSpace
> > render.intermediate.extensions.AbstractAction.setID -> setId
> > render.intermediate.extensions.AbstractAction.getID -> getId
> > render.intermediate.extensions.AbstractAction.hasID -> hasId
> > render.intermediate.extensions.AbstractAction.getIDPrefix -> getIdPrefix
> > render.intermediate.extensions.URIAction.getIDPrefix -> getIdPrefix
> > render.XMLHandler.getNamespace -> getNameSpace
> > render.ps.PSImageFormResource.getImageURI -> getImageUri
> > render.xml.XMLXMLHandler.getNamespace -> getNameSpace
> > render.afp.AFPRendererImageInfo.getURI -> getUri
> > fonts.type1.PFMFile.getPostscriptName -> getPostScriptName
> > tools.TestConverter.setBaseDir -> setBasedir
> > tools.anttasks.Fop.setUserconfig -> setUserConfig
> > tools.anttasks.Fop.getUserconfig -> getUserConfig()
> > tools.anttasks.Fop.setFofile -> setFoFile
> > tools.anttasks.Fop.getFofile -> getFoFile
> > tools.anttasks.Fop.setThrowexceptions -> setThrowExceptions
> > tools.anttasks.Fop.getThrowexceptions -> getThrowExceptions
> > apps.PageSequenceResults.getID -> getId
> > fo.FOText.getBaseLineShift -> getBaselineShift
> > cli.CommandLineOptions.getFOFile -> getFoFile
> > cli.CommandLineOptions.getXMLFile -> getXmlFile
> > cli.CommandLineOptions.getXSLFile -> getXslFile
> > 
> > On Wed, Nov 17, 2010 at 09:29:06PM +0100, Simon Pepping wrote:
> > > On Wed, Nov 17, 2010 at 07:45:31PM -, spepp...@apache.org wrote:
> > > > Author: spepping
> > > > Date: Wed Nov 17 19:45:27 2010
> > > > New Revision: 1036179
> > > > 
> > > > URL: http://svn.apache.org/viewvc?rev=1036179&view=rev
> > > > Log:
> > > > findbugs-reported bug squashing; 959 bugs left (findbugs 1.3.9)
> > > 
> > > findbugs reports naming problems in public methods, such as setters
> > > and getters. I resolved those problems. But in doing so, in principle
> > > I am changing the public API. I do not think that every public method
> > > is really in use by other applications. Let me know when I go too far
> > > in those changes, harming applications that depend on fop.
> > > 
> > > Simon
> > > 


Re: What is Renderable?

2010-11-19 Thread Jeremias Maerki
Answered on fop-users.

On 18.11.2010 16:16:41 Eric Douglas wrote:
> So I sent a message to the fop-users list yesterday because there's
> something I can't figure out how to do, but it might belong on the dev
> list if there actually isn't a way to do it?  So I'm a little
> confused...
> 
> Here's my case.
> 
> I'm using FOP 0.95 jars for reporting with embedded code in
> client-server programs using webstart.  I start with an XML file and an
> XSL file on the server.  I can transform these on the server and get the
> results in an output stream which I can send to a printer or copy to the
> client and save as a PDF on their local machine.  That works great.
> 
> Now I have an option to send the output to a custom print preview window
> using the PreviewPanel object.  That of course has to be created on the
> client.  I don't see any way to use the output stream from the transform
> on the server as input to that object.  The only way I currently have it
> working is to stream down the XML and XSL files and do the transform on
> the client.  It seems this loads the data into the PreviewPanel object
> because the PreviewPanel constructor passes in the FOUserAgent, which is
> also the input parameter to the FopFactory.newFop() method, the
> Fop.getDefaultHandler method is the input to the SAXResult constructor,
> and the SAXResult is the input to the transform so they're all linked.
> This takes a lot longer than transforming on the server and getting the
> output stream which can either be printed or saved as a PDF.  Am I
> missing something?  Does all of this processing have to be done on the
> client to use the PreviewPanel?  It has a third input parameter of class
> Renderable.  It seems this refers to an interface, but I don't see
> anything which implements it or returns an object of this class.  Do I
> need to create my own custom class to use it?  Does this need to be
> connected to the FOTreeBuilder or DefaultHandler class?  Why does
> AWTRenderer have a setRenderable method but no getRenderable method?
> 




Jeremias Maerki



Re: wrong glyph shown for box (was: TrueType Font Embedding)

2010-11-19 Thread Jeremias Maerki
Hi Eric

Sorry for the delay. I've looked at your example you've sent me off-list.

On 12.11.2010 09:32:13 Jeremias Maerki wrote:

> > The problem I'm currently having with output is rendering special
> > unicode glyphs.  I sent one unicode as a 25AB with the font file
> > LTYPE.TTF which came installed with Windows XP.  In FOP 0.95 it produced
> > a square which is what I want.  That character is supposed to be a
> > square.  If I'm wrong and that character is not in the font then the
> > square was the default print for character not found.  I'd like to be
> > able to run a routine through FOP to get out a list of all unicodes and
> > what characters they go with for a particular font.  When I tried FOP
> > 1.0, that same code produced a pound #.
> 
> Hmm, sounds like a regression. I guess we'll have to look into that then.
> And such a glyph dump utility is definitely something FOP could profit
> from. Has anybody already written something like that? We could
> integrate it into org.apache.fop.tools.fontlist maybe.

It's not really a regression although the change is curious. Anyway, the
box you got with FOP 0.95 was not the 0x25AB character (WHITE SMALL
SQUARE) but actually the .notdef glyph which often is a big square (not
a small square). In later versions, FOP seems to catch the missing
character and replace it by "#". The "#" character is not really the
right one to display for a glyph that was not found, but FOP has been
doing that for 10 years. Maybe that gets looked at at some point. But
I don't know (and won't investigate) why FOP didn't produce a "#".

Anyway, the 0x25AB glyph is not in the font you're using. If you want a
little square glyph, you need to use a different font. You can use
Windows' "Character Map" tool to find a suitable one.



Jeremias Maerki



buildbot success in ASF Buildbot on fop-trunk

2010-11-19 Thread buildbot
The Buildbot has detected a restored build of fop-trunk on ASF Buildbot.
Full details are available at:
 http://ci.apache.org/builders/fop-trunk/builds/69

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: ceres_ubuntu

Build Reason: The Nightly scheduler named 'fopNightly' triggered this build
Build Source Stamp: HEAD
Blamelist: 

Build succeeded!

sincerely,
 -The Buildbot



Re: TrueType Font Embedding

2010-11-19 Thread Jeremias Maerki
On 18.11.2010 16:05:25 mehdi houshmand wrote:
> All that being said, I could implement my initial proposal, obviously
> it would have to be user friendly and not conflict with the settings
> already available, so maybe a parameter called "embedding" with two
> possible values, "full" and "subset" (since the "none" is already
> covered by referenced fonts).

+1
embedding="auto|full|subset"
(default: auto, where auto=type1:full/ttf:subset like we have for PDF).

Also, we have to keep in mind that with the current code, embedding the
full font (in /snfts) will likely result in the same problem as before I
switched to the GlyphDirectory approach for subset TTF. Might make sense
to switch that, too.

> As for the unique prefix for the font name, may I suggest moving it
> from the font level (o.a.f.fonts.MultiByteFont) to PS level (maybe
> implemented in somewhere like o.a.f.render.ps.PSFontUtils), this would
> allow a more intelligent implementation since PS and PDF don't have
> the same requirements in this case since PDF prefixes only need to be
> unique to the document.

+1

And to answer Chris' question:

On 17.11.2010 09:42:19 Chris Bowditch wrote:
> So now where does 
> that leave us in terms of the configuration and/or implementation details?

- I think we agree that the regex mechanism for referencing is useful.

- FOP should automatically switch to single-byte encoding if referencing
is activated for a font (like we already do for PDF output). That
increases the probability that a pre-installed font is going to work
(because it probably has a /CharStrings dict).

- We can switch between single-byte and cid with the encoding attribute
which is useful, but mostly an advanced option for people who know what
they are doing.

- For PDF we have full embedding for Type 1 and CID subset embedding for
TTF by default. I think that's a good default especially since we don't
support Type1 subsetting. That behaviour should be applied to PostScript,
too, IMO.

- Now, for some advanced use cases (PS post-processing), we need full
TTF embedding for PS output. Mehdi's embedding="full" will do that trick,
but the /sfnts boundary problem needs to be sorted out (possibly by also
switching to /GlyphDirectory there).

- Obviously, embedding="subset" with a Type 1 font currently needs to
result in a "NYI" exception.


Just a thought: we could think about an encoding="unicode" option which
would use 16-bit Unicode values as character codes (instead of the
direct glyph addressing by index with Identity-H). That would mean
generating appropriate CMaps. I'm not sure if it would solve any problem
other than make debugging/reading PS files easier. Of course, it would
not allow Unicode characters above 0x. As I said: just a thought.

Jeremias Maerki