summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/math-dim.lmt
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkxl/math-dim.lmt')
-rw-r--r--tex/context/base/mkxl/math-dim.lmt279
1 files changed, 141 insertions, 138 deletions
diff --git a/tex/context/base/mkxl/math-dim.lmt b/tex/context/base/mkxl/math-dim.lmt
index 0dd348184..e0730da95 100644
--- a/tex/context/base/mkxl/math-dim.lmt
+++ b/tex/context/base/mkxl/math-dim.lmt
@@ -21,86 +21,87 @@ if not modules then modules = { } end modules ['math-dim'] = {
local abs, next = math.abs, next
local defaults = {
- axis = { default = { "AxisHeight", "axisheight" }, },
- accent_base_height = { default = { "AccentBaseHeight", "xheight" }, },
- fraction_del_size = { default = { "FractionDelimiterSize", "delim2" },
- cramped_display_style = { "FractionDelimiterDisplayStyleSize", "delim1" },
- display_style = { "FractionDelimiterDisplayStyleSize", "delim1" }, },
- fraction_denom_down = { default = { "FractionDenominatorShiftDown", "denom2" },
- cramped_display_style = { "FractionDenominatorDisplayStyleShiftDown", "denom1" },
- display_style = { "FractionDenominatorDisplayStyleShiftDown", "denom1" }, },
- fraction_denom_vgap = { default = { "FractionDenominatorGapMin", "defaultrulethickness" },
- cramped_display_style = { "FractionDenominatorDisplayStyleGapMin", "3*defaultrulethickness" },
- display_style = { "FractionDenominatorDisplayStyleGapMin", "3*defaultrulethickness" }, },
- fraction_num_up = { default = { "FractionNumeratorShiftUp", "num2" },
- cramped_display_style = { "FractionNumeratorDisplayStyleShiftUp", "num1" },
- display_style = { "FractionNumeratorDisplayStyleShiftUp", "num1" }, },
- fraction_num_vgap = { default = { "FractionNumeratorGapMin", "defaultrulethickness" },
- cramped_display_style = { "FractionNumeratorDisplayStyleGapMin", "3*defaultrulethickness" },
- display_style = { "FractionNumeratorDisplayStyleGapMin", "3*defaultrulethickness" }, },
- skewed_fraction_hgap = { default = { "SkewedFractionHorizontalGap", "mathquad/2" },
- cramped_display_style = { "SkewedFractionHorizontalGap", "mathquad/2" },
- display_style = { "SkewedFractionHorizontalGap", "mathquad/2" }, },
- skewed_fraction_vgap = { default = { "SkewedFractionVerticalGap", "xheight" },
- cramped_display_style = { "SkewedFractionVerticalGap", "xheight" },
- display_style = { "SkewedFractionVerticalGap", "xheight" }, },
- fraction_rule = { default = { "FractionRuleThickness", "defaultrulethickness" }, },
- limit_above_bgap = { default = { "UpperLimitBaselineRiseMin", "bigopspacing3" }, },
- limit_above_vgap = { default = { "UpperLimitGapMin", "bigopspacing1" }, },
- limit_above_kern = { default = { "0", "bigopspacing5" }, },
- limit_below_bgap = { default = { "LowerLimitBaselineDropMin", "bigopspacing4" }, },
- limit_below_vgap = { default = { "LowerLimitGapMin", "bigopspacing2" }, },
- limit_below_kern = { default = { "0", "bigopspacing5" }, },
- math_operator_size = { default = { "DisplayOperatorMinHeight", "mathxheight*3" }, }, -- 2
- overbar_kern = { default = { "OverbarExtraAscender", "defaultrulethickness" }, },
- overbar_rule = { default = { "OverbarRuleThickness", "defaultrulethickness" }, },
- overbar_vgap = { default = { "OverbarVerticalGap", "3*defaultrulethickness" }, },
- quad = { default = { "fontsize(f)", "mathquad" }, },
- radical_kern = { default = { "RadicalExtraAscender", "defaultrulethickness" }, },
- radical_rule = { default = { "RadicalRuleThickness", "defaultrulethickness" }, },
- -- default = { "surdheight(f)", "defaultrulethickness" },
- radical_vgap = { default = { "RadicalVerticalGap", "defaultrulethickness+(abs(defaultrulethickness)/4)" },
- display_style = { "RadicalDisplayStyleVerticalGap", "defaultrulethickness+(abs(mathxheight)/4)" }, },
- space_after_script = { default = { "SpaceAfterScript", "scriptspace" }, },
- space_before_script = { default = { "SpaceAfterScript", "scriptspace" }, },
- stack_denom_down = { default = { "StackBottomShiftDown", "denom2" },
- cramped_display_style = { "StackBottomDisplayStyleShiftDown", "denom1" },
- display_style = { "StackBottomDisplayStyleShiftDown", "denom1" }, },
- stack_num_up = { default = { "StackTopShiftUp", "num3" },
- cramped_display_style = { "StackTopDisplayStyleShiftUp", "num1" },
- display_style = { "StackTopDisplayStyleShiftUp", "num1" }, },
- stack_vgap = { default = { "StackGapMin", "3*defaultrulethickness" },
- cramped_display_style = { "StackDisplayStyleGapMin", "7*defaultrulethickness" },
- display_style = { "StackDisplayStyleGapMin", "7*defaultrulethickness" }, },
- sub_shift_down = { default = { "SubscriptShiftDown", "sub1" }, },
- sub_shift_drop = { default = { "SubscriptBaselineDropMin", "subdrop" }, },
- sub_sup_shift_down = { default = { "SubscriptShiftDown", "sub2" }, },
- sub_top_max = { default = { "SubscriptTopMax", "abs(mathxheight*4)/5" }, },
- subsup_vgap = { default = { "SubSuperscriptGapMin", "4*defaultrulethickness" }, },
- sup_bottom_min = { default = { "SuperscriptBottomMin", "abs(mathxheight)/4" }, },
- sup_shift_drop = { default = { "SuperscriptBaselineDropMax", "supdrop" }, },
- sup_shift_up = { cramped_display_style = { "SuperscriptShiftUpCramped", "sup3" },
- cramped_script_script_style = { "SuperscriptShiftUpCramped", "sup3" },
- cramped_script_style = { "SuperscriptShiftUpCramped", "sup3" },
- cramped_text_style = { "SuperscriptShiftUpCramped", "sup3" },
- display_style = { "SuperscriptShiftUp", "sup1" },
- script_script_style = { "SuperscriptShiftUp", "sup2" },
- script_style = { "SuperscriptShiftUp", "sup2" },
- text_style = { "SuperscriptShiftUp", "sup2" }, },
- sup_sub_bottom_max = { default = { "SuperscriptBottomMaxWithSubscript", "abs(mathxheight*4)/5" }, },
- underbar_kern = { default = { "UnderbarExtraDescender", "0" }, },
- underbar_rule = { default = { "UnderbarRuleThickness", "defaultrulethickness" }, },
- underbar_vgap = { default = { "UnderbarVerticalGap", "3*defaultrulethickness" }, },
- connector_overlap_min = { default = { "MinConnectorOverlap", "0.25*defaultrulethickness" }, },
- over_delimiter_vgap = { default = { "StretchStackGapBelowMin", "bigopspacing1" }, },
- over_delimiter_bgap = { default = { "StretchStackTopShiftUp", "bigopspacing3" }, },
- under_delimiter_vgap = { default = { "StretchStackGapAboveMin", "bigopspacing2" }, },
- under_delimiter_bgap = { default = { "StretchStackBottomShiftDown", "bigopspacing4" }, },
- radical_degree_before = { default = { "RadicalKernBeforeDegree", "(5/18)*quad" }, },
- radical_degree_after = { default = { "RadicalKernAfterDegree", "(-10/18)*quad" }, },
- radical_degree_raise = { default = { "RadicalDegreeBottomRaisePercent", "60" }, },
- no_limit_sub_factor = { default = { "NoLimitSubFactor", "0" }, },
- no_limit_sup_factor = { default = { "NoLimitSupFactor", "0" }, },
+ axis = { default = { "AxisHeight", "axisheight" }, },
+ accent_base_height = { default = { "AccentBaseHeight", "xheight" }, },
+ flattened_accent_base_height = { default = { "FlattenedAccentBaseHeight", "xheight" }, },
+ fraction_del_size = { default = { "FractionDelimiterSize", "delim2" },
+ cramped_display_style = { "FractionDelimiterDisplayStyleSize", "delim1" },
+ display_style = { "FractionDelimiterDisplayStyleSize", "delim1" }, },
+ fraction_denom_down = { default = { "FractionDenominatorShiftDown", "denom2" },
+ cramped_display_style = { "FractionDenominatorDisplayStyleShiftDown", "denom1" },
+ display_style = { "FractionDenominatorDisplayStyleShiftDown", "denom1" }, },
+ fraction_denom_vgap = { default = { "FractionDenominatorGapMin", "defaultrulethickness" },
+ cramped_display_style = { "FractionDenominatorDisplayStyleGapMin", "3*defaultrulethickness" },
+ display_style = { "FractionDenominatorDisplayStyleGapMin", "3*defaultrulethickness" }, },
+ fraction_num_up = { default = { "FractionNumeratorShiftUp", "num2" },
+ cramped_display_style = { "FractionNumeratorDisplayStyleShiftUp", "num1" },
+ display_style = { "FractionNumeratorDisplayStyleShiftUp", "num1" }, },
+ fraction_num_vgap = { default = { "FractionNumeratorGapMin", "defaultrulethickness" },
+ cramped_display_style = { "FractionNumeratorDisplayStyleGapMin", "3*defaultrulethickness" },
+ display_style = { "FractionNumeratorDisplayStyleGapMin", "3*defaultrulethickness" }, },
+ skewed_fraction_hgap = { default = { "SkewedFractionHorizontalGap", "mathquad/2" },
+ cramped_display_style = { "SkewedFractionHorizontalGap", "mathquad/2" },
+ display_style = { "SkewedFractionHorizontalGap", "mathquad/2" }, },
+ skewed_fraction_vgap = { default = { "SkewedFractionVerticalGap", "xheight" },
+ cramped_display_style = { "SkewedFractionVerticalGap", "xheight" },
+ display_style = { "SkewedFractionVerticalGap", "xheight" }, },
+ fraction_rule = { default = { "FractionRuleThickness", "defaultrulethickness" }, },
+ limit_above_bgap = { default = { "UpperLimitBaselineRiseMin", "bigopspacing3" }, },
+ limit_above_vgap = { default = { "UpperLimitGapMin", "bigopspacing1" }, },
+ limit_above_kern = { default = { "0", "bigopspacing5" }, },
+ limit_below_bgap = { default = { "LowerLimitBaselineDropMin", "bigopspacing4" }, },
+ limit_below_vgap = { default = { "LowerLimitGapMin", "bigopspacing2" }, },
+ limit_below_kern = { default = { "0", "bigopspacing5" }, },
+ math_operator_size = { default = { "DisplayOperatorMinHeight", "mathxheight*3" }, }, -- 2
+ overbar_kern = { default = { "OverbarExtraAscender", "defaultrulethickness" }, },
+ overbar_rule = { default = { "OverbarRuleThickness", "defaultrulethickness" }, },
+ overbar_vgap = { default = { "OverbarVerticalGap", "3*defaultrulethickness" }, },
+ quad = { default = { "fontsize(f)", "mathquad" }, },
+ radical_kern = { default = { "RadicalExtraAscender", "defaultrulethickness" }, },
+ radical_rule = { default = { "RadicalRuleThickness", "defaultrulethickness" }, },
+ -- default = { "surdheight(f)", "defaultrulethickness" },
+ radical_vgap = { default = { "RadicalVerticalGap", "defaultrulethickness+(abs(defaultrulethickness)/4)" },
+ display_style = { "RadicalDisplayStyleVerticalGap", "defaultrulethickness+(abs(mathxheight)/4)" }, },
+ space_after_script = { default = { "SpaceAfterScript", "scriptspace" }, },
+ space_before_script = { default = { "SpaceAfterScript", "scriptspace" }, },
+ stack_denom_down = { default = { "StackBottomShiftDown", "denom2" },
+ cramped_display_style = { "StackBottomDisplayStyleShiftDown", "denom1" },
+ display_style = { "StackBottomDisplayStyleShiftDown", "denom1" }, },
+ stack_num_up = { default = { "StackTopShiftUp", "num3" },
+ cramped_display_style = { "StackTopDisplayStyleShiftUp", "num1" },
+ display_style = { "StackTopDisplayStyleShiftUp", "num1" }, },
+ stack_vgap = { default = { "StackGapMin", "3*defaultrulethickness" },
+ cramped_display_style = { "StackDisplayStyleGapMin", "7*defaultrulethickness" },
+ display_style = { "StackDisplayStyleGapMin", "7*defaultrulethickness" }, },
+ sub_shift_down = { default = { "SubscriptShiftDown", "sub1" }, },
+ sub_shift_drop = { default = { "SubscriptBaselineDropMin", "subdrop" }, },
+ sub_sup_shift_down = { default = { "SubscriptShiftDown", "sub2" }, },
+ sub_top_max = { default = { "SubscriptTopMax", "abs(mathxheight*4)/5" }, },
+ subsup_vgap = { default = { "SubSuperscriptGapMin", "4*defaultrulethickness" }, },
+ sup_bottom_min = { default = { "SuperscriptBottomMin", "abs(mathxheight)/4" }, },
+ sup_shift_drop = { default = { "SuperscriptBaselineDropMax", "supdrop" }, },
+ sup_shift_up = { cramped_display_style = { "SuperscriptShiftUpCramped", "sup3" },
+ cramped_script_script_style = { "SuperscriptShiftUpCramped", "sup3" },
+ cramped_script_style = { "SuperscriptShiftUpCramped", "sup3" },
+ cramped_text_style = { "SuperscriptShiftUpCramped", "sup3" },
+ display_style = { "SuperscriptShiftUp", "sup1" },
+ script_script_style = { "SuperscriptShiftUp", "sup2" },
+ script_style = { "SuperscriptShiftUp", "sup2" },
+ text_style = { "SuperscriptShiftUp", "sup2" }, },
+ sup_sub_bottom_max = { default = { "SuperscriptBottomMaxWithSubscript", "abs(mathxheight*4)/5" }, },
+ underbar_kern = { default = { "UnderbarExtraDescender", "0" }, },
+ underbar_rule = { default = { "UnderbarRuleThickness", "defaultrulethickness" }, },
+ underbar_vgap = { default = { "UnderbarVerticalGap", "3*defaultrulethickness" }, },
+ connector_overlap_min = { default = { "MinConnectorOverlap", "0.25*defaultrulethickness" }, },
+ over_delimiter_vgap = { default = { "StretchStackGapBelowMin", "bigopspacing1" }, },
+ over_delimiter_bgap = { default = { "StretchStackTopShiftUp", "bigopspacing3" }, },
+ under_delimiter_vgap = { default = { "StretchStackGapAboveMin", "bigopspacing2" }, },
+ under_delimiter_bgap = { default = { "StretchStackBottomShiftDown", "bigopspacing4" }, },
+ radical_degree_before = { default = { "RadicalKernBeforeDegree", "(5/18)*quad" }, },
+ radical_degree_after = { default = { "RadicalKernAfterDegree", "(-10/18)*quad" }, },
+ radical_degree_raise = { default = { "RadicalDegreeBottomRaisePercent", "60" }, },
+ no_limit_sub_factor = { default = { "NoLimitSubFactor", "0" }, },
+ no_limit_sup_factor = { default = { "NoLimitSupFactor", "0" }, },
}
local styles = {
@@ -129,6 +130,10 @@ end
-- mt.__index = function(t,s)
-- return t.default or t.text_style or 0
-- end
+--
+-- This will all go away in \LMTX\ becuase itv makes no sense to support old fonts any longer,
+-- even when we assemble them one really needs to think about proper values. Okay, there is
+-- some historic value in here.
function mathematics.dimensions(dimens) -- beware, dimens get spoiled
if dimens.SpaceAfterScript then
@@ -175,72 +180,70 @@ function mathematics.dimensions(dimens) -- beware, dimens get spoiled
t[variable] = tt
end
local d = {
- AccentBaseHeight = t . accent_base_height . text_style,
- AxisHeight = t . axis . text_style,
+ AccentBaseHeight = t . accent_base_height . text_style,
+ FlattenedAccentBaseHeight = t . flattened_accent_base_height . text_style,
+ AxisHeight = t . axis . text_style,
-- DelimitedSubFormulaMinHeight
- DisplayOperatorMinHeight = t . math_operator_size . text_style, -- no longer let tex decide (weird values)
- -- FlattenedAccentBaseHeight
- FractionDenominatorDisplayStyleGapMin = t . fraction_denom_vgap . display_style,
- FractionDenominatorDisplayStyleShiftDown = t . fraction_denom_down . display_style,
- FractionDenominatorGapMin = t . fraction_denom_vgap . text_style,
- FractionDenominatorShiftDown = t . fraction_denom_down . text_style,
- FractionNumeratorDisplayStyleGapMin = t . fraction_num_vgap . display_style,
- FractionNumeratorDisplayStyleShiftUp = t . fraction_num_up . display_style,
- FractionNumeratorGapMin = t . fraction_num_vgap . text_style,
- FractionNumeratorShiftUp = t . fraction_num_up . text_style,
- FractionRuleThickness = t . fraction_rule . text_style,
- FractionDelimiterSize = t . fraction_del_size . text_style,
- FractionDelimiterDisplayStyleSize = t . fraction_del_size . display_style,
- LowerLimitBaselineDropMin = t . limit_below_bgap . text_style,
- LowerLimitGapMin = t . limit_below_vgap . text_style,
+ DisplayOperatorMinHeight = t . math_operator_size . text_style, -- no longer let tex decide (weird values)
+ FractionDenominatorDisplayStyleGapMin = t . fraction_denom_vgap . display_style,
+ FractionDenominatorDisplayStyleShiftDown = t . fraction_denom_down . display_style,
+ FractionDenominatorGapMin = t . fraction_denom_vgap . text_style,
+ FractionDenominatorShiftDown = t . fraction_denom_down . text_style,
+ FractionNumeratorDisplayStyleGapMin = t . fraction_num_vgap . display_style,
+ FractionNumeratorDisplayStyleShiftUp = t . fraction_num_up . display_style,
+ FractionNumeratorGapMin = t . fraction_num_vgap . text_style,
+ FractionNumeratorShiftUp = t . fraction_num_up . text_style,
+ FractionRuleThickness = t . fraction_rule . text_style,
+ FractionDelimiterSize = t . fraction_del_size . text_style,
+ FractionDelimiterDisplayStyleSize = t . fraction_del_size . display_style,
+ LowerLimitBaselineDropMin = t . limit_below_bgap . text_style,
+ LowerLimitGapMin = t . limit_below_vgap . text_style,
-- MathLeading
- MinConnectorOverlap = t . connector_overlap_min . text_style,
- OverbarExtraAscender = t . overbar_kern . text_style,
- OverbarRuleThickness = t . overbar_rule . text_style,
- OverbarVerticalGap = t . overbar_vgap . text_style,
- RadicalDisplayStyleVerticalGap = t . radical_vgap . display_style,
- RadicalExtraAscender = t . radical_kern . text_style,
- RadicalRuleThickness = t . radical_rule . text_style,
- RadicalVerticalGap = t . radical_vgap . text_style,
- RadicalKernBeforeDegree = t . radical_degree_before . display_style,
- RadicalKernAfterDegree = t . radical_degree_after . display_style,
- RadicalDegreeBottomRaisePercent = t . radical_degree_raise . display_style,
+ MinConnectorOverlap = t . connector_overlap_min . text_style,
+ OverbarExtraAscender = t . overbar_kern . text_style,
+ OverbarRuleThickness = t . overbar_rule . text_style,
+ OverbarVerticalGap = t . overbar_vgap . text_style,
+ RadicalDisplayStyleVerticalGap = t . radical_vgap . display_style,
+ RadicalExtraAscender = t . radical_kern . text_style,
+ RadicalRuleThickness = t . radical_rule . text_style,
+ RadicalVerticalGap = t . radical_vgap . text_style,
+ RadicalKernBeforeDegree = t . radical_degree_before . display_style,
+ RadicalKernAfterDegree = t . radical_degree_after . display_style,
+ RadicalDegreeBottomRaisePercent = t . radical_degree_raise . display_style,
-- ScriptPercentScaleDown
-- ScriptScriptPercentScaleDown
-- SkewedFractionHorizontalGap
-- SkewedFractionVerticalGap
- SpaceAfterScript = t . space_after_script . text_style,
- StackBottomDisplayStyleShiftDown = t . stack_denom_down . display_style,
- StackBottomShiftDown = t . stack_denom_down . text_style,
- StackDisplayStyleGapMin = t . stack_vgap . display_style,
- StackGapMin = t . stack_vgap . text_style,
- StackTopDisplayStyleShiftUp = t . stack_num_up . display_style,
- StackTopShiftUp = t . stack_num_up . text_style,
- StretchStackGapBelowMin = t . over_delimiter_vgap . text_style,
- StretchStackTopShiftUp = t . over_delimiter_bgap . text_style,
- StretchStackGapAboveMin = t . under_delimiter_vgap . text_style,
- StretchStackBottomShiftDown = t . under_delimiter_bgap . text_style,
- SubSuperscriptGapMin = t . subsup_vgap . text_style,
- SubscriptBaselineDropMin = t . sub_shift_drop . text_style,
- SubscriptShiftDown = t . sub_shift_down . text_style,
- SubscriptShiftDownWithSuperscript = t . sub_sup_shift_down . text_style,
- SubscriptTopMax = t . sub_top_max . text_style,
- SuperscriptBaselineDropMax = t . sup_shift_drop . text_style,
- SuperscriptBottomMaxWithSubscript = t . sup_sub_bottom_max . text_style,
- SuperscriptBottomMin = t . sup_bottom_min . text_style,
- SuperscriptShiftUp = t . sup_shift_up . text_style,
- SuperscriptShiftUpCramped = t . sup_shift_up . cramped_text_style,
- UnderbarExtraDescender = t . underbar_kern . text_style,
- UnderbarRuleThickness = t . underbar_rule . text_style,
- UnderbarVerticalGap = t . underbar_vgap . text_style,
- UpperLimitBaselineRiseMin = t . limit_above_bgap . text_style,
- UpperLimitGapMin = t . limit_above_vgap . text_style,
+ SpaceAfterScript = t . space_after_script . text_style,
+ StackBottomDisplayStyleShiftDown = t . stack_denom_down . display_style,
+ StackBottomShiftDown = t . stack_denom_down . text_style,
+ StackDisplayStyleGapMin = t . stack_vgap . display_style,
+ StackGapMin = t . stack_vgap . text_style,
+ StackTopDisplayStyleShiftUp = t . stack_num_up . display_style,
+ StackTopShiftUp = t . stack_num_up . text_style,
+ StretchStackGapBelowMin = t . over_delimiter_vgap . text_style,
+ StretchStackTopShiftUp = t . over_delimiter_bgap . text_style,
+ StretchStackGapAboveMin = t . under_delimiter_vgap . text_style,
+ StretchStackBottomShiftDown = t . under_delimiter_bgap . text_style,
+ SubSuperscriptGapMin = t . subsup_vgap . text_style,
+ SubscriptBaselineDropMin = t . sub_shift_drop . text_style,
+ SubscriptShiftDown = t . sub_shift_down . text_style,
+ SubscriptShiftDownWithSuperscript = t . sub_sup_shift_down . text_style,
+ SubscriptTopMax = t . sub_top_max . text_style,
+ SuperscriptBaselineDropMax = t . sup_shift_drop . text_style,
+ SuperscriptBottomMaxWithSubscript = t . sup_sub_bottom_max . text_style,
+ SuperscriptBottomMin = t . sup_bottom_min . text_style,
+ SuperscriptShiftUp = t . sup_shift_up . text_style,
+ SuperscriptShiftUpCramped = t . sup_shift_up . cramped_text_style,
+ UnderbarExtraDescender = t . underbar_kern . text_style,
+ UnderbarRuleThickness = t . underbar_rule . text_style,
+ UnderbarVerticalGap = t . underbar_vgap . text_style,
+ UpperLimitBaselineRiseMin = t . limit_above_bgap . text_style,
+ UpperLimitGapMin = t . limit_above_vgap . text_style,
}
-
-- too fragile for tx/px ... even the same values give different results
- d.DisplayOperatorMinHeight = nil
- --
- d.AccentBaseHeight = 0 -- here? still?
+ -- d.DisplayOperatorMinHeight = nil
+ -- d.AccentBaseHeight = 0 -- here? still? or maybe undedined i.e. maxdimen
return d, t -- t only for diagnostics
else
return { }, { }