mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-25 05:55:34 +00:00
J�rgen S's fix to bug 1817.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10468 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
53a118caea
commit
c302740b9b
@ -1,3 +1,10 @@
|
||||
2005-09-21 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
|
||||
|
||||
* scripts/legacy_lyxpreview2ppm.py:
|
||||
* scripts/lyxpreview2bitmap.py: ensure that the metrics file
|
||||
contains sensible fractional ascent data if the extracted
|
||||
ascent or descent data is zero.
|
||||
|
||||
2005-09-18 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* configure.py: add Bo Peng's experimental Python script to
|
||||
|
@ -91,13 +91,21 @@ def extract_metrics_info(log_file, metrics_file):
|
||||
error("Unexpected data in %s\n%s" % (log_file, line))
|
||||
|
||||
if snippet:
|
||||
ascent = string.atof(match.group(2)) + tp_ascent
|
||||
descent = string.atof(match.group(3)) - tp_descent
|
||||
ascent = string.atoi(match.group(2))
|
||||
descent = string.atoi(match.group(3))
|
||||
|
||||
frac = 0.5
|
||||
if ascent > 0 and descent > 0:
|
||||
ascent = float(ascent) + tp_ascent
|
||||
descent = float(descent) - tp_descent
|
||||
|
||||
if abs(ascent + descent) > 0.1:
|
||||
frac = ascent / (ascent + descent)
|
||||
|
||||
# Sanity check
|
||||
if frac < 0 or frac > 1:
|
||||
frac = 0.5
|
||||
|
||||
metrics.write("Snippet %s %f\n" % (match.group(1), frac))
|
||||
|
||||
else:
|
||||
|
@ -91,10 +91,16 @@ def extract_metrics_info(dvipng_stdout, metrics_file):
|
||||
# Calculate the 'ascent fraction'.
|
||||
descent = string.atof(match.group(2))
|
||||
ascent = string.atof(match.group(3))
|
||||
|
||||
frac = 0.5
|
||||
if ascent > 0 and descent > 0:
|
||||
if abs(ascent + descent) > 0.1:
|
||||
frac = ascent / (ascent + descent)
|
||||
|
||||
# Sanity check
|
||||
if frac < 0 or frac > 1:
|
||||
frac = 0.5
|
||||
|
||||
metrics.write("Snippet %s %f\n" % (match.group(1), frac))
|
||||
pos = match.end(3) + 2
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user