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 <vi...@anyware-tech.com> on 2006/10/05 15:04:58 UTC

Re: FOP embed truetype font into postscript file [was in fop-users]

(Switching to the fop-dev list, as this discussion is becoming more and
more code-related. I suggest you to subscribe to this list if you
haven't already.)

Nguyen, Thang a écrit :
> Now I'm drown in PostScript specification :), could you tell how or where can I find documents on the way FOP uses font metric file & embeded font with pdf ouput, and what's the current way of FOP deals with font metric file & post-script output. I hope that someone can help me, it would be a lots more easier than looking at the source code.

There is no particular documentation about how fonts are handled by Fop,
apart from the page explaining how to configure custom fonts [1]. So
you'll have to look at the source code. Unluckily for you, this area of
the code is undergoing some heavy refactoring, as the current font
library of Fop will soon be replaced with another one. That said, it
doesn't prevent you from starting to study how the PS renderer should be
 extended to support TrueType fonts.

For any font-related issue the PS renderer will rely on the aXSL API
[2]. So what would need to be done is to check that this API provides
all the necessary informations for embedding a TrueType font in the
rendered PS file. If so, then this is "only" a matter of writing the
necessary aXSL method calls within the PS renderer and putting the
needed postscript glue around the font informations.

If the API doesn't provide the necessary informations, then it will have
to be extended but we'll see that in a second step.

So I suggest you to start by having a look at the aXSL API, the code of
the PS renderer and the specifications of TrueType and Postscript. If
you have further questions then, just ask.

Vincent


[1] http://xmlgraphics.apache.org/fop/trunk/fonts.html
[2] http://www.axsl.org/font-r/

> 
> thanks,
> 
> Thang.
> 
> -----Original Message-----
> From: Vincent Hennebert [mailto:vincent.hennebert@anyware-tech.com] 
> Sent: Thursday, October 05, 2006 5:06 PM
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: FOP embed truetype font into postscript file
> 
> Nguyen, Thang a écrit :
>> Seem that a lots of works ahead :-) and do you know anything about 
>> GhostScript http://www.ghostscript.com/awki , I just looked at it 
>> yesterday and I hope that I can find something useful.
> 
> Ghostscript is a tool that can convert postscript or pdf files into image formats (PNG, JPEG), render them on screen, print them on non-postscript printers, re-work them (extract pages, n-up printing...), etc. While this is a very useful tool it won't interest you for that task, excepted for visualizing generated PS files. It is perhaps capable of extracting useful informations from postscript files, but I'm not sure.
> 
> HTH,
> Vincent
> 
> 
>> -----Original Message-----
>> From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
>> Sent: Thursday, October 05, 2006 4:33 AM
>> To: fop-users@xmlgraphics.apache.org
>> Subject: Re: FOP embed truetype font into postscript file
>>
>> I don't have much time right now, so I can only give you the most 
>> important stuff. I can give you more on the weekend, if you need more.
>>
>> The most important part is having the PostScript and TrueType 
>> specifications around:
>>
>> PS spec:
>> http://www.adobe.com/products/postscript/pdfs/PLRM.pdf
>>
>> Other PS-related docs:
>> http://partners.adobe.com/public/developer/ps/index_specs.html
>>
>> OpenType 1.4 spec (also applies to TrueType):
>> http://partners.adobe.com/public/developer/opentype/index_spec.html
>> http://www.microsoft.com/typography/otspec/default.htm
>>
>> Other font-related docs:
>> http://partners.adobe.com/public/developer/opentype/index.html
>>
>> I'd search for "Type 42" font in the PS language reference to start 
>> with.
>> However, if you want to have all glyphs of a TrueType font available 
>> you have to look into the CID keyed fonts direction. I don't know 
>> anything about how CID handling is done in PostScript, only for PDF, 
>> so for this part you're pretty much on your own for now. It's probably 
>> easiest, if you try to find/produce a PostScript file from a different 
>> application that can already generate the right code for handling 
>> TrueType fonts so you get an idea how this is done. You might also 
>> find some helpful information on the web.
>>
>> Another important hint is that some of the PostScript code is not in 
>> FOP itself but in XML Graphics Commons:
>> http://svn.apache.org/repos/asf/xmlgraphics/commons/trunk/src/java/org
>> /a
>> pache/xmlgraphics/ps/
>>
>> Most font-specific code, however, is still in FOP because we haven't 
>> factored out the font library, yet. So the rest of the code will be
>> here:
>> http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/src/java/org/apa
>> ch
>> e/fop/render/ps/
>>
>> Good luck!
>>
>> On 04.10.2006 02:48:52 Nguyen, Thang wrote:
>>> It's great. Could you guide me where to start ?
>>>
>>> Thang.
>>>
>>> -----Original Message-----
>>> From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
>>> Sent: Tuesday, October 03, 2006 2:49 PM
>>> To: fop-users@xmlgraphics.apache.org
>>> Subject: Re: FOP embed truetype font into postscript file
>>>
>>> There are currently no plans to implement TrueType support for 
>>> PostScript output. But you're welcome to help us with that. We can 
>>> give you pointers to get you started if you want to jump in.
>>>
>>> On 03.10.2006 05:19:42 Nguyen, Thang wrote:
>>>> hi,
>>>>  
>>>> I can not embed ttf font into postscript file using FOP_0.92_beta. 
>>>> The
>>>> document ( "fonts.pdf" in \fop-0.92beta\docs\0.92 ) wrote that 
>>>> Custom Embeding is enabled for PostScript file but I still can not
>> do that.
>>>>  
>>>> Do you know when will Apache support this feature ?
>>>>  
>>>> thanks,
>>>>  
>>>> Thang.
>>>>
>>
>> Jeremias Maerki


Re: FOP embed truetype font into postscript file

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Actually, Type 1 embedding works for PostScript. It's just that so far
nobody needed TrueType support badly enough to do something about it.

On 06.10.2006 11:55:00 Nguyen, Thang wrote:
> Could you tell me why Fop doesn't do embeding font into ps output,
> what's the difficult thing in doing do so or dev-team is just being busy
> with other tasks ?



Jeremias Maerki