question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SVG: Incorrect fonts

See original GitHub issue

The font selection within SVG seems inconsistent.

In the following sample I believe:

  • HTML text correctly uses Arial
  • SVG line 1: seems like Arial
  • SVG remaining lines are not using the expected fonts.
System: Darwin
Machine: x86_64
Version: Darwin Kernel Version 19.6.0: Thu May  6 00:48:39 PDT 2021; root:xnu-6153.141.33~1/RELEASE_X86_64
Release: 19.6.0

WeasyPrint version: 53.0b2
Python version: 3.9.5
Pydyf version: 0.0.3
Pango version: 14805

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
takessoncommented, Jul 29, 2021

The answer to the last question is: It included the Apple Emoji font collection, for some reason (I have some very experimental CSS).


obj 329 0
 Type: 
 Referencing: 208 0 R, 328 0 R

  <<
    /Count 121
    /First 208 0 R
    /Last 328 0 R
  >>


obj 330 0
 Type: 
 Referencing: 
 Contains stream

  <<
    /Length1 6171680
    /Filter /FlateDecode
    /Length 1969704
  >>


obj 331 0
 Type: 
 Referencing: 
 Contains stream

  <<
    /Length1 207931344
    /Filter /FlateDecode
    /Length 181863731
  >>


obj 332 0
 Type: 
 Referencing: 
 Contains stream

  <<
    /Length1 24056
    /Filter /FlateDecode
    /Length 6211
  >>


obj 333 0
 Type: 
 Referencing: 
 Contains stream

  <<
    /Length1 7216
    /Filter /FlateDecode
    /Length 4633
  >>


obj 334 0
 Type: /FontDescriptor
 Referencing: 330 0 R

  <<
    /Type /FontDescriptor
    /FontName /GRHJRG+HelveticaNeue
    /FontFamily (Helvetica Neue)
    /Flags 4
    /FontBBox [ -3 -191 499 325 ]
    /ItalicAngle 0
    /Ascent 974
    /Descent -216
    /CapHeight 325
    /StemV 80
    /StemH 80
    /FontFile2 330 0 R
  >>


obj 335 0
 Type: /Font
 Referencing: 334 0 R

  <<
    /Type /Font
    /Subtype /CIDFontType2
    /BaseFont /GRHJRG+HelveticaNeue
    /CIDSystemInfo
      <<
        /Registry (Adobe)
        /Ordering (Identity)
        /Supplement 0
      >>
    /W [ 3 [ 277 ]
    15 [ 277 ]
    17 [ 277 351 ]
    36 [ 666 703 721 721 629 592 758 ]
    44 [ 277 ]
    47 [ 574 888 721 759 666 759 703 647 592 721 610 943 647 ]
    68 [ 555 610 555 610 555 314 592 574 240 240 536 240 869 574 592 610 610 351 518 333 574 518 777 536 518 499 ]
    226 [ 277 ]
    240 [ 555 555 499 ]
    ] /FontDescriptor 334 0 R
  >>


obj 336 0
 Type: 
 Referencing: 
 Contains stream

  <<
    /Length 1102
  >>


obj 337 0
 Type: /Font
 Referencing: 335 0 R, 336 0 R

  <<
    /Type /Font
    /Subtype /Type0
    /BaseFont /GRHJRG+HelveticaNeue
    /Encoding /Identity-H
    /DescendantFonts [ 335 0 R ]
    /ToUnicode 336 0 R
  >>


obj 338 0
 Type: /FontDescriptor
 Referencing: 330 0 R

  <<
    /Type /FontDescriptor
    /FontName /STXCLD+HelveticaNeue
    /FontFamily (Helvetica Neue)
    /Flags 4
    /FontBBox [ -17 -21 172 713 ]
    /ItalicAngle 0
    /Ascent 952
    /Descent -213
    /CapHeight 713
    /StemV 80
    /StemH 80
    /FontFile2 330 0 R
  >>


