Skip to content

Commit

Permalink
Fix lint, futureproof against actual italic fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
edemaine committed Jan 27, 2024
1 parent d9412f3 commit 7a644d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion client/RenderObjects.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import dom from './lib/dom'
import icons from './lib/icons'
import {scaleDash} from './tools/dash'
import {pointers} from './tools/modes'
import {tools} from './tools/defineTool'
import {anchorObjectTypes, anchorsOf, anchorRadius, anchorStroke} from './Anchor'
import {BBox, minSvgSize} from './BBox'
import {penArrowAverage, averageDirection} from './Collision'
Expand Down
5 changes: 3 additions & 2 deletions client/tools/download.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,15 @@ export makeSVGSync = ->
fonts.push 'tspan.emph { font-style: oblique }'
if (useBold = /<[^<>]*class=['"][^'"]*strong/.test svg)
fonts.push 'tspan.strong { font-weight: bold }'
if (useStrike = /<[^<>]*class=['"][^'"]*strike/.test svg)
fonts.push 'tspan.strike { text-decoration: line-through }'
#if (useStrike = /<[^<>]*class=['"][^'"]*strike/.test svg)
# fonts.push 'tspan.strike { text-decoration: line-through }'
for styleSheet in document.styleSheets
if /fonts/.test styleSheet.href
for rule in styleSheet.rules
font = rule.cssText
continue unless useMono or not /Roboto Mono/.test font
continue unless useBold or not /font-weight:\s*900/.test font
continue unless useItalic or not /font-style:\s*oblique/.test font
if (match = font.match /unicode-range:([^;}]*)/)?
regexp = match[1]
.replace /(u\+|-)([0-9a-f]{1,4})/ig, (m, prefix, hex) =>
Expand Down

0 comments on commit 7a644d3

Please sign in to comment.