You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Vincent Hennebert <vh...@gmail.com> on 2010/02/12 12:22:57 UTC

Re: svn commit: r908543 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java

Hi Jeremias,

> Author: jeremias
> Date: Wed Feb 10 15:37:04 2010
> New Revision: 908543
> 
> URL: http://svn.apache.org/viewvc?rev=908543&view=rev
> Log:
> Bugzilla #48512:
> Bugfix: Don't map AdobeStandardEncoding to StandardEncoding. They are not the same. Fixes problem with invalid character widths on PostScript output and missing umlauts.

What makes you think that they are not the same? What is
AdobeStandardEncoding then, if not the Adobe Standard Encoding [1]
itself?

[1] http://www.adobe.com/devnet/opentype/archives/std_enc.html

Thanks,
Vincent


> Modified:
>     xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java
> 
> Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java
> URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java?rev=908543&r1=908542&r2=908543&view=diff
> ==============================================================================
> --- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java (original)
> +++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java Wed Feb 10 15:37:04 2010
> @@ -141,7 +141,7 @@
>          if (afm != null) {
>              String encoding = afm.getEncodingScheme();
>              singleFont.setUseNativeEncoding(true);
> -            if ("AdobeStandardEncoding".equals(encoding)) {
> +            if ("StandardEncoding".equals(encoding)) {
>                  singleFont.setEncoding(CodePointMapping.STANDARD_ENCODING);
>              } else {
>                  String effEncodingName;

Re: svn commit: r908543 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Hi Vincent

I was mislead by the fact that indeed we cannot rely on the mapping
information in the AFM file for all Type 1 fonts. Some Type 1 fonts like
the one mentioned by Pascal in bug #48512 have character codes that
don't match the font's primary encoding. I've added some code that can
override the mapping information in the AFM file in those cases where we
don't have to build a font-specific encoding. In this case we don't have
any other option than to rely on the AFM. I've extended my test set of
Type 1 fonts in the meantime and tested all combinations PDF/PS and
renderer/painter. IMO, it should work now....at least until the next
peculiar font pops up.

However to get back to "StandardEncoding" vs. "AdobeStandardEncoding": I
haven't found any documentation that explicitely says that the two are
the same or different. The PostScript LM only talks about
"StandardEncoding" and that's what we have to work with in PDF, too.
"AdobeStandardEncoding" only appears in the AFM spec but it doesn't say
what it means. Your link was probably the missing bit of information to
establish that the two are the same.

At any rate, I believe the issue should now be fixed. I'd appreciate
another set of eyes on the change, though. I don't have every single
font in the Universe to test with.

On 12.02.2010 12:22:57 Vincent Hennebert wrote:
> Hi Jeremias,
> 
> > Author: jeremias
> > Date: Wed Feb 10 15:37:04 2010
> > New Revision: 908543
> > 
> > URL: http://svn.apache.org/viewvc?rev=908543&view=rev
> > Log:
> > Bugzilla #48512:
> > Bugfix: Don't map AdobeStandardEncoding to StandardEncoding. They are not the same. Fixes problem with invalid character widths on PostScript output and missing umlauts.
> 
> What makes you think that they are not the same? What is
> AdobeStandardEncoding then, if not the Adobe Standard Encoding [1]
> itself?
> 
> [1] http://www.adobe.com/devnet/opentype/archives/std_enc.html
> 
> Thanks,
> Vincent
> 
> 
> > Modified:
> >     xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java
> > 
> > Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java
> > URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java?rev=908543&r1=908542&r2=908543&view=diff
> > ==============================================================================
> > --- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java (original)
> > +++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java Wed Feb 10 15:37:04 2010
> > @@ -141,7 +141,7 @@
> >          if (afm != null) {
> >              String encoding = afm.getEncodingScheme();
> >              singleFont.setUseNativeEncoding(true);
> > -            if ("AdobeStandardEncoding".equals(encoding)) {
> > +            if ("StandardEncoding".equals(encoding)) {
> >                  singleFont.setEncoding(CodePointMapping.STANDARD_ENCODING);
> >              } else {
> >                  String effEncodingName;




Jeremias Maerki