obj 339 0
 Type: /Font
 Referencing: 338 0 R

  <<
    /Type /Font
    /Subtype /CIDFontType2
    /BaseFont /STXCLD+HelveticaNeue
    /CIDSystemInfo
      <<
        /Registry (Adobe)
        /Ordering (Identity)
        /Supplement 0
      >>
    /W [ 3 [ 277 ]
    8 [ 258 425 ]
    12 [ 999 ]
    14 [ 277 258 258 ]
    18 [ 599 277 388 277 332 ]
    33 [ 277 277 ]
    37 [ 599 555 ]
    40 [ 647 684 721 703 610 573 758 721 258 518 666 555 870 721 759 647 759 684 647 573 721 610 925 610 647 ]
    70 [ 499 ]
    72 [ 536 592 536 592 536 295 573 555 221 221 518 221 852 555 573 592 592 332 499 314 555 499 757 517 499 479 ]
    182 [ 499 999 425 425 ]
    187 [ 277 ]
    196 [ 517 517 ]
    584 [ 576 798 ]
    2094 [ 349 ]
    268435455 [ 0 ]
    ] /FontDescriptor 338 0 R
  >>


obj 340 0
 Type: 
 Referencing: 
 Contains stream

  <<
    /Length 1436
  >>


obj 341 0
 Type: /Font
 Referencing: 339 0 R, 340 0 R

  <<
    /Type /Font
    /Subtype /Type0
    /BaseFont /STXCLD+HelveticaNeue
    /Encoding /Identity-H
    /DescendantFonts [ 339 0 R ]
    /ToUnicode 340 0 R
  >>


obj 342 0
 Type: /FontDescriptor
 Referencing: 331 0 R

  <<
    /Type /FontDescriptor
    /FontName /AVMJJJ+AppleColorEmoji
    /FontFamily (Apple Color Emoji)
    /Flags 5
    /FontBBox [ 0 -21 1000 1000 ]
    /ItalicAngle 0
    /Ascent 799
    /Descent -250
    /CapHeight 1000
    /StemV 80
    /StemH 80
    /FontFile2 331 0 R
  >>


obj 343 0
 Type: /Font
 Referencing: 342 0 R

  <<
    /Type /Font
    /Subtype /CIDFontType2
    /BaseFont /AVMJJJ+AppleColorEmoji
    /CIDSystemInfo
      <<
        /Registry (Adobe)
        /Ordering (Identity)
        /Supplement 0
      >>
    /W [ 3 [ 999 ]
    5 [ 999 999 999 999 999 999 999 999 999 ]
    44 [ 999 ]
    121 [ 999 ]
    123 [ 999 ]
    ] /FontDescriptor 342 0 R
  >>


obj 344 0
 Type: 
 Referencing: 
 Contains stream

  <<
    /Length 506
  >>


obj 345 0
 Type: /Font
 Referencing: 343 0 R, 344 0 R

  <<
    /Type /Font
    /Subtype /Type0
    /BaseFont /AVMJJJ+AppleColorEmoji
    /Encoding /Identity-H
    /DescendantFonts [ 343 0 R ]
    /ToUnicode 344 0 R
  >>


obj 346 0
 Type: /FontDescriptor
 Referencing: 332 0 R

  <<
    /Type /FontDescriptor
    /FontName /VACLAJ+Arial
    /FontFamily (Arial)
    /Flags 4
    /FontBBox [ 0 0 299 453 ]
    /ItalicAngle 0
    /Ascent 905
    /Descent -211
    /CapHeight 453
    /StemV 80
    /StemH 80
    /FontFile2 332 0 R
  >>


obj 347 0
 Type: /Font
 Referencing: 346 0 R

  <<
    /Type /Font
    /Subtype /CIDFontType2
    /BaseFont /VACLAJ+Arial
    /CIDSystemInfo
      <<
        /Registry (Adobe)
        /Ordering (Identity)
        /Supplement 0
      >>
    /W [ 405 [ 354 ]
    ] /FontDescriptor 346 0 R
  >>


obj 348 0
 Type: 
 Referencing: 
 Contains stream

  <<
    /Length 337
  >>


obj 349 0
 Type: /Font
 Referencing: 347 0 R, 348 0 R

  <<
    /Type /Font
    /Subtype /Type0
    /BaseFont /VACLAJ+Arial
    /Encoding /Identity-H
    /DescendantFonts [ 347 0 R ]
    /ToUnicode 348 0 R
  >>


