I have discovered a rather serious bug.
Below is my TeX code:
\documentclass{article}
\usepackage{amsmath}
\usepackage{newtxmath}
\usepackage{newtxtext}
\begin{document}
$\displaystyle a=\oint_a^n$\\
$ a=\oint_a^n$
\end{document}
I saved this code as fonterror.tex and compiled it using:
xelatex --no-pdf fonterror.tex
This generated the fonterror.xdv file.
Then, I used the following command to convert it into an SVG file:
dvisvgm --no-merge --no-styles fonterror.xdv
Here is the content of the generated SVG file:
<?xml version='1.0' encoding='UTF-8'?>
<!-- This file was generated by dvisvgm 3.2.2 -->
<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='174.216692pt' height='577.857599pt' viewBox='61.897878 52.777519 174.216692 577.857599'>
<defs>
<font id='NewTXMI' horiz-adv-x='0'>
<font-face font-family='NewTXMI' units-per-em='1000' ascent='786' descent='214'/>
<glyph unicode='𝑎' horiz-adv-x='500' vert-adv-y='500' glyph-name='u1D44E' d='M476 100L464 110L436 82C405 50 393 41 384 41C376 41 370 47 370 54C370 74 412 246 459 417C462 427 463 429 465 438L458 441L397 434L394 431L383 383C375 420 346 441 303 441C170 441 17 259 17 100C17 30 55-11 119-11C189-11 232 22 320 146C299 64 297 56 297 31C297 2 309-10 337-10C377-10 401 9 476 100ZM365 358C365 274 314 156 246 82C222 55 188 38 159 38C123 38 101 66 101 112C101 166 136 264 178 327C218 386 263 419 304 419C306 419 307 419 309 419C343 417 365 393 365 358Z'/>
</font>
<font id='txmiaX' horiz-adv-x='0'>
<font-face font-family='txmiaX' units-per-em='1000' ascent='871' descent='243'/>
<glyph unicode='=' horiz-adv-x='592' vert-adv-y='592' glyph-name='equal' d='M552 330V386H40V330H552ZM552 127V183H40V127H552Z'/>
</font>
<font id='txexs' horiz-adv-x='0'>
<font-face font-family='txexs' units-per-em='1000' ascent='1444' descent='2960'/>
<glyph unicode='∮' horiz-adv-x='530' vert-adv-y='530' glyph-name='uni222E' d='M656-72C663-17 606 0 560 0C416 0 383-229 363-332C361-343 355-379 352-391C351-391 350-391 349-391C222-391 111-492 111-619C111-717 181-799 267-832C257-882 252-904 245-945C231-1024 175-1230 141-1230C130-1230 118-1227 111-1218C114-1213 126-1200 128-1190C134-1160 115-1140 86-1140C60-1140 34-1174 32-1192C24-1248 81-1261 126-1261C243-1261 289-1065 314-945C321-910 326-893 335-847C458-843 567-743 567-619C567-525 500-445 419-410C423-390 431-346 434-329C450-246 503-30 546-30C557-30 569-33 576-42C572-48 558-64 557-71C553-101 571-120 600-120C623-120 653-91 656-72ZM274-792C208-763 151-696 151-619C151-517 242-434 344-431C323-540 297-672 274-792ZM411-451C473-482 527-545 527-619C527-718 440-798 343-806C366-691 391-557 411-451Z'/>
<glyph unicode='∮' horiz-adv-x='711' vert-adv-y='711' glyph-name='uni222E.dsp' d='M1020-114C1032-50 992 0 924 0C694 0 639-391 587-636C577-682 567-731 557-782C554-782 552-782 549-782C375-782 225-921 225-1095C225-1230 320-1344 438-1388C421-1481 405-1570 390-1651C364-1795 296-2170 165-2170C130-2170 201-2134 206-2085C211-2040 188-2015 146-2015C102-2015 59-2062 56-2088C49-2140 83-2207 156-2207C386-2207 439-1859 483-1645C497-1577 513-1495 531-1408C703-1406 851-1268 851-1095C851-964 761-853 648-806C660-740 671-679 681-626C711-469 796-36 887-36C932-36 869-80 867-119C866-149 893-180 932-180C964-180 1011-160 1020-114ZM448-1338C353-1299 275-1205 275-1095C275-950 402-833 547-832C514-993 480-1171 448-1338ZM638-856C728-898 801-989 801-1095C801-1236 680-1351 541-1358C573-1195 608-1015 638-856Z'/>
</font>
<font id='NewTXMI7' horiz-adv-x='0'>
<font-face font-family='NewTXMI7' units-per-em='1000' ascent='786' descent='214'/>
<glyph unicode='𝑎' horiz-adv-x='575' vert-adv-y='575' glyph-name='u1D44E' d='M545 100L530 110L500 82C466 50 453 41 442 41C432 41 425 47 425 54C424 74 467 246 515 417C517 427 518 429 520 438L513 441L443 434L440 431L429 383C418 420 384 441 335 441C181 441 10 259 16 100C18 30 63-11 137-11C217-11 274 18 364 146C342 64 340 56 341 31C342 2 356-10 388-10C434-10 462 9 545 100ZM410 358C413 274 358 156 282 82C255 55 216 38 183 38C141 38 115 66 113 112C111 166 149 264 195 327C239 385 290 419 337 419H343C383 417 409 393 410 358Z'/>
<glyph unicode='𝑛' horiz-adv-x='567' vert-adv-y='567' glyph-name='u1D45B' d='M535 104L519 117C510 108 505 99 496 91C464 54 448 38 432 38C421 38 413 45 413 54C413 62 416 81 427 117L473 323C478 347 483 366 482 380C481 416 458 441 414 441C342 441 267 382 162 221L232 439L221 441L38 410L39 394C98 393 113 387 113 367C114 361 113 355 112 350L16 0H103C150 158 160 180 207 248C270 341 327 390 369 390C386 390 390 379 391 361C391 349 386 321 377 285L337 120C324 68 321 55 321 45C323 7 340-9 378-9C430-9 458 11 535 104Z'/>
</font>
<font id='nf0' horiz-adv-x='533'>
<font-face font-family='nf0' units-per-em='1000' ascent='783' descent='217'/>
<glyph unicode='1' horiz-adv-x='500' vert-adv-y='500' glyph-name='one' d='M394 0V15C315 16 299 26 299 74V674L291 676L111 585V571C123 576 134 580 138 582C156 589 173 593 183 593C204 593 213 578 213 546V93C213 60 205 37 189 28C174 19 160 16 118 15V0H394Z'/>
</font>
</defs>
<g id='page1'>
<text font-family='NewTXMI' font-size='9.92542' x='76.841838' y='66.697957'>𝑎</text>
<text font-family='txmiaX' font-size='9.92542' x='84.959115' y='66.697957'>=</text>
<text font-family='txexs' font-size='9.92542' x='93.624331' y='53.143805'>∮</text>
<text font-family='NewTXMI7' font-size='7.245559' x='105.635281' y='55.951072'>𝑛</text>
<text font-family='NewTXMI7' font-size='7.245559' x='99.966049' y='75.49497'>𝑎</text>
<text font-family='NewTXMI' font-size='9.92542' x='61.897878' y='85.627277'>𝑎</text>
<text font-family='txmiaX' font-size='9.92542' x='70.015155' y='85.627277'>=</text>
<text font-family='txexs' font-size='9.92542' x='78.680371' y='76.887575'>∮</text>
<text font-family='NewTXMI7' font-size='7.245559' x='86.596676' y='79.694842'>𝑛</text>
<text font-family='NewTXMI7' font-size='7.245559' x='84.215102' y='89.60984'>𝑎</text>
<text font-family='nf0' font-size='9.96264' x='231.13325' y='630.635118'>1</text>
</g>
</svg>
Pay close attention to the font definitions:
<font id='txexs' horiz-adv-x='0'>
<font-face font-family='txexs' units-per-em='1000' ascent='1444' descent='2960'/>
<glyph unicode='∮' horiz-adv-x='530' vert-adv-y='530' glyph-name='uni222E' d='M656-72C663-17 606 0 560 0C416 0 383-229 363-332C361-343 355-379 352-391C351-391 350-391 349-391C222-391 111-492 111-619C111-717 181-799 267-832C257-882 252-904 245-945C231-1024 175-1230 141-1230C130-1230 118-1227 111-1218C114-1213 126-1200 128-1190C134-1160 115-1140 86-1140C60-1140 34-1174 32-1192C24-1248 81-1261 126-1261C243-1261 289-1065 314-945C321-910 326-893 335-847C458-843 567-743 567-619C567-525 500-445 419-410C423-390 431-346 434-329C450-246 503-30 546-30C557-30 569-33 576-42C572-48 558-64 557-71C553-101 571-120 600-120C623-120 653-91 656-72ZM274-792C208-763 151-696 151-619C151-517 242-434 344-431C323-540 297-672 274-792ZM411-451C473-482 527-545 527-619C527-718 440-798 343-806C366-691 391-557 411-451Z'/>
<glyph unicode='∮' horiz-adv-x='711' vert-adv-y='711' glyph-name='uni222E.dsp' d='M1020-114C1032-50 992 0 924 0C694 0 639-391 587-636C577-682 567-731 557-782C554-782 552-782 549-782C375-782 225-921 225-1095C225-1230 320-1344 438-1388C421-1481 405-1570 390-1651C364-1795 296-2170 165-2170C130-2170 201-2134 206-2085C211-2040 188-2015 146-2015C102-2015 59-2062 56-2088C49-2140 83-2207 156-2207C386-2207 439-1859 483-1645C497-1577 513-1495 531-1408C703-1406 851-1268 851-1095C851-964 761-853 648-806C660-740 671-679 681-626C711-469 796-36 887-36C932-36 869-80 867-119C866-149 893-180 932-180C964-180 1011-160 1020-114ZM448-1338C353-1299 275-1205 275-1095C275-950 402-833 547-832C514-993 480-1171 448-1338ZM638-856C728-898 801-989 801-1095C801-1236 680-1351 541-1358C573-1195 608-1015 638-856Z'/>
</font>
Within this font, there are two different definitions for the same Unicode character ∮.
They share the same Unicode (unicode='∮'), but their glyph names are different:
One is glyph-name='uni222E'
The other is glyph-name='uni222E.dsp'
Moreover, their vector paths are completely different.
In the section, the elements reference these two glyphs:
<text font-family='txexs' font-size='9.92542' x='93.624331' y='53.143805'>∮</text>
<text font-family='txexs' font-size='9.92542' x='78.680371' y='76.887575'>∮</text>
Each element specifies the font-family and Unicode character,
but does not specify the glyph-name.
How can I determine which glyph is actually being used in each case?
I have discovered a rather serious bug.
Below is my TeX code:
I saved this code as fonterror.tex and compiled it using:
xelatex --no-pdf fonterror.texThis generated the fonterror.xdv file.
Then, I used the following command to convert it into an SVG file:
dvisvgm --no-merge --no-styles fonterror.xdvHere is the content of the generated SVG file:
Pay close attention to the font definitions:
Within this font, there are two different definitions for the same Unicode character ∮.
They share the same Unicode (unicode='∮'), but their glyph names are different:
One is glyph-name='uni222E'
The other is glyph-name='uni222E.dsp'
Moreover, their vector paths are completely different.
In the section, the elements reference these two glyphs:
Each element specifies the font-family and Unicode character,
but does not specify the glyph-name.
How can I determine which glyph is actually being used in each case?