Re: [xep-support] Behavior of xml:base in font configuration file (3.77)

From: Alexander Peshkov (peshkov@renderx.com)
Date: Fri Aug 27 2004 - 01:14:44 PDT

  • Next message: W. Eliot Kimber: "Re: [xep-support] Behavior of xml:base in font configuration file (3.77)"

    Hello Eliot,

    Currently relative URLs in the xml:base property used in font
    configuration file are resolved with respect to location specified by
    METRICS property. By default METRICS is set to 'afm' subdirectory of
    XEP root. That's why you have such a result. I agree that this
    behavior is somewhat awkward and we will change it in the next major
    release. In the meantime you can work around this problem by setting
    METRICS to the path where fonts.xml is found. In general for font
    configuration in XEP 3.x it is recommended to set METRICS to the root
    fonts catalogue and then address all font file in fonts.xml by
    relative paths.
    Actually we have never advertised use of xml:base in fonts.xml :-)

    Best regards,
    Alexander Peshkov mailto:peshkov@renderx.com
    RenderX

    WEK> I think the behavior of xml:base in font configuration files is
    WEK> incorrect. At a minimum it's both different from what I expected and not
    WEK> useful as currently implemented (in that it doesn't help to make the
    WEK> font configuration file transportable).

    WEK> What I need to be able to do is create a font configuration file that
    WEK> can be deployed without knowledge of where either the file itself is put
    WEK> or where it is relative to the XEP installation. In this scenario both
    WEK> the font configuration file and the fonts it references are in
    WEK> consistent locations relative to each other.

    WEK> Here's what I have in my font configuration file:

    WEK> <fonts xml:base="../lib/fonts/">

    WEK> Where the font file is in a directory that is a sibling of the lib/
    WEK> directory, e.g.:

    WEK> dist/config/xep-fonts.xml
    WEK> dist/lib/fonts/someefont.ttf
    WEK> dist/lib/fonts/afm/Helvetica-BoldOblique.afm

    WEK> A typical font specification is:

    WEK> <font name="Helvetica-BoldOblique"
    WEK> afm="afm/Helvetica-BoldOblique.afm"
    WEK> embed="false">
    WEK> <alias name="Helv-BoldOblique"/>
    WEK> <alias name="Swiss-BoldOblique"/>
    WEK> </font>

    WEK> I am calling XEP with the FONTLIST set to the location of the
    WEK> xep-fonts.xml file, e.g.:

    WEK> XSLDriver -DXEP_HOME=$XEP_HOME
    WEK> -DFONTLIST=/user/local/dist/config/xep-fonts.xml
    WEK> myfile.fo

    WEK> When I make the xml:base value an absolute path ending in "lib/fonts"
    WEK> then this font is resolved.

    WEK> If I use the above relative xml:base, then I get a failure message like
    WEK> this:

    WEK> [error] java.io.FileNotFound exception:
    WEK> /home/xml/XEP/fonts/afm/Helvetica.afm (No such file or directory)

    WEK> This suggests that XEP is using the location of the Java JAR file, not
    WEK> the location of the xep-fonts.xml file, as the base for constructing an
    WEK> absolute URL from the relative xml:base value.

    WEK> My reading of both the XML Base specs and RFC 2396, on which it depends,
    WEK> suggest that in a case like this the location of the document should be
    WEK> used as the base for resolving relative URIs.

    WEK> This is with version 3.77.

    WEK> Cheers,

    WEK> Eliot

    -------------------
    (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
    in the body of the message to majordomo@renderx.com from the address
    you are subscribed from.
    (*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html



    This archive was generated by hypermail 2.1.5 : Fri Aug 27 2004 - 01:35:22 PDT