obj 350 0
 Type: /FontDescriptor
 Referencing: 330 0 R

  <<
    /Type /FontDescriptor
    /FontName /KNRPIN+HelveticaNeue
    /FontFamily (Helvetica Neue)
    /Flags 4
    /FontBBox [ -8 -181 499 333 ]
    /ItalicAngle 0
    /Ascent 975
    /Descent -217
    /CapHeight 333
    /StemV 80
    /StemH 80
    /FontFile2 330 0 R
  >>


obj 351 0
 Type: /Font
 Referencing: 350 0 R

  <<
    /Type /Font
    /Subtype /CIDFontType2
    /BaseFont /KNRPIN+HelveticaNeue
    /CIDSystemInfo
      <<
        /Registry (Adobe)
        /Ordering (Identity)
        /Supplement 0
      >>
    /W [ 3 [ 277 ]
    9 [ 462 ]
    15 [ 295 295 ]
    18 [ 599 277 406 277 370 ]
    33 [ 277 ]
    38 [ 555 799 684 703 740 740 647 592 758 740 294 555 721 592 906 740 777 666 777 721 648 610 740 629 943 666 666 647 332 ]
    68 [ 332 ]
    70 [ 499 ]
    72 [ 573 610 573 610 573 332 610 592 257 277 573 257 905 592 610 610 610 388 536 351 592 519 813 536 518 518 ]
    99 [ 222 ]
    182 [ 499 ]
    196 [ 610 ]
    ] /FontDescriptor 350 0 R
  >>


obj 352 0
 Type: 
 Referencing: 
 Contains stream

  <<
    /Length 1308
  >>


obj 353 0
 Type: /Font
 Referencing: 351 0 R, 352 0 R

  <<
    /Type /Font
    /Subtype /Type0
    /BaseFont /KNRPIN+HelveticaNeue
    /Encoding /Identity-H
    /DescendantFonts [ 351 0 R ]
    /ToUnicode 352 0 R
  >>


obj 354 0
 Type: /FontDescriptor
 Referencing: 330 0 R

  <<
    /Type /FontDescriptor
    /FontName /QAEHAK+HelveticaNeue
    /FontFamily (Helvetica Neue)
    /Flags 68
    /FontBBox [ -4 -11 500 528 ]
    /ItalicAngle 0
    /Ascent 956
    /Descent -213
    /CapHeight 528
    /StemV 80
    /StemH 80
    /FontFile2 330 0 R
  >>


obj 355 0
 Type: /Font
 Referencing: 354 0 R

  <<
    /Type /Font
    /Subtype /CIDFontType2
    /BaseFont /QAEHAK+HelveticaNeue
    /CIDSystemInfo
      <<
        /Registry (Adobe)
        /Ordering (Identity)
        /Supplement 0
      >>
    /W [ 21 [ 277 ]
    42 [ 721 ]
    52 [ 869 ]
    58 [ 647 ]
    72 [ 518 ]
    74 [ 536 ]
    76 [ 536 295 ]
    80 [ 221 ]
    84 [ 851 555 573 ]
    89 [ 332 480 314 555 ]
    96 [ 480 ]
    ] /FontDescriptor 354 0 R
  >>


obj 356 0
 Type: 
 Referencing: 
 Contains stream

  <<
    /Length 562
  >>


obj 357 0
 Type: /Font
 Referencing: 355 0 R, 356 0 R

  <<
    /Type /Font
    /Subtype /Type0
    /BaseFont /QAEHAK+HelveticaNeue
    /Encoding /Identity-H
    /DescendantFonts [ 355 0 R ]
    /ToUnicode 356 0 R
  >>


obj 358 0
 Type: /FontDescriptor
 Referencing: 330 0 R

  <<
    /Type /FontDescriptor
    /FontName /EUVZNK+HelveticaNeue
    /FontFamily (Helvetica Neue)
    /Flags 4
    /FontBBox [ 0 -3 312 699 ]
    /ItalicAngle 0
    /Ascent 971
    /Descent -226
    /CapHeight 699
    /StemV 80
    /StemH 80
    /FontFile2 330 0 R
  >>


