Font specified in manifest.mf not found

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Font specified in manifest.mf not found

Jan Tosovsky
Hello Everyone,

I've defined my non-system font in manifest.mf file:

Name: me/jan/resources/fonts/droid-sans.ttf
Content-Type: application/x-font

The specified name corresponds to the package name me.jan.resources.fonts,
where that ttf file is stored.

I use minimum configuration:
<fop version="1.0">
    <renderers>
        <renderer mime="application/pdf">
            <fonts>
                <auto-detect/>
            </fonts>
        </renderer>
    </renderers>
</fop>

The font name is 'Droid Sans', it is of the Regular type and of the weight
400. If this font-family is used in the FO file this way:
<fo:block font-family="Droid Sans">Hello World!</fo:block>
I am getting this message:
WARNING: Font "Droid Sans,normal,400" not found. Substituting with
"any,normal,400".

I've also tested to prepend that path with /
Name: /me/jan/resources/fonts/droid-sans.ttf
But no progress.

What could be wrong with this configuration? (FOP 1.0, Win7)

Regards,
Jan

Btw, that font autodetection has been performed just for the first time and
from that moment I made several changes in the package hierarchy/font file
name. I suppose that font list is cached somehow. Would be helpful to empty
that chache? And how it can be triggered?



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Font specified in manifest.mf not found

mehdi houshmand
Hi Jan,

There is an alternative way to get FOP working with the correct font
which doesn't require any refreshing of the font cache. Most of the
necessary information can be found
(http://xmlgraphics.apache.org/fop/trunk/fonts.html) on the FOP
website. Is there any specific reason you need to include the font in
the manifest? Why not have that information in the fop.xconf?

Hope that helps

Mehdi

On 10 June 2011 23:55, honyk <[hidden email]> wrote:

> Hello Everyone,
>
> I've defined my non-system font in manifest.mf file:
>
> Name: me/jan/resources/fonts/droid-sans.ttf
> Content-Type: application/x-font
>
> The specified name corresponds to the package name me.jan.resources.fonts,
> where that ttf file is stored.
>
> I use minimum configuration:
> <fop version="1.0">
>    <renderers>
>        <renderer mime="application/pdf">
>            <fonts>
>                <auto-detect/>
>            </fonts>
>        </renderer>
>    </renderers>
> </fop>
>
> The font name is 'Droid Sans', it is of the Regular type and of the weight
> 400. If this font-family is used in the FO file this way:
> <fo:block font-family="Droid Sans">Hello World!</fo:block>
> I am getting this message:
> WARNING: Font "Droid Sans,normal,400" not found. Substituting with
> "any,normal,400".
>
> I've also tested to prepend that path with /
> Name: /me/jan/resources/fonts/droid-sans.ttf
> But no progress.
>
> What could be wrong with this configuration? (FOP 1.0, Win7)
>
> Regards,
> Jan
>
> Btw, that font autodetection has been performed just for the first time and
> from that moment I made several changes in the package hierarchy/font file
> name. I suppose that font list is cached somehow. Would be helpful to empty
> that chache? And how it can be triggered?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Font specified in manifest.mf not found

Jan Tosovsky
Hi Mehdi,

> > I've defined my non-system font in manifest.mf file:
> >
> > Name: me/jan/resources/fonts/droid-sans.ttf
> > Content-Type: application/x-font
> >
> > I am getting this message:
> > WARNING: Font "Droid Sans,normal,400" not found. Substituting with
> > "any,normal,400".

> Most of the necessary information can be found
> (http://xmlgraphics.apache.org/fop/trunk/fonts.html)
> on the FOP website.

thanks for the link to the trunk doc. I've used 1.0 version where the info
about cache was missing. Now it is more clear to me what is happening.

Looking into the source I've found the possible reason of my problem:
org.apache.xmlgraphics.util.ClasspathResource.getClassLoadersForResources()

This code searches for manifests in all the jar files in lib folder. But as
my code (library) is 'all in one' together with resources, it is not in lib
folder. After build it appears in 'dist' folder. So my manifest isn't even
touched.

So I am right and because of this limitaton I'll have to split resources
into a separate JAR library and reference it in my core library?

Jan


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]