Permalink
Browse files

Fixed #282 at the expense of ancient Opera 9.2 compatibility.

  • Loading branch information...
sorccu committed Apr 30, 2017
1 parent 94db085 commit d07bf2a01e6bff8905f1c81649ee725a70c5ab6d
Showing with 50 additions and 4 deletions.
  1. +43 −0 examples/basic.html
  2. +7 −4 js/cufon.js
View
@@ -0,0 +1,43 @@
+<!doctype html>
+
+<html>
+
+ <head>
+
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+ <title>cufón / examples / basic</title>
+
+ <style type="text/css">
+
+ body {
+ background: #fff;
+ color: #555;
+ }
+
+ h1 {
+ font: normal 60px Arial, Verdana, Helvetica, sans-serif;
+ margin: 0.8em 0 0 0;
+ text-align: center;
+ }
+
+ </style>
+
+ <script src="../js/cufon.js" type="text/javascript"></script>
+ <script src="../fonts/Vegur.font.js" type="text/javascript"></script>
+
+ <script type="text/javascript">
+
+ Cufon.replace('h1');
+
+ </script>
+
+ </head>
+
+ <body>
+
+ <h1>The quick brown fox jumped over the lazy dog</h1>
+
+ </body>
+
+</html>
View
@@ -1456,10 +1456,13 @@ Cufon.registerEngine('canvas', (function() {
if (!glyph) continue;
if (glyph.d) {
g.beginPath();
- // the following moveTo is for Opera 9.2. if we don't
- // do this, it won't forget the previous path which
- // results in garbled text.
- g.moveTo(0, 0);
+ // the following moveTo was for Opera 9.2. if we didn't
+ // do this, it wouldn't forget the previous path which
+ // resulted in garbled text. this had to be removed in
+ // 2017 due to WebKit-based browsers stretching certain
+ // fully rectangular characters when this line is present.
+ // presumably this breaks compatibility with Opera 9.2.
+ // g.moveTo(0, 0);
if (glyph.code) interpret(glyph.code, g);
else glyph.code = generateFromVML('m' + glyph.d, g);
g.fill();

0 comments on commit d07bf2a

Please sign in to comment.