obj 359 0
 Type: /Font
 Referencing: 358 0 R

  <<
    /Type /Font
    /Subtype /CIDFontType2
    /BaseFont /EUVZNK+HelveticaNeue
    /CIDSystemInfo
      <<
        /Registry (Adobe)
        /Ordering (Identity)
        /Supplement 0
      >>
    /W [ 45 [ 480 ]
    72 [ 499 ]
    84 [ 777 ]
    86 [ 499 ]
    89 [ 351 ]
    91 [ 314 ]
    ] /FontDescriptor 358 0 R
  >>


obj 360 0
 Type: 
 Referencing: 
 Contains stream

  <<
    /Length 407
  >>


obj 361 0
 Type: /Font
 Referencing: 359 0 R, 360 0 R

  <<
    /Type /Font
    /Subtype /Type0
    /BaseFont /EUVZNK+HelveticaNeue
    /Encoding /Identity-H
    /DescendantFonts [ 359 0 R ]
    /ToUnicode 360 0 R
  >>


obj 362 0
 Type: /FontDescriptor
 Referencing: 333 0 R

  <<
    /Type /FontDescriptor
    /FontName /AETFHB+AndaleMono
    /FontFamily (Andale Mono)
    /Flags 5
    /FontBBox [ 0 -13 497 520 ]
    /ItalicAngle 0
    /Ascent 907
    /Descent -217
    /CapHeight 520
    /StemV 80
    /StemH 80
    /FontFile2 333 0 R
  >>


obj 363 0
 Type: /Font
 Referencing: 362 0 R

  <<
    /Type /Font
    /Subtype /CIDFontType2
    /BaseFont /AETFHB+AndaleMono
    /CIDSystemInfo
      <<
        /Registry (Adobe)
        /Ordering (Identity)
        /Supplement 0
      >>
    /W [ 16 [ 600 ]
    29 [ 600 ]
    68 [ 600 600 600 600 600 ]
    79 [ 600 600 600 600 ]
    85 [ 600 600 ]
    ] /FontDescriptor 362 0 R
  >>


obj 364 0
 Type: 
 Referencing: 
 Contains stream

  <<
    /Length 506
  >>


obj 365 0
 Type: /Font
 Referencing: 363 0 R, 364 0 R

  <<
    /Type /Font
    /Subtype /Type0
    /BaseFont /AETFHB+AndaleMono
    /Encoding /Identity-H
    /DescendantFonts [ 363 0 R ]
    /ToUnicode 364 0 R
  >>


obj 366 0
 Type: 
 Referencing: 337 0 R, 341 0 R, 345 0 R, 349 0 R, 353 0 R, 357 0 R, 361 0 R, 365 0 R

  <<
    /GRHJRG 337 0 R
    /STXCLD 341 0 R
    /AVMJJJ 345 0 R
    /VACLAJ 349 0 R
    /KNRPIN 353 0 R
    /QAEHAK 357 0 R
    /EUVZNK 361 0 R
    /AETFHB 365 0 R
  >>

0reactions
liZecommented, Jul 30, 2021

Emoji fonts can be big, and if they’re included in font collections the whole file can be huge. Moreover, the whole collection was fully included for each variant (bold, italic, etc.) found in the document.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What to do if the font in SVG format is wrong? - Logaster
What to do if the font in SVG format is wrong? · 1. Find out what type of font is used in your...
Read more >
Why svg image font changes - General - Forum | Webflow
SVG isn't just a vector image format. It can contain numerous other stuff like bitmap images, and text as text (not vector).
Read more >
Preserving font type in illustrator SVG file
The reason why the font does not render correctly to the actual font type is because, when the SVG is saved ...
Read more >
When I export an svg, all the fonts seem to revert to Times ...
In order to avoid that, before exporting your design, please select your font and go: Modify > Path > Convert to Path (make...
Read more >
SVG Fonts view differently? - Beginners' Questions - Inkscape
My best guess is that wherever you are viewing the SVG image in IE, that computer does not have the same font installed,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found