diff --git a/LATEX_COMMANDS_SUPPORTED.md b/LATEX_COMMANDS_SUPPORTED.md index c679d26..cdf531f 100644 --- a/LATEX_COMMANDS_SUPPORTED.md +++ b/LATEX_COMMANDS_SUPPORTED.md @@ -93,6 +93,7 @@ - \\cup - \\degree - \\delta +- \\downarrow - \\div - \\ell - \\emptyset @@ -132,6 +133,7 @@ - \\neq - \\notin - \\nu +- \\odot - \\omega - \\omicron - \\oplus @@ -163,6 +165,7 @@ - \\times - \\to - \\top +- \\uparrow - \\upsilon - \\vee - \\wedge diff --git a/assets/TeXFonts.8xv b/assets/TeXFonts.8xv index 656f2f7..64417cf 100644 Binary files a/assets/TeXFonts.8xv and b/assets/TeXFonts.8xv differ diff --git a/assets/TeXScrpt.8xv b/assets/TeXScrpt.8xv index 598e068..ae43b2e 100644 Binary files a/assets/TeXScrpt.8xv and b/assets/TeXScrpt.8xv differ diff --git a/include/texfont.h b/include/texfont.h index ca1d722..79a2f0c 100644 --- a/include/texfont.h +++ b/include/texfont.h @@ -5,7 +5,7 @@ * Mapped to the "TeXFonts.8xv" and "TeXScrpt.8xv" TXF3 fonts * Range 0x01-0x10: Lower math symbols. * Range 0x20-0x7E: Standard printable ASCII. 0x7F: visible DEL label - * Range 0x80-0xC4: Custom math symbols. + * Range 0x80-0xC7: Custom math symbols. * * Generated by tools/process_fonts.py from GUST-licensed Latin Modern sources. */ @@ -213,5 +213,11 @@ #define TEXFONT_BOTTOM_CHAR '\303' #define TEXFONT_SUPSET "\304" #define TEXFONT_SUPSET_CHAR '\304' +#define TEXFONT_ARROW_UP "\305" +#define TEXFONT_ARROW_UP_CHAR '\305' +#define TEXFONT_ARROW_DOWN "\306" +#define TEXFONT_ARROW_DOWN_CHAR '\306' +#define TEXFONT_O_DOT "\307" +#define TEXFONT_O_DOT_CHAR '\307' #endif /* TEXFONT_H */ diff --git a/src/tex/tex_measure.c b/src/tex/tex_measure.c index ce8bc77..1b3e083 100644 --- a/src/tex/tex_measure.c +++ b/src/tex/tex_measure.c @@ -37,6 +37,9 @@ static TexAtom atom_class(UnifiedPool* pool, const Node* node) case (uint8_t)TEXFONT_DIVIDE_CHAR: case (uint8_t)TEXFONT_LOGICAL_AND_CHAR: case (uint8_t)TEXFONT_LOGICAL_OR_CHAR: + case (uint8_t)TEXFONT_ARROW_UP_CHAR: + case (uint8_t)TEXFONT_ARROW_DOWN_CHAR: + case (uint8_t)TEXFONT_O_DOT_CHAR: return TEX_ATOM_BIN; case '=': case '<': diff --git a/src/tex/tex_symbols.c b/src/tex/tex_symbols.c index 988ab58..ae06720 100644 --- a/src/tex/tex_symbols.c +++ b/src/tex/tex_symbols.c @@ -64,6 +64,7 @@ static const MapEnt g_map[] = { { "dim", SYMC_FUNC_DIM, SYM_FUNC }, { "div", GL(TEXFONT_DIVIDE_CHAR), SYM_GLYPH }, { "dot", SYMC_ACC_DOT, SYM_ACCENT }, + { "downarrow", GL(TEXFONT_ARROW_DOWN_CHAR), SYM_GLYPH }, { "ell", GL(TEXFONT_ELL_CHAR), SYM_GLYPH }, { "emptyset", GL(TEXFONT_EMPTY_SET_CHAR), SYM_GLYPH }, { "end", SYMC_END, SYM_STRUCT }, @@ -120,6 +121,7 @@ static const MapEnt g_map[] = { { "neq", GL(TEXFONT_NOT_EQUAL_CHAR), SYM_GLYPH }, { "notin", GL(TEXFONT_NOT_IN_CHAR), SYM_GLYPH }, { "nu", GL(TEXFONT_nu_CHAR), SYM_GLYPH }, + { "odot", GL(TEXFONT_O_DOT_CHAR), SYM_GLYPH }, { "oiiint", SYMC_MULTI_OINT_3, SYM_MULTIOP }, { "oiint", SYMC_MULTI_OINT_2, SYM_MULTIOP }, { "oint", SYMC_MULTI_OINT_1, SYM_MULTIOP }, @@ -171,6 +173,7 @@ static const MapEnt g_map[] = { { "top", GL(TEXFONT_TOP_CHAR), SYM_GLYPH }, { "underbrace", SYMC_UNDERBRACE, SYM_STRUCT }, { "underline", SYMC_ACC_UNDERLINE, SYM_ACCENT }, + { "uparrow", GL(TEXFONT_ARROW_UP_CHAR), SYM_GLYPH }, { "upsilon", GL(TEXFONT_upsilon_CHAR), SYM_GLYPH }, { "vec", SYMC_ACC_VEC, SYM_ACCENT }, { "vee", GL(TEXFONT_LOGICAL_OR_CHAR), SYM_GLYPH }, diff --git a/tests/test_measure.c b/tests/test_measure.c index 1ab9491..50f7bd5 100644 --- a/tests/test_measure.c +++ b/tests/test_measure.c @@ -300,6 +300,9 @@ static void test_math_spacing(void) { "p\\Rightarrow q", 3, {0, 1, 1} }, { "p\\Leftrightarrow q", 3, {0, 1, 1} }, { "p\\supset q", 3, {0, 1, 1} }, + { "p\\uparrow q", 3, {0, 1, 1} }, + { "p\\downarrow q", 3, {0, 1, 1} }, + { "p\\odot q", 3, {0, 1, 1} }, { "p\\top q", 3, {0, 0, 0} }, { "p\\bot q", 3, {0, 0, 0} }, { "p\\perp q", 3, {0, 1, 1} } @@ -334,7 +337,7 @@ static void test_math_spacing(void) pool_reset(&pool); TeX_Layout layout = {0}; - NodeRef ref = tex_parse_math("x_{p\\wedge q\\vee\\lnot r\\implies\\top\\iff\\bot\\supset s}", -1, &pool, &layout, false); + NodeRef ref = tex_parse_math("x_{p\\wedge q\\vee\\lnot r\\implies\\top\\iff\\bot\\supset s\\uparrow t\\downarrow u\\odot v}", -1, &pool, &layout, false); CHECK(ref != NODE_NULL); CHECK(tex_get_last_error(&layout) == TEX_OK); tex_measure_range(&pool, 0, (NodeRef)pool.node_count); diff --git a/tests/test_symbols.c b/tests/test_symbols.c index 04562d6..4b60c11 100644 --- a/tests/test_symbols.c +++ b/tests/test_symbols.c @@ -45,6 +45,9 @@ int main(void) check_sym("langle", SYM_GLYPH, TEXFONT_LANGLE_CHAR); check_sym("rangle", SYM_GLYPH, TEXFONT_RANGLE_CHAR); check_sym("supset", SYM_GLYPH, TEXFONT_SUPSET_CHAR); + check_sym("uparrow", SYM_GLYPH, TEXFONT_ARROW_UP_CHAR); + check_sym("downarrow", SYM_GLYPH, TEXFONT_ARROW_DOWN_CHAR); + check_sym("odot", SYM_GLYPH, TEXFONT_O_DOT_CHAR); // Structural SymbolDesc d; diff --git a/tools/process_fonts.py b/tools/process_fonts.py index 1c9ad57..b57449b 100755 --- a/tools/process_fonts.py +++ b/tools/process_fonts.py @@ -87,7 +87,7 @@ 0x2295, # ⊕ Circled plus (oplus) ] -# The Master Symbol List (0x80 - 0xC4). +# The Master Symbol List (0x80 - 0xC7). SYMBOLS = [ # Greek Lower 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, @@ -110,6 +110,9 @@ # Boolean logic 0x2227, 0x2228, 0x00AC, 0x21D2, 0x21D4, 0x22A4, 0x22A5, 0x2283, # Superset / material-implication horseshoe (\supset) + 0x2191, # Up arrow / NAND (\uparrow) + 0x2193, # Down arrow / NOR (\downarrow) + 0x2299, # Circled dot / XNOR (\odot) ]