|
From: <ai...@us...> - 2011-07-04 20:22:51
|
Revision: 11786
http://plplot.svn.sourceforge.net/plplot/?rev=11786&view=rev
Author: airwin
Date: 2011-07-04 20:22:44 +0000 (Mon, 04 Jul 2011)
Log Message:
-----------
Fix obvious bug in order in which superscript/subscript level is
restored for open_span_tag. This fixes the cairo device driver
vertical offset issues for test_superscript_subscript.py where FCI
commands occur at non-zero superscript/subscript levels.
However, this test case also shows an additional issue still remains for
the cairo devices. If you change font in the middle of a
superscript/subscript, it applies to the whole string, not just
that part of the string beyond where the font change is applied.
Modified Paths:
--------------
trunk/drivers/cairo.c
Modified: trunk/drivers/cairo.c
===================================================================
--- trunk/drivers/cairo.c 2011-07-04 19:54:19 UTC (rev 11785)
+++ trunk/drivers/cairo.c 2011-07-04 20:22:44 UTC (rev 11786)
@@ -1068,6 +1068,7 @@
{
unsigned char fontFamily, fontStyle, fontWeight;
char openTag[TAG_LEN];
+ int level;
// Generate the font info for the open tag & concatenate this
// onto the markup string.
@@ -1085,22 +1086,14 @@
snprintf( openTag, TAG_LEN, "weight=\"%s\">", weightLookup[fontWeight] );
strncat( pangoMarkupString, openTag, MAX_MARKUP_LEN - 1 - strlen( pangoMarkupString ) );
- // Move to the right sub/super-script level
- if ( upDown > 0 )
+ // Move to the right superscript/subscript level
+ for ( level = 0; level < upDown; level++ )
{
- while ( upDown > 0 )
- {
- upDown--;
- strncat( pangoMarkupString, rise_span_tag( upDown, 1, fontSize ), MAX_MARKUP_LEN - 1 - strlen( pangoMarkupString ) );
- }
+ strncat( pangoMarkupString, rise_span_tag( level, 1, fontSize ), MAX_MARKUP_LEN - 1 - strlen( pangoMarkupString ) );
}
- if ( upDown < 0 )
+ for ( level = 0; level > upDown; level-- )
{
- while ( upDown < 0 )
- {
- upDown++;
- strncat( pangoMarkupString, rise_span_tag( upDown, -1, fontSize ), MAX_MARKUP_LEN - 1 - strlen( pangoMarkupString ) );
- }
+ strncat( pangoMarkupString, rise_span_tag( level, -1, fontSize ), MAX_MARKUP_LEN - 1 - strlen( pangoMarkupString ) );
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|