hjh327 / canvas-text

Automatically exported from code.google.com/p/canvas-text
MIT License
0 stars 0 forks source link

Font selection seems to be hit-and-miss - mismatches between browsers. #4

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. View the "Transformations" demo in Firefox
2. View the "Transformations" demo in Internet Explorer 6 or 7 (possibly 8
too - but as yet untested)
3. Note mismatch between typefaces.

What is the expected output? What do you see instead?

In Firefox (3.0.14) the "Vertical and Stroke" portion of the demo is being
rendered in what appears to be Times New Roman, despite all the fonts
specified in the document being sans-serif.
In IE the whole demo appears sans-serif but the fonts are rendered at
subtly different sizes from FF - and the "Vertical and Stroke" portion
spills off the bottom of the canvas.

What version of the product are you using? On what operating system?

This happens with the live demos as of today (2009-10-03).

Please provide any additional information below.

Attached is a screenshot of the canvas from FF and IE showing the mismatch
between them.  This happens with other demos too - the animation example
correctly sets the typeface in FF but not in IE.

Original issue reported on code.google.com by robinso...@gmail.com on 3 Oct 2009 at 11:08

Attachments:

GoogleCodeExporter commented 8 years ago
I think this is due to a bad alternative font lookup. I fixed a few bugs 
related to 
this in the latest release. Could you confirm this works better ?
I also added "sans-serif" to the font style of the "Transformations" example in 
order 
to use sans-serif fonts instead of serif ones when the one given is not 
available 
(which seems to be your case).

Original comment by fabien.menager on 18 Oct 2009 at 8:07

GoogleCodeExporter commented 8 years ago
Ok, I found the problem : 
Try this (with IE7 or IE8 in IE7 mode or else it won't work) : 
http://samples.msdn.microsoft.com/workshop/samples/vml/shape/textpath/y_textpath
.htm

Click on "Weight" : the font seems to be totally random ! This is definitely a 
bug in 
the VML implementation.

You can workaround this by adding "?reimplement=true" to the canvas.text.js 
path : 

<script type="text/javascript" 
src="../canvas.text.js?reimplement=true"></script>

And include the font faces files you want to use. This will use the text 
drawing 
methods of canvas.text.js, not the ones of the browser (or the ones of 
ExCanvas.js 
for IE).

Original comment by fabien.menager on 19 Oct 2009 at 12:51