[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lyx-devel
Subject:    Re: textsubscript and textsuperscript bug?
From:       Richard Heck <rgheck () lyx ! org>
Date:       2013-03-27 15:00:57
Message-ID: 515309A9.9030608 () lyx ! org
[Download RAW message or body]

On 03/26/2013 08:41 PM, Scott Kostyshak wrote:
> On Mon, Feb 4, 2013 at 7:47 AM, Csikos Bela <bcsikos425@freemail.hu> wrote:
> > Hello:
> > 
> > I guess this is a bug in lyx 2.0.5:
> > When a subscript (\textsubscript) or superscript (\textsuperscript) character is \
> > inserted in a text that has different font size than default, the size of the \
> > sub- or superscript character is incorrect in the output; it has the same size as \
> > text. This occurs if the sub- or superscript character is inserted in a text \
> > (that has different font size than default) afterwards. If the text including the \
> > sub- or superscript character is written in normal size and the font size is \
> > changed subsequently (by selecting text including the sub- or superscript \
> > character and changing size), the sizes are correct. See the attached lyx example \
> > and the corresponding pdf output.
> Hi bcsikos,
> 
> Was this addressed? I don't know enough to know if this is a bug. If
> no one else chimes in, please post a ticket on
> http://www.lyx.org/trac/
> 
> Also note that emails regarding bug reports should be sent to the
> developers list.

This got reported as #8610. The problem is that we are generating some 
default CSS for this inset, and we are doing that because the font is 
set by default, in the InsetLayout constructor, to sane_font, which 
specifies values for everything. If I add
     Font
     EndFont
to the Script:superscript InsetLayout declaration, then things work 
fine, since this sets effectively sets the font to inherit_font.

That seems like the right thing to me: that, by default, an InsetLayout 
should get an "empty" font that does not do anything, not a fully 
specified font that resets everything. Yes?

I.e., I am proposing:

diff --git a/src/insets/InsetLayout.cpp b/src/insets/InsetLayout.cpp
index 7729485..aa35f50 100644
--- a/src/insets/InsetLayout.cpp
+++ b/src/insets/InsetLayout.cpp
@@ -34,7 +34,7 @@ namespace lyx {
  InsetLayout::InsetLayout() :
      name_(from_ascii("undefined")), lyxtype_(STANDARD),
      labelstring_(from_ascii("UNDEFINED")), contentaslabel_(false),
-    decoration_(DEFAULT), latextype_(NOLATEXTYPE), font_(sane_font),
+    decoration_(DEFAULT), latextype_(NOLATEXTYPE), font_(inherit_font),
      labelfont_(sane_font), bgcolor_(Color_error),
      htmlforcecss_ (false), htmlisblock_(true),
      multipar_(true), custompars_(true), forceplain_(false),

Richard


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic