Hi Chris,

On Friday, December 21, 2012 03:50:43 am Chris Bowditch wrote:
> Hi Alexey,
> 
> On 21/12/2012 03:07, Alexey Neyman wrote:
> > Yes, I want to understand how FOP treats the fonts in SVG (and, if you
> > know that, how fonts are selected in embedded MathML via JEuclid plugin
> > - we use that, too).
> > 
> > We've had some font discrepancies in the past depending on the fonts
> > installed on each developer's machine (in part, because some of the
> > authors are on Windows machines and some are on Linux - so they're
> > likely to have different fonts). Thus, we've decided to do away with
> > using system fonts and use only local fonts (i.e. fonts checked out from
> > the repository along with the document sources).
> 
> Understood. We have similar challenges too.
> 
> > On Thursday, December 20, 2012 03:32:04 pm Luis Bernardo wrote:
> >> With SVG, fonts are more complicated. The font used in the SVG needs to
> >> be installed in the system and needs to be configured in fop.xconf too.
> >> The warning you got usually happens when the font is in the system but
> >> not configured in fop.xconf, which looking at your example does not seem
> >> to be the case...
> > 
> > Are you saying that the font used in SVG needs to be present both as a
> > system font, even if it is listed in fop.conf? What is FOP going to use
> > then, system font or local font?
> > 
> > If it is using system font, that's more than disturbing. As I mentioned,
> > this completely prevents setting up a controlled environment with known
> > fonts.
> 
> yes that is true. Just to be clear, this is a limitation of Batik, not
> FOP. Batik uses the AWT Font system as mentioned by Mehdi and Pascal.
> Peter is researching the possibility of changing Batik so that it can
> use fonts defined in fop.xconf, but that is a long term project with no
> quick fix.

A couple more questions:

1. do you know if Batik would still use system font if there's an embedded 
font in the SVG? E.g.,

<svg>
  <defs>
    <font>
      <font-face font-family="Times New Roman" font-weight="normal"
                  font-style="normal">
        <glyph .../>
        ...
      </font-face>
    </font>
  </defs>
  <text font-family="'Times New Roman'" font-weight="normal"
        font-style="normal">Something</text>
</svg>

Will Batik use system font in this example?

2. Do you know how fonts are selected by JEuclid plugin for FOP (which handles 
MathML)? Is it also using system fonts?

Regards,
Alexey.

