You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xmlgraphics.apache.org by Vincent Hennebert <vh...@gmail.com> on 2010/06/11 19:22:21 UTC

PSProcSets: purpose of /cw definition in F procedure?

Hi,

The XML Graphics PostScript ProcSet contains the following definition:
/F {
  /Tp exch def
  /Tf exch def
  Tf findfont Tp scalefont setfont
  /cf Tf def  /cs Tp def  /cw ( ) stringwidth pop def
} bd

The definition of /cw will work only if the font uses a single-byte
encoding (in which the space character is actually encoded on byte
number 32). Composite fonts use a more complex encoding.

The question is: what purpose does this /cw serve? I did a grep in the
whole XML Graphics and FOP codebase and AFAICT it’s not being used
anywhere. Can we get rid of it?

Thanks,
Vincent

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


Re: PSProcSets: purpose of /cw definition in F procedure?

Posted by Julien Aymé <ju...@gmail.com>.
Very nice!

Thanks a lot,
Julien

2010/6/15 Jeremias Maerki <de...@jeremias-maerki.ch>:
> I've moved the writing of the ProcSets to a protected method in
> AbstractDocumentGraphics2D so you don't have to copy the whole code for
> the file header. HTH
>
> http://svn.apache.org/viewvc?rev=954770&view=rev
>
> On 15.06.2010 09:34:50 Julien Aymé wrote:
>> Concerning the definition of the PSProcSet within the PS document, I
>> would like to be able to add user-defined PostScript procedure.
>> In order to do so, I have to overwrite the
>> PSDocumentGraphics2D#writeFileHeader method, and recopy the whole
>> code, and adding my own procedures in the setup block of the PS
>> document.
>>
>> Is there a nicer way to do so?
>>
>> If not, I will keep mine as it.
>>
>> Regards,
>> Julien
>>
>> 2010/6/15 Jeremias Maerki <de...@jeremias-maerki.ch>:
>> > Sorry for the late reply. I meant to do that yesterday but SVN was down.
>> > I've looked into SVN history and the /cw dates back to 2001 when I
>> > submitted the first version of a PSRenderer (before I became a committer).
>> > I can't recall why I've added that. If everything still works without it,
>> > then I guess it wasn't necessary and it was fine to remove it.
>> >
>> > On 11.06.2010 19:22:21 Vincent Hennebert wrote:
>> >> Hi,
>> >>
>> >> The XML Graphics PostScript ProcSet contains the following definition:
>> >> /F {
>> >>   /Tp exch def
>> >>   /Tf exch def
>> >>   Tf findfont Tp scalefont setfont
>> >>   /cf Tf def  /cs Tp def  /cw ( ) stringwidth pop def
>> >> } bd
>> >>
>> >> The definition of /cw will work only if the font uses a single-byte
>> >> encoding (in which the space character is actually encoded on byte
>> >> number 32). Composite fonts use a more complex encoding.
>> >>
>> >> The question is: what purpose does this /cw serve? I did a grep in the
>> >> whole XML Graphics and FOP codebase and AFAICT it’s not being used
>> >> anywhere. Can we get rid of it?
>> >>
>> >> Thanks,
>> >> Vincent
>> >>
>> >
>> >
>> >
>> > Jeremias Maerki
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
>> > For additional commands, e-mail: general-help@xmlgraphics.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: general-help@xmlgraphics.apache.org
>>
>
>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: general-help@xmlgraphics.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


Re: PSProcSets: purpose of /cw definition in F procedure?

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I've moved the writing of the ProcSets to a protected method in
AbstractDocumentGraphics2D so you don't have to copy the whole code for
the file header. HTH

http://svn.apache.org/viewvc?rev=954770&view=rev

On 15.06.2010 09:34:50 Julien Aymé wrote:
> Concerning the definition of the PSProcSet within the PS document, I
> would like to be able to add user-defined PostScript procedure.
> In order to do so, I have to overwrite the
> PSDocumentGraphics2D#writeFileHeader method, and recopy the whole
> code, and adding my own procedures in the setup block of the PS
> document.
> 
> Is there a nicer way to do so?
> 
> If not, I will keep mine as it.
> 
> Regards,
> Julien
> 
> 2010/6/15 Jeremias Maerki <de...@jeremias-maerki.ch>:
> > Sorry for the late reply. I meant to do that yesterday but SVN was down.
> > I've looked into SVN history and the /cw dates back to 2001 when I
> > submitted the first version of a PSRenderer (before I became a committer).
> > I can't recall why I've added that. If everything still works without it,
> > then I guess it wasn't necessary and it was fine to remove it.
> >
> > On 11.06.2010 19:22:21 Vincent Hennebert wrote:
> >> Hi,
> >>
> >> The XML Graphics PostScript ProcSet contains the following definition:
> >> /F {
> >>   /Tp exch def
> >>   /Tf exch def
> >>   Tf findfont Tp scalefont setfont
> >>   /cf Tf def  /cs Tp def  /cw ( ) stringwidth pop def
> >> } bd
> >>
> >> The definition of /cw will work only if the font uses a single-byte
> >> encoding (in which the space character is actually encoded on byte
> >> number 32). Composite fonts use a more complex encoding.
> >>
> >> The question is: what purpose does this /cw serve? I did a grep in the
> >> whole XML Graphics and FOP codebase and AFAICT it’s not being used
> >> anywhere. Can we get rid of it?
> >>
> >> Thanks,
> >> Vincent
> >>
> >
> >
> >
> > Jeremias Maerki
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: general-help@xmlgraphics.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: general-help@xmlgraphics.apache.org
> 




Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


