improve sub/superscript placement on fx-CG 50
This commit is contained in:
parent
e0b952503b
commit
c9430ffdee
|
@ -31,6 +31,13 @@
|
|||
#define TEX_PRINT
|
||||
#endif
|
||||
|
||||
/* Switch to change parameters on fx-9860G / fx-CG 50. */
|
||||
#if defined(TEX_PLATFORM_FX9860G)
|
||||
#define TEX_FX(fx, cg) (fx)
|
||||
#elif defined(TEX_PLATFORM_FXCG50)
|
||||
#define TEX_FX(fx, cg) (cg)
|
||||
#endif
|
||||
|
||||
//---
|
||||
// Graphical settings
|
||||
// A few quirks that can be adjusted to your needs.
|
||||
|
@ -47,9 +54,13 @@
|
|||
/* Vertical spacing between fraction bar and operands */
|
||||
#define TEX_FRACTION_SPACING TEX_LAYOUT_SPACING
|
||||
|
||||
/* Vertical placement of subscripts and superscripts (relative to object) */
|
||||
#define TEX_SUBSCRIPT_ELEVATION 3
|
||||
#define TEX_SUPERSCRIPT_DEPTH 3
|
||||
/* Vertical placement of subscripts and superscripts (relative to object) when
|
||||
there is either only the subscript or only the superscript */
|
||||
#define TEX_SUBSCRIPT_EXCL_ELEVATION TEX_FX(3, 5)
|
||||
#define TEX_SUPERSCRIPT_EXCL_DEPTH TEX_FX(3, 5)
|
||||
/* Vertical placement of subscripts and superscripts when there's both */
|
||||
#define TEX_SUBSCRIPT_SHARED_ELEVATION TEX_FX(3, 3)
|
||||
#define TEX_SUPERSCRIPT_SHARED_DEPTH TEX_FX(3, 3)
|
||||
/* Horizontal spacing between object and subscripts and superscripts */
|
||||
#define TEX_SUBSCRIPT_SPACING TEX_LAYOUT_SPACING
|
||||
#define TEX_SUPERSCRIPT_SPACING TEX_LAYOUT_SPACING
|
||||
|
|
|
@ -146,7 +146,9 @@ static void chunk_layout_inline(struct chunk *chunk)
|
|||
|
||||
if(sub)
|
||||
{
|
||||
int elevation = TEX_SUBSCRIPT_ELEVATION;
|
||||
int elevation = sup
|
||||
? TEX_SUBSCRIPT_SHARED_ELEVATION
|
||||
: TEX_SUBSCRIPT_EXCL_ELEVATION;
|
||||
|
||||
sub->x = base->x + base->width + TEX_SUBSCRIPT_SPACING;
|
||||
sub->l = base->l + (base->height - base->line + sub->line -
|
||||
|
@ -157,7 +159,9 @@ static void chunk_layout_inline(struct chunk *chunk)
|
|||
}
|
||||
if(sup)
|
||||
{
|
||||
int depth = TEX_SUPERSCRIPT_DEPTH;
|
||||
int depth = sub
|
||||
? TEX_SUPERSCRIPT_SHARED_DEPTH
|
||||
: TEX_SUPERSCRIPT_EXCL_DEPTH;
|
||||
|
||||
sup->x = base->x + base->width + TEX_SUPERSCRIPT_SPACING;
|
||||
sup->l = base->l - (base->line + (sup->height - sup->line) -
|
||||
|
|
Loading…
Reference in New Issue