Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions LATEX_COMMANDS_SUPPORTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
- \\cup
- \\degree
- \\delta
- \\downarrow
- \\div
- \\ell
- \\emptyset
Expand Down Expand Up @@ -132,6 +133,7 @@
- \\neq
- \\notin
- \\nu
- \\odot
- \\omega
- \\omicron
- \\oplus
Expand Down Expand Up @@ -163,6 +165,7 @@
- \\times
- \\to
- \\top
- \\uparrow
- \\upsilon
- \\vee
- \\wedge
Expand Down
Binary file modified assets/TeXFonts.8xv
Binary file not shown.
Binary file modified assets/TeXScrpt.8xv
Binary file not shown.
8 changes: 7 additions & 1 deletion include/texfont.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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 */
3 changes: 3 additions & 0 deletions src/tex/tex_measure.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<':
Expand Down
3 changes: 3 additions & 0 deletions src/tex/tex_symbols.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down Expand Up @@ -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 },
Expand Down Expand Up @@ -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 },
Expand Down
5 changes: 4 additions & 1 deletion tests/test_measure.c
Original file line number Diff line number Diff line change
Expand Up @@ -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} }
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions tests/test_symbols.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion tools/process_fonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
]


Expand Down
Loading