mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-11 03:37:20 +00:00
render canvas on-screen to avoid bad fonts in MSIE
This commit is contained in:
parent
bfeb7e082f
commit
4ca918a3b8
1 changed files with 6 additions and 1 deletions
|
@ -245,6 +245,12 @@ define [
|
|||
return
|
||||
|
||||
canvas = $('<canvas class="pdf-canvas pdfng-rendering"></canvas>')
|
||||
# In Windows+IE we must have the canvas in the DOM during
|
||||
# rendering to see the fonts defined in the DOM. If we try to
|
||||
# render 'offscreen' then all the text will be sans-serif.
|
||||
# Previously we rendered offscreen and added in the canvas
|
||||
# when rendering was complete.
|
||||
element.canvas.replaceWith(canvas)
|
||||
|
||||
viewport = page.getViewport (scale)
|
||||
|
||||
|
@ -298,7 +304,6 @@ define [
|
|||
|
||||
result.then () ->
|
||||
# page render success
|
||||
element.canvas.replaceWith(canvas)
|
||||
canvas.removeClass('pdfng-rendering')
|
||||
page.getTextContent().then (textContent) ->
|
||||
textLayer.setTextContent textContent
|
||||
|
|
Loading…
Add table
Reference in a new issue