> 
> Thanks,
> 
> Chris
> 
> >> If you want to get to the bottom of the matter please indicate what
> >> version of fop you are using and what OS.
> > 
> > FOP 1.1, Linux (RedHat Enterprise, 6.2).
> > 
> >> Also, the use of metrics-url
> >> is not needed anymore (and is not recommended) so you can remove that.
> > 
> > I tried, it didn't have any effect on the warning.
> > 
> >> I see you refer to the font file TimesNewRoman.ttf without specifying a
> >> font-base path (which only works if you have the file in the same
> >> directory you have your *.fo file).
> > 
> > I made it so for this reduced test case. Originally, it was embed-
> > url="../fonts/TimesNewRoman.ttf" - as I mentioned above, we want to have
> > a controlled font environment.
> > 
> >> Is that font file an exact copy of
> >> the installed font in the system of the same name?
> > 
> > The machine does not have a 'Times New Roman' system font (it's a Linux
> > machine, it comes with a different set of system fonts by default).
> > 
> > But why would FOP need a system font if it has the required font
> > specified in the configuration file?
> > 
> > Another question is, would embedding fonts in SVGs prevent FOP from using
> > system fonts?
> > 
> > Regards,
> > Alexey.
> > 
> >> On 12/20/12 6:44 PM, Alexey Neyman wrote:
> >>> Hi Luis,
> >>> 
> >>> No, it is not the case. In the FO I am using, fo:root has a font-family
> >>> specified, and that font family is described in the fop.cfg.
> >>> 
> >>> Actually, I traced this warning down to the watermark image specified
> >>> for the background. However, that SVG does not refer to 'Serif' font,
> >>> either. Can somebody please explain how does FOP treat the fonts in
> >>> the included SVG files?
> >>> 
> >>> I even tried to add a substitution from font-family="Serif" to font-
> >>> family="Times New Roman", it did not help either.
> >>> 
> >>> Here is the reduced FO file that exhibits the issue:
> >>> 
> >>> [[[
> >>> <?xml version="1.0"?>
> >>> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";
> >>> font-family="Times New Roman">
> >>> 
> >>>     <fo:layout-master-set>
> >>>     
> >>>       <fo:simple-page-master master-name="draft">
> >>>       
> >>>         <fo:region-body background-image="url(draft.svg)"/>
> >>>       
> >>>       </fo:simple-page-master>
> >>>     
> >>>     </fo:layout-master-set>
> >>>     <fo:page-sequence master-reference="draft">
> >>>     
> >>>       <fo:flow flow-name="xsl-region-body">
> >>>       
> >>>         <fo:block/>
> >>>       
> >>>       </fo:flow>
> >>>     
> >>>     </fo:page-sequence>
> >>> 
> >>> </fo:root>
> >>> ]]]
> >>> 
> >>> And here is the draft.svg:
> >>> 
> >>> [[[
> >>> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> >>> <svg xmlns="http://www.w3.org/2000/svg"; viewBox="80 80 600 600"
> >>> 
> >>>       version="1.1" width="5in" height="5in">
> >>>     
> >>>     <text font-weight="normal" xml:space="preserve"
> >>>     
> >>>       transform="matrix(0.70710678,-0.70710678,0.70710678,0.70710678,0,
> >>>       0)" font-size="250px" y="640" x="-315" font-family="'Times New
> >>>       Roman'" fill="#f2f2f2">Draft</text>
> >>> 
> >>> </svg>
> >>> ]]]
> >>> 
> >>> And fop.cfg:
> >>> 
> >>> [[[
> >>> <?xml version="1.0"?>
> >>> <fop version="1.0">
> >>> 
> >>>     <renderers>
> >>>     
> >>>       <renderer mime="application/pdf">
> >>>       
> >>>         <fonts>
> >>>         
> >>>           <font kerning="yes" metrics-url="TimesNewRoman.metric" embed-
> >>> 
> >>> url="TimesNewRoman.ttf">
> >>> 
> >>>             <font-triplet name="Times New Roman" weight="normal"
> >>> 
> >>> style="normal"/>
> >>> 
> >>>           </font>
> >>>         
> >>>         </fonts>
> >>>       
> >>>       </renderer>
> >>>     
> >>>     </renderers>
> >>> 
> >>> </fop>
> >>> ]]]
> >>> 
> >>> Regards,
> >>> Alexey.
> >>> 
> >>> On Wednesday, December 19, 2012 04:45:31 pm Luis Bernardo wrote:
> >>>> This is of no consequence although is it puzzling at first. If you
> >>>> specify a global font-family in the fo root element I think the
> >>>> warning goes away. I think what you are seeing has been discussed
> >>>> here:
> >>>> http://apache-fop.1065347.n5.nabble.com/ZapfDingbats-and-Symbol-not-f
> >>>> oun d-w hereas-they-are-not-needed-td31330.html
> >>>> 
> >>>> On 12/19/12 11:05 PM, Alexey Neyman wrote:
> >>>>> Hi all,
> >>>>> 
> >>>>> I see the following warning message reported by FOP:
> >>>>> 
> >>>>> $ fop -c fop.cfg -dpi 150 apiguide.fo apiguide.pdf
> >>>>> Dec 19, 2012 2:59:02 PM org.apache.fop.events.LoggingEventListener
> >>>>> processEvent
> >>>>> WARNING: Font "Serif,normal,400" not found. Substituting with
> >>>>> "any,normal,400".
> >>>>> ...
> >>>>> 
> >>>>> However, apiguide.fo does not contain any references to 'serif' font:
> >>>>> 
> >>>>> $ grep -i serif apiguide.fo
> >>>>> $
> >>>>> 
> >>>>> Why does FOP need 'Serif' font? Is there some built-in expectation
> >>>>> that 'Serif' font must be always available?
> >>>>> 
> >>>>> Regards,
> >>>>> Alexey.
> >>>>> 
> >>>>> ---------------------------------------------------------------------
> >>>>> To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
> >>>>> For additional commands, e-mail:
> >>>>> fop-users-h...@xmlgraphics.apache.org
> >>>> 
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
> >>>> For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
> > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org

Reply via email to