# -*- Mode: Python; tab-width: 2; indent-tabs-mode:nil; -*-
# vim: set ts=2 et sw=2 tw=80:
#
# Copyright (c) 2013 MathJax Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

FONTFAMILY_PREFIX = "Latin Modern MathJax"
FONTNAME_PREFIX = "LatinModernMathJax"

MATHFONT = "latinmodern-math.otf"
MAINFONTS = None

FONTSPLITTING_EXTRA = {
    "Variants": [
        ("minute.st",0x2032),
        ("uni2033.st",0x2033),
        ("uni2034.st",0x2034),
        ("primereversed.st",0x2035),
        ("uni2036.st",0x2036),
        ("uni2037.st",0x2037),
        ("uni2057.st",0x2057)
    ]
}

FONTSPLITTING_REMOVE = None

FONTDATA = {
    "FileVersion": "2.3",
    "Year": "2013",
    "TeX_factor": None, # Leave None for automatic computation
    "baselineskip": 1.2,
    "lineH": .8,
    "lineD": .2,
    "hasStyleChar": True
    }

RULECHAR = 0x0305

REMAP = {
        0x203E: 0x305,                  # overline
        0xFE37: 0x23DE, 0xFE38: 0x23DF, # OverBrace, UnderBrace
        0x2B9: 0x2032,                  # prime,
        0x3D2: 0x3A5,                   # Upsilon
        0x25B4: 0x25B2,                 # blacktriangle
        0x25B5: 0x25B3, 0x25B8: 0x25B6, # triangle, blacktriangleright
        0x25BE: 0x25BC, 0x25BF: 0x25BD, # blacktriangledown, triangledown
        0x25C2: 0x25C0,                 # blacktriangleleft
        0x3008: 0x27E8, 0x3009: 0x27E9, # langle, rangle
        0x2758: 0x2223,                 # VerticalSeparator
        0x25FB: 0x25A1, 0x25FC: 0x25A0  # square, blacksquare
}

REMAPACCENT = {
    "\u2192": "\u20D7", # vector arrow
    "\u2032": "\u0301", # acute accent
    "\u007E": "\u0303", # tilde
    "\u2035": "\u0300", # grave accent
    "\u005E": "\u0302", # hat
    "\u0060": "\u0300",
    "\u00B4": "\u0301"
}

REMAPACCENTUNDER = {
}

VARIANT = None
VARIANTFONTS = ["VARIANTS"]

TEXCALIGRAPHIC = None
TEXCALIGRAPHICFONTS = []

TEXOLDSTYLE = None
TEXOLDSTYLEFONTS = []

TEXCALIGRAPHICBOLD = None
TEXCALIGRAPHICBOLDFONTS = []

TEXOLDSTYLEBOLD = None
TEXOLDSTYLEBOLDFONTS = []

SANSSERIFGREEK = None
SANSSERIFITALICNUMBER = None
SANSSERIFITALICGREEK = None
SANSSERIFBOLDITALICNUMBER = None

SMALLOPFONTS = None

DELIMITERS = {
    0x002D: {"alias": 0x0305, "dir": "H"}, # hyphen-minus
    0x005E: {"alias": 0x0302, "dir": "H"}, # wide hat
    0x005F: {"alias": 0x0332, "dir": "H"}, # low line
    0x007E: {"alias": 0x0303, "dir": "H"},
    0x00AF: {"alias": 0x0332, "dir": "H"}, # low line
    0x02C6: {"alias": 0x0302, "dir": "H"},
    0x02C9: {"alias": 0x0305, "dir": "H"}, # macron
    0x02DC: {"alias": 0x0303, "dir": "H"},
    0x2015: {"alias": 0x0305, "dir": "H"}, # horizontal line
    0x2017: {"alias": 0x0305, "dir": "H"}, # horizontal line
    0x203E: {"alias": 0x0305, "dir": "H"}, # overline
    0x2215: {"alias": 0x2044, "dir": "V"}, # division slash
    0x23AA: # \bracevert
    {
        "dir": "V",
        "HW": [0x23AA],
        "stretch": [(0x23AA,"ext")]
    },
    0x23AF: {"alias": 0x0305, "dir": "H"},
    0x23B0:
    {
        "dir": "V",
        "HW": [0x23A7],
        "stretch": [(0x23A7,"top"),(0x23AA,"ext"),(0x23AD, "bot")]
    },
    0x23B1:
    {
        "dir": "V",
        "HW": [0x23AB],
        "stretch": [(0x23AB,"top"),(0x23AA,"ext"),(0x23A9, "bot")]
    },
    0x23D0: # vertical line extension
    {
        "dir": "V",
        "HW": [0x7C],
        "stretch": [(0x7C,"ext")]
    },
    0x2500: {"alias": 0x0305, "dir": "H"},
    0x27F5: {"alias": 0x2190, "dir": "H"}, # long left arrow
    0x27F6: {"alias": 0x2192, "dir": "H"}, # long right arrow
    0x27F7: {"alias": 0x2194, "dir": "H"}, # long left-right arrow
    0x27F8: {"alias": 0x21D0, "dir": "H"}, # long left double arrow
    0x27F9: {"alias": 0x21D2, "dir": "H"}, # long right double arrow
    0x27FA: {"alias": 0x21D4, "dir": "H"}, # long left-right double arrow
    0x27FB: {"alias": 0x21A4, "dir": "H"}, # long left arrow from bar
    0x27FC: {"alias": 0x21A6, "dir": "H"}, # long right arrow from bar
    0x27FD: {"alias": 0x2906, "dir": "H"}, # long left double arrow from bar
    0x27FE: {"alias": 0x2907, "dir": "H"}, # long right double arrow from bar
    0x3008: {"alias": 0x27E8, "dir": "V"}, # langle
    0x3009: {"alias": 0x27E9, "dir": "V"}, # rangle
    0xFE37: {"alias": 0x23DE, "dir": "H"}, # horizontal brace down
    0xFE38: {"alias": 0x23DF, "dir": "H"}  # horizontal brace up
}

DELIMITERS_EXTRA = [
    0x306,
    0x311,
    0x32C,
    0x32D,
    0x32E,
    0x32F,
    0x330,
    0x333,
    0x33F,
    0x20D0,
    0x20D1,
    0x20D6,
    0x20D7,
    0x20E1,
    0x20E9,
    0x20EC,
    0x20ED,
    0x20EE,
    0x20EF,
    0x2196,
    0x2197,
    0x2198,
    0x2199,
    0x219A,
    0x219B,
    0x219E,
    0x219F,