Qt5 QGraphicsSvgItem ignores SVG text spacing

What the .svg file looks like loaded into chrome:





What the .svg file looks like loaded into my app: 





The \lim kind of gets cut off, but that's unrelated. So when I do:
self._svg = QGraphicsSvgItem("dvisvgm_output.svg")
It results in the above. I'm not setting any SVG related flags or anything. This SVG file is generated by latex.exe and dvisvgm.exe in the usual way.
Here is the SVG code actually:

<?xml version='1.0' encoding='UTF-8'?>
<!-- This file was generated by dvisvgm 2.4 -->
<svg height='8.855684pt' version='1.1' viewBox='-72.000004 -72.000008 246.344182 8.855684' width='246.344182pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
<defs>
<font horiz-adv-x='0' id='cmr10'>
<font-face ascent='750' descent='250' font-family='cmr10' units-per-em='1000'/>
<glyph d='M192 53C192 82 168 106 139 106S86 82 86 53S110 0 139 0S192 24 192 53Z' glyph-name='period' horiz-adv-x='277' unicode='.' vert-adv-y='277'/>
<glyph d='M136 78C136 42 134 31 57 31H33V0H610L652 258H627C602 104 579 31 407 31H274C227 31 225 38 225 71V338H315C412 338 423 306 423 221H448V486H423C423 400 412 369 315 369H225V609C225 642 227 649 274 649H403C556 649 583 594 599 455H624L596 680H33V649H57C134 649 136 638 136 602V78Z' glyph-name='E' horiz-adv-x='680' unicode='E' vert-adv-y='680'/>
<glyph d='M333 76C337 36 364 -6 411 -6C432 -6 493 8 493 89V145H468V89C468 31 443 25 432 25C399 25 395 70 395 75V275C395 317 395 356 359 393C320 432 270 448 222 448C140 448 71 401 71 335C71 305 91 288 117 288C145 288 163 308 163 334C163 346 158 379 112 380C139 415 188 426 220 426C269 426 326 387 326 298V261C275 258 205 255 142 225C67 191 42 139 42 95C42 14 139 -11 202 -11C268 -11 314 29 333 76ZM326 240V140C326 45 254 11 209 11C160 11 119 46 119 96C119 151 161 234 326 240Z' glyph-name='a' horiz-adv-x='500' unicode='a' vert-adv-y='500'/>
<glyph d='M117 218C117 381 199 423 252 423C261 423 324 422 359 386C318 383 312 353 312 340C312 314 330 294 358 294C384 294 404 311 404 341C404 409 328 448 251 448C126 448 34 340 34 216C34 88 133 -11 249 -11C383 -11 415 109 415 119S405 129 402 129C393 129 391 125 389 119C360 26 295 14 258 14C205 14 117 57 117 218Z' glyph-name='c' horiz-adv-x='444' unicode='c' vert-adv-y='444'/>
<glyph d='M380 55V-11L527 0V31C457 31 449 38 449 87V694L305 683V652C375 652 383 645 383 596V380C354 416 311 442 257 442C139 442 34 344 34 215C34 88 132 -11 246 -11C310 -11 355 23 380 55ZM380 323V118C380 100 380 98 369 81C339 33 294 11 251 11C206 11 170 37 146 75C120 116 117 173 117 214C117 251 119 311 148 356C169 387 207 420 261 420C296 420 338 405 369 360C380 343 380 341 380 323Z' glyph-name='d' horiz-adv-x='555' unicode='d' vert-adv-y='555'/>
<glyph d='M112 252C118 401 202 426 236 426C339 426 349 291 349 252H112ZM111 231H390C412 231 415 231 415 252C415 351 361 448 236 448C120 448 28 345 28 220C28 86 133 -11 248 -11C370 -11 415 100 415 119C415 129 407 131 402 131C393 131 391 125 389 117C354 14 264 14 254 14C204 14 164 44 141 81C111 129 111 195 111 231Z' glyph-name='e' horiz-adv-x='444' unicode='e' vert-adv-y='444'/>
<glyph d='M175 431V547C175 635 223 683 267 683C270 683 285 683 300 676C288 672 270 659 270 634C270 611 286 591 313 591C342 591 357 611 357 635C357 672 320 705 267 705C197 705 112 652 112 546V431H33V400H112V76C112 31 101 31 34 31V0C73 1 120 3 148 3C188 3 235 3 275 0V31H254C180 31 178 42 178 78V400H292V431H175Z' glyph-name='f' horiz-adv-x='305' unicode='f' vert-adv-y='305'/>
<glyph d='M222 172C135 172 135 272 135 295C135 322 136 354 151 379C159 391 182 419 222 419C309 419 309 319 309 296C309 269 308 237 293 212C285 200 262 172 222 172ZM106 133C106 137 106 160 123 180C162 152 203 149 222 149C315 149 384 218 384 295C384 332 368 369 343 392C379 426 415 431 433 431C435 431 440 431 443 430C432 426 427 415 427 403C427 386 440 374 456 374C466 374 485 381 485 404C485 421 473 453 434 453C414 453 370 447 328 406C286 439 244 442 222 442C129 442 60 373 60 296C60 252 82 214 107 193C94 178 76 145 76 110C76 79 89 41 120 21C60 4 28 -39 28 -79C28 -151 127 -206 249 -206C367 -206 471 -155 471 -77C471 -42 457 9 406 37C353 65 295 65 234 65C209 65 166 65 159 66C127 70 106 101 106 133ZM250 -183C149 -183 80 -132 80 -79C80 -33 118 4 162 7H221C307 7 419 7 419 -79C419 -133 348 -183 250 -183Z' glyph-name='g' horiz-adv-x='500' unicode='g' vert-adv-y='500'/>
<glyph d='M110 76C110 31 99 31 32 31V0C67 1 118 3 145 3C171 3 223 1 257 0V31C190 31 179 31 179 76V260C179 364 250 420 314 420C377 420 388 366 388 309V76C388 31 377 31 310 31V0C345 1 396 3 423 3C449 3 501 1 535 0V31C483 31 458 31 457 61V252C457 338 457 369 426 405C412 422 379 442 321 442C237 442 193 382 176 344V694L32 683V652C102 652 110 645 110 596V76Z' glyph-name='h' horiz-adv-x='555' unicode='h' vert-adv-y='555'/>
<glyph d='M177 442L37 431V400C102 400 111 394 111 345V76C111 31 100 31 33 31V0C65 1 119 3 143 3C178 3 213 1 247 0V31C181 31 177 36 177 75V442ZM181 616C181 648 156 669 128 669C97 669 75 642 75 616C75 589 97 563 128 563C156 563 181 584 181 616Z' glyph-name='i' horiz-adv-x='277' unicode='i' vert-adv-y='277'/>
<glyph d='M106 76C106 31 95 31 28 31V0C61 1 108 3 137 3C167 3 207 2 247 0V31C180 31 169 31 169 76V179L233 234C310 128 352 72 352 54C352 35 335 31 316 31V0C344 1 403 3 424 3C453 3 482 2 511 0V31C474 31 452 31 414 84L287 263C286 265 281 271 281 274C281 278 352 338 362 346C425 397 467 399 488 400V431C459 428 446 428 418 428C382 428 320 430 306 431V400C325 399 335 388 335 375C335 355 321 343 313 336L172 214V694L28 683V652C98 652 106 645 106 596V76Z' glyph-name='k' horiz-adv-x='527' unicode='k' vert-adv-y='527'/>
<glyph d='M177 694L33 683V652C103 652 111 645 111 596V76C111 31 100 31 33 31V0C66 1 119 3 144 3S218 1 255 0V31C188 31 177 31 177 76V694Z' glyph-name='l' horiz-adv-x='277' unicode='l' vert-adv-y='277'/>
<glyph d='M110 344V76C110 31 99 31 32 31V0C67 1 118 3 145 3C171 3 223 1 257 0V31C190 31 179 31 179 76V260C179 364 250 420 314 420C377 420 388 366 388 309V76C388 31 377 31 310 31V0C345 1 396 3 423 3C449 3 501 1 535 0V31C468 31 457 31 457 76V260C457 364 528 420 592 420C655 420 666 366 666 309V76C666 31 655 31 588 31V0C623 1 674 3 701 3C727 3 779 1 813 0V31C761 31 736 31 735 61V252C735 338 735 369 704 405C690 422 657 442 599 442C515 442 471 382 454 344C440 431 366 442 321 442C248 442 201 399 173 337V442L32 431V400C102 400 110 393 110 344Z' glyph-name='m' horiz-adv-x='833' unicode='m' vert-adv-y='833'/>
<glyph d='M110 344V76C110 31 99 31 32 31V0C67 1 118 3 145 3C171 3 223 1 257 0V31C190 31 179 31 179 76V260C179 364 250 420 314 420C377 420 388 366 388 309V76C388 31 377 31 310 31V0C345 1 396 3 423 3C449 3 501 1 535 0V31C483 31 458 31 457 61V252C457 338 457 369 426 405C412 422 379 442 321 442C248 442 201 399 173 337V442L32 431V400C102 400 110 393 110 344Z' glyph-name='n' horiz-adv-x='555' unicode='n' vert-adv-y='555'/>
<glyph d='M471 214C471 342 371 448 250 448C125 448 28 339 28 214C28 85 132 -11 249 -11C370 -11 471 87 471 214ZM250 14C207 14 163 35 136 81C111 125 111 186 111 222C111 261 111 315 135 359C162 405 209 426 249 426C293 426 336 404 362 361S388 260 388 222C388 186 388 132 366 88C344 43 300 14 250 14Z' glyph-name='o' horiz-adv-x='500' unicode='o' vert-adv-y='500'/>
<glyph d='M172 376V442L28 431V400C99 400 106 394 106 350V-118C106 -163 95 -163 28 -163V-194C62 -193 114 -191 140 -191C167 -191 218 -193 253 -194V-163C186 -163 175 -163 175 -118V50V59C180 43 222 -11 298 -11C417 -11 521 87 521 216C521 343 424 442 312 442C234 442 192 398 172 376ZM175 114V337C204 388 253 417 304 417C377 417 438 329 438 216C438 95 368 11 294 11C254 11 216 31 189 72C175 93 175 94 175 114Z' glyph-name='p' horiz-adv-x='555' unicode='p' vert-adv-y='555'/>
<glyph d='M208 194C230 190 312 174 312 102C312 51 277 11 199 11C115 11 79 68 60 153C57 166 56 170 46 170C33 170 33 163 33 145V13C33 -4 33 -11 44 -11C49 -11 50 -10 69 9C71 11 71 13 89 32C133 -10 178 -11 199 -11C314 -11 360 56 360 128C360 181 330 211 318 223C285 255 246 263 204 271C148 282 81 295 81 353C81 388 107 429 193 429C303 429 308 339 310 308C311 299 320 299 322 299C335 299 335 304 335 323V424C335 441 335 448 324 448C319 448 317 448 304 436C301 432 291 423 287 420C249 448 208 448 193 448C71 448 33 381 33 325C33 290 49 262 76 240C108 214 136 208 208 194Z' glyph-name='s' horiz-adv-x='394' unicode='s' vert-adv-y='394'/>
<glyph d='M173 400H316V431H173V615H148C147 533 117 426 19 422V400H104V124C104 1 197 -11 233 -11C304 -11 332 60 332 124V181H307V126C307 52 277 14 240 14C173 14 173 105 173 122V400Z' glyph-name='t' horiz-adv-x='388' unicode='t' vert-adv-y='388'/>
<glyph d='M619 336C637 386 668 399 703 400V431C681 429 652 428 630 428C601 428 556 430 537 431V400C573 399 595 381 595 352C595 346 595 344 590 331L499 75L400 354C396 366 395 368 395 373C395 400 434 400 454 400V431C425 430 374 428 350 428C320 428 291 429 261 431V400C298 400 314 398 324 385C329 379 340 349 347 330L261 88L166 355C161 367 161 369 161 373C161 400 200 400 220 400V431C190 430 134 428 111 428C107 428 54 429 18 431V400C68 400 80 397 92 365L218 11C223 -3 226 -11 239 -11S254 -5 259 9L360 292L462 8C466 -3 469 -11 482 -11S498 -2 502 8L619 336Z' glyph-name='w' horiz-adv-x='722' unicode='w' vert-adv-y='722'/>
<glyph d='M287 235C317 273 355 322 379 348C410 384 451 399 498 400V431C472 429 442 428 416 428C386 428 333 430 320 431V400C341 398 349 385 349 369S339 340 334 334L272 256L194 357C185 367 185 369 185 375C185 390 200 399 220 400V431C194 430 128 428 112 428C91 428 44 429 17 431V400C87 400 88 399 135 339L234 210L140 91C92 33 33 31 12 31V0C38 2 69 3 95 3C124 3 166 1 190 0V31C168 34 161 47 161 62C161 84 190 117 251 189L327 89C335 78 348 62 348 56C348 47 339 32 312 31V0C342 1 398 3 420 3C447 3 486 2 516 0V31C462 31 444 33 421 62L287 235Z' glyph-name='x' horiz-adv-x='527' unicode='x' vert-adv-y='527'/>
</font>
<font horiz-adv-x='0' id='cmmi10'>
<font-face ascent='750' descent='250' font-family='cmmi10' units-per-em='1000'/>
<glyph d='M575 569C575 644 520 706 439 706C381 706 353 690 318 664C263 624 208 527 189 451L30 -184C29 -188 34 -194 42 -194S53 -192 54 -189L124 87C143 27 187 -10 260 -10S408 25 453 69C501 115 533 179 533 253C533 325 496 377 460 402C518 435 575 497 575 569ZM395 403C382 398 371 396 347 396C333 396 313 395 303 400C305 410 341 408 352 408C373 408 382 408 395 403ZM519 592C519 522 481 450 429 419C402 429 382 431 352 431C331 431 275 432 275 399C274 371 326 374 344 374C381 374 396 375 426 387C464 351 469 320 470 274C472 216 448 141 420 102C381 48 314 12 257 12C181 12 143 70 143 141C143 151 143 166 148 185L212 438C234 524 306 683 426 683C484 683 519 652 519 592Z' glyph-name='beta' horiz-adv-x='565' unicode='β' vert-adv-y='565'/>
</font>
</defs>
<style type='text/css'>
<![CDATA[
text
.f0 {font-family:cmmi10;font-size:9.96264px}
text
.f1 {font-family:cmr10;font-size:9.96264px}
]]>
</style>
<g id='page1'>
<text class='f1' x='-72.000004' y='-65.081506'>Example<tspan x='-30.627253'>with</tspan>
<tspan x='-7.934519'>no</tspan>
<tspan x='5.902512'>pac</tspan>
<tspan x='20.569771'>k</tspan>
<tspan x='25.274377'>ages</tspan>
<tspan x='46.915499'>and</tspan>
<tspan x='66.287347'>no</tspan>
<tspan x='80.124378'>fon</tspan>
<tspan x='93.407943'>t</tspan>
<tspan x='100.603192'>commands</tspan>
<tspan x='149.918399'>lim</tspan>
</text>
<text class='f0' x='165.415841' y='-65.081506'>β</text>
<text class='f1' x='171.57677' y='-65.081506'>.</text>
</g>
</svg>

Comments

Popular posts from this blog

How to change this to <%Html.ActionLink%> in my asp.net mvc application ?