Add latex preamble to texmanager _fontconfig #4895
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The contents of
TexManager._fontconfig
determines whether the png for a given string/dpi/font combination is rendered from TeX or reused from the cache. Right now, there is no information of the custom latex preamble in_fontconfig
, so a second string with a different latex preamble will reuse the png from the first call. Note that the tex and dvi files are generated as generating this depends on the_rc_cache
which includes the latex preamble, so the expensive call to TeX is made but then the png is not used. This PR adds a hash of the latex preamble toTexManager._fontconfig
so that a new png is read if preamble changes.A minimal example which should produce two different images: