Simone Rondelli commented on FOP-2650:

Indeed that is my usecase. I have currently an in-house hacky solution but I'm 
planning to make it generic/configurable from outside.

There are currently 2 ways of implementing it

# Moved the usage data into a Map that represents <renderer,per-renderer usage 
data> pairs.
# Cache the content of the font (the information that are read from the file) 
and then create new instances of the font using such information instead of 
reading again from file

If nobody has more opinions I would go with the first one, as you suggested.

> Cache CustomFont instances 
> ---------------------------
>                 Key: FOP-2650
>                 URL: https://issues.apache.org/jira/browse/FOP-2650
>             Project: FOP
>          Issue Type: Improvement
>          Components: font/unqualified
>            Reporter: Simone Rondelli
>            Priority: Minor
> Custom fonts are loaded through the {{FontLoader}} class on every rendering 
> (for every renderer). For big font files (Eg. Chinese/Japanese/Korean fonts) 
> this can be a really CPU intensive operation.
> The aim of this improvement is to implement a cache mechanism that will cache 
> the Font Instances or the informations contained into them.
> NB: The class {{Typeface}} has a {{charMapOps}} field that keeps track of the 
> usage of the font during the rendering. This field is used in 
> {{PDFResource.addFonts()}} to determine whether to include the Font into the 
> PDF file. Caching this value will lead to problems.

This message was sent by Atlassian JIRA

Reply via email to