Re: PSProcSets: purpose of /cw definition in F procedure?

Posted by Vincent Hennebert <vh...@gmail.com>.
Thanks for your answer BTW. I’ve removed it in the branch. If nobody
complains by then the change will be merged back in the Trunk.

Vincent


Jeremias Maerki wrote:
> Sorry for the late reply. I meant to do that yesterday but SVN was down.
> I've looked into SVN history and the /cw dates back to 2001 when I
> submitted the first version of a PSRenderer (before I became a committer).
> I can't recall why I've added that. If everything still works without it,
> then I guess it wasn't necessary and it was fine to remove it.
> 
> On 11.06.2010 19:22:21 Vincent Hennebert wrote:
>> Hi,
>>
>> The XML Graphics PostScript ProcSet contains the following definition:
>> /F {
>>   /Tp exch def
>>   /Tf exch def
>>   Tf findfont Tp scalefont setfont
>>   /cf Tf def  /cs Tp def  /cw ( ) stringwidth pop def
>> } bd
>>
>> The definition of /cw will work only if the font uses a single-byte
>> encoding (in which the space character is actually encoded on byte
>> number 32). Composite fonts use a more complex encoding.
>>
>> The question is: what purpose does this /cw serve? I did a grep in the
>> whole XML Graphics and FOP codebase and AFAICT it’s not being used
>> anywhere. Can we get rid of it?
>>
>> Thanks,
>> Vincent
>>
> 
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: general-help@xmlgraphics.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


Re: PSProcSets: purpose of /cw definition in F procedure?

Posted by Julien Aymé <ju...@gmail.com>.
Concerning the definition of the PSProcSet within the PS document, I
would like to be able to add user-defined PostScript procedure.
In order to do so, I have to overwrite the
PSDocumentGraphics2D#writeFileHeader method, and recopy the whole
code, and adding my own procedures in the setup block of the PS
document.

Is there a nicer way to do so?

If not, I will keep mine as it.

Regards,
Julien

2010/6/15 Jeremias Maerki <de...@jeremias-maerki.ch>:
> Sorry for the late reply. I meant to do that yesterday but SVN was down.
> I've looked into SVN history and the /cw dates back to 2001 when I
> submitted the first version of a PSRenderer (before I became a committer).
> I can't recall why I've added that. If everything still works without it,
> then I guess it wasn't necessary and it was fine to remove it.
>
> On 11.06.2010 19:22:21 Vincent Hennebert wrote:
>> Hi,
>>
>> The XML Graphics PostScript ProcSet contains the following definition:
>> /F {
>>   /Tp exch def
>>   /Tf exch def
>>   Tf findfont Tp scalefont setfont
>>   /cf Tf def  /cs Tp def  /cw ( ) stringwidth pop def
>> } bd
>>
>> The definition of /cw will work only if the font uses a single-byte
>> encoding (in which the space character is actually encoded on byte
>> number 32). Composite fonts use a more complex encoding.
>>
>> The question is: what purpose does this /cw serve? I did a grep in the
>> whole XML Graphics and FOP codebase and AFAICT it’s not being used
>> anywhere. Can we get rid of it?
>>
>> Thanks,
>> Vincent
>>
>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: general-help@xmlgraphics.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


Re: PSProcSets: purpose of /cw definition in F procedure?

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Sorry for the late reply. I meant to do that yesterday but SVN was down.
I've looked into SVN history and the /cw dates back to 2001 when I
submitted the first version of a PSRenderer (before I became a committer).
I can't recall why I've added that. If everything still works without it,
then I guess it wasn't necessary and it was fine to remove it.

On 11.06.2010 19:22:21 Vincent Hennebert wrote:
> Hi,
> 
> The XML Graphics PostScript ProcSet contains the following definition:
> /F {
>   /Tp exch def
>   /Tf exch def
>   Tf findfont Tp scalefont setfont
>   /cf Tf def  /cs Tp def  /cw ( ) stringwidth pop def
> } bd
> 
> The definition of /cw will work only if the font uses a single-byte
> encoding (in which the space character is actually encoded on byte
> number 32). Composite fonts use a more complex encoding.
> 
> The question is: what purpose does this /cw serve? I did a grep in the
> whole XML Graphics and FOP codebase and AFAICT it’s not being used
> anywhere. Can we get rid of it?
> 
> Thanks,
> Vincent
> 



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org