-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
work around Safari bug when gradientTransform contains involutory matrix
Fixes #268 Safari currently rejects a gradient if gradientTransform attribute contains a matrix whose inverse is equal to itself (aka 'involutory matrix'). These are perfectly valid, non-singular invertible transformations which happen to have an inverse which is equal to themselves (notably, reflection across x/y axis). Safari assumes they are non-invertible and incorrectly rejects the whole gradient. The recommendation from the WebKit maintainer is to hack the matrix by a small, invisible amount enough to trick Safari. I heard this bug has already been fixed internally but will take time until it reaches all users. Until then, we have no choice but doing this.
- Loading branch information
1 parent
a7cb5a5
commit 65c2d1d
Showing
4 changed files
with
90 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ttFont sfntVersion="\x00\x01\x00\x00"> | ||
|
||
<GlyphOrder> | ||
<!-- The 'id' attribute is only for humans; it is ignored when parsed. --> | ||
<GlyphID id="0" name=".notdef"/> | ||
<GlyphID id="1" name=".space"/> | ||
<GlyphID id="2" name="e000"/> | ||
</GlyphOrder> | ||
|
||
<hmtx> | ||
<mtx name=".notdef" width="0" lsb="0"/> | ||
<mtx name=".space" width="100" lsb="0"/> | ||
<mtx name="e000" width="100" lsb="0"/> | ||
</hmtx> | ||
|
||
<cmap> | ||
<tableVersion version="0"/> | ||
<cmap_format_4 platformID="0" platEncID="3" language="0"> | ||
<map code="0x20" name=".space"/><!-- SPACE --> | ||
<map code="0xe000" name="e000"/><!-- ???? --> | ||
</cmap_format_4> | ||
<cmap_format_4 platformID="3" platEncID="1" language="0"> | ||
<map code="0x20" name=".space"/><!-- SPACE --> | ||
<map code="0xe000" name="e000"/><!-- ???? --> | ||
</cmap_format_4> | ||
</cmap> | ||
|
||
<loca> | ||
<!-- The 'loca' table will be calculated by the compiler --> | ||
</loca> | ||
|
||
<glyf> | ||
|
||
<!-- The xMin, yMin, xMax and yMax values | ||
will be recalculated by the compiler. --> | ||
|
||
<TTGlyph name=".notdef"/><!-- contains no outline data --> | ||
|
||
<TTGlyph name=".space"/><!-- contains no outline data --> | ||
|
||
<TTGlyph name="e000"/><!-- contains no outline data --> | ||
|
||
</glyf> | ||
|
||
<SVG> | ||
|
||
<svgDoc endGlyphID="2" startGlyphID="2"> | ||
<![CDATA[<svg xmlns="http://www.w3.org/2000/svg" version="1.1"><defs><radialGradient id="g1" fx="-32" fy="32" cx="-64" cy="64" r="64" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-0.99999 0 0 1 0 0)"><stop offset="0" stop-color="red"/><stop offset="1" stop-color="blue"/></radialGradient></defs><g id="glyph2" transform="matrix(0.781 0 0 0.781 0 -100)"><path d="M0,0 H128 V128 H0 V0 Z" fill="url(#g1)"/></g></svg>]]> | ||
</svgDoc> | ||
</SVG> | ||
|
||
</ttFont> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters