[ 
https://issues.apache.org/jira/browse/FOP-2554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15064135#comment-15064135
 ] 

Martin Hönings commented on FOP-2554:
-------------------------------------

See https://issues.apache.org/jira/browse/FOP-2532 for a correct solution.

> FopConfig permits file URI for fonts only
> -----------------------------------------
>
>                 Key: FOP-2554
>                 URL: https://issues.apache.org/jira/browse/FOP-2554
>             Project: FOP
>          Issue Type: Bug
>          Components: font/unqualified
>    Affects Versions: 2.0
>         Environment: all flatforms
>            Reporter: Mr. Povarnitsyn
>            Priority: Minor
>              Labels: font, uri
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> config has following:
>       <fonts>
>         <font metrics-url="classpath:///fonts/arialuni.xml" kerning="yes" 
> embed-url="classpath:///fonts/arialuni.ttf">
>           <font-triplet name="arialuni" style="normal" weight="normal"/>
>         </font>
> Exception on FontCache.java (line 335)
>                 File fontFile = new File(fontUri);
> My proposal:
> Instead:
>                 File fontFile = new File(fontUri);
>                 long lastModified = fontFile.lastModified();
>                 cachedFontFile = new CachedFontFile(lastModified);
> Write:
>               long lastModified = 0L;
>               if(fontUri.getScheme().equals("file")){
>                       File fontFile = new File(fontUri);
>                       lastModified = fontFile.lastModified();                 
>               }
>                 cachedFontFile = new CachedFontFile(lastModified);
> This code is working.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to