Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

ძიება მხარდაჭერაში

ნუ გაებმებით თაღლითების მახეში მხარდაჭერის საიტზე. აქ არასდროს მოგთხოვენ სატელეფონო ნომერზე დარეკვას, შეტყობინების გამოგზავნას ან პირადი მონაცემების გაზიარებას. გთხოვთ, გვაცნობოთ რამე საეჭვოს შემჩნევისას „დარღვევაზე მოხსენების“ მეშვეობით.

ვრცლად

Extracted svg figure is different with which show in orginal html file

  • 2 პასუხი
  • 1 მომხმარებელი წააწყდა მსგავს სიძნელეს
  • 3 ნახვა
  • ბოლოს გამოეხმაურა xiestcn

I have a local HTML file which executes some js functions to draw svg figure. The browser rendered the HTML well, and then I extracted the svg conent from console using console.log(document.getElementsByTagName('svg')[0].outerHTML) and save as "t.svg". I found there was a slight difference between figure in "t.svg" and the orignal HMTL rendered by browser. But when I redid these in chrome and ms edge, the "t.svg" and the HTML were exactly same.

I have a local HTML file which executes some js functions to draw svg figure. The browser rendered the HTML well, and then I extracted the svg conent from console using console.log(document.getElementsByTagName('svg')[0].outerHTML) and save as "t.svg". I found there was a slight difference between figure in "t.svg" and the orignal HMTL rendered by browser. But when I redid these in chrome and ms edge, the "t.svg" and the HTML were exactly same.
მიმაგრებული ეკრანის სურათები

ყველა პასუხი (2)

The second screenshot shows a bit zoomed with only the text being zoomed and not their containers causing content to overlap.

You may have accidentally zoomed webpage(s). Reset the page zoom on pages that cause problems.

  • View -> Zoom -> Reset (Ctrl+0/Command+0 (zero))

Also make sure you aren't using "Zoom text only"

  • Settings -> General -> Language and Appearance -> Zoom

cor-el said

Thanks for your reply!

The problem is not caused by Zoom setting. It's probably caused by Font family. The text's font family set in svg is not exists in my Win10 laptop. As I extracted the svg from console, the browser may compute the text box width use "Times new roman"(default font family set in firefox), and the rendered svg displayed the text in other Font family which is wider than "Times new roman" in same font size. I fixed the problem by changing the font family to "Microsoft YaHei".

But the problem is still there with default font family setting. Could Firefox do this by default without modify the settings (or may be in future version?), as the HTML can be rendered correctly by default.