Juergen Spitzmueller <[EMAIL PROTECTED]> writes:

> could this be bug 2167? If yes, could you get Bo Peng testing your patch?
> http://bugzilla.lyx.org/show_bug.cgi?id=2167

Hi Jürgen,

no, it is not the same. The patch for bug 2167 is buried in the patch you
can find in this thread:
http://thread.gmane.org/gmane.editors.lyx.devel/51140

In that patch, only the lines containing "ascent" and "descent" are
pertinent to bug 2167, though. I don't think it is necessary to ask Bo,
because I also observed that bug and thereafter it disappeared.
Bug 2167 was due to the fact that when a previewed image had no descent
(descent=0) then the fraction ascent/(ascent+descent) was never evaluated
and its value was assumed to be 0.5.

The problem I am referring to here is different. By trial and error I found
that for a given "Screen DPI" and "Zoom %" set in Tools->Preferences,
there exist a magical value for \preview_scale_factor by which all
previewed images line up correctly with the surrounding text.
But, if you change the latex font size in Document->Settings, the dimension
of the previewed images, and thus their alignment, change, whereas the
text surrounding the images is not affected by the change in latex font
size (11pt, 12pt).

To make the previewed images insensitive to a change in the latex font
size it suffices to omit the font size specification in the optional
arguments of \documentclass in the file #lyxpreview.tex that LyX builds.

I patched the lyxpreview2bitmap.py file to accomplish this goal, but IMO
it is not the right patch, as LyX should provide a proper #lyxpreview.tex.
However, due to my scarce knowledge of C++ and of the LyX sources, I am
not able to devise the right patch, so I was asking for someone more
knowledgeable than me to spot the right point in the LyX C++ sources.

> > Btw, I think that it would be useful to add a GUI way for changing
> > preview_scale_factor.
> 
> Probably (this is bug 2151 btw).

Ehm... yes it is. I should have checked bugzilla, sorry :-(

--
Enrico


Reply via email to