Le 25/06/2015 00:44, Enrico Forestieri a écrit :
On Mon, Jun 22, 2015 at 11:32:17PM +0100, Guillaume M-M wrote:

3) Previews have the incorrect size with layouts that offer font sizes other
than 1[0-2]pt (lyx-preview-fontsize.lyx). The legacy method offers a
function that retrieves the actual font size and calculates the actual dpi.
Attached is a patch (extract_resolution.diff) that imports this function in
the new script.

Thank you, this is much better than trying to catch all possible cases.
I have applied the patch to master at 0751f96d.


Thank you for applying it.

Here's a trivial patch for stable, if you are not ready to backport 0751f96d. Both were tested in stable.

Guillaume
diff --git a/lib/scripts/lyxpreview2bitmap.py b/lib/scripts/lyxpreview2bitmap.py
index 9775b0e..8cd3c09 100755
--- a/lib/scripts/lyxpreview2bitmap.py
+++ b/lib/scripts/lyxpreview2bitmap.py
@@ -159,7 +159,7 @@ def extract_metrics_info(dvipng_stdout):
 
 
 def fix_latex_file(latex_file, pdf_output):
-    documentclass_re = re.compile("(\\\\documentclass\[)(1[012]pt,?)(.+)")
+    documentclass_re = re.compile("(\\\\documentclass\[)([0-9]+pt,?)(.+)")
     def_re = re.compile(r"(\\newcommandx|\\global\\long\\def)(\\[a-zA-Z]+)")
 
     tmp = mkstemp()

Reply via email to