Font-face, Raphael and IE8

I am desesperatly trying to get some google font faces for working with Raphael (SVG / VML rendering JavaScript libraries) in IE8.

First I tried google font code.

My second attempt was to download and convert fonts to accommodate my more complete css. Fonts are now displayed in the html part of the page (inside the modified bootstrap nav drop-down list), but it does not work on the VML canvas (generated by Raphael).

An example is here:

http://beta.yetiprint.com/fr/etiquettes-autocollantes/4-etiquettes-couleur-ronde.html

Is it possible to get this working in iE8? Any clue?

+6
source share
2 answers

I can confirm that the ScottSs method works, but I could not enter these instructions in the comment field of my answers.

Instructions for creating custom fonts for working in Raphael using Cufรณn:

  • Go to the Cufรณn website where you can convert the font to path shapes.
  • Download your own font, select a font name and click on the Raphael icon in the "Configuring Third-Party Scripts" section.
  • Submit the form and upload the Javascript file that appears.
  • Include this Javascript under the Raphael Javascript Index.
  • Register the font with Raphael as follows: where fontname is the name of your font as specified in step 2: var myfont = paper.getFont('fontname');
  • Use your font like it is in Raphael: paper.print(100, 100, 'Hello World', myfont, 100);

Performance is not great compared to Paper.text , but it works in IE6 and higher.

+5
source

Have you tried the procedures in Raphael before registerFont() ? See http://raphaeljs.com/reference.html#Raphael.registerFont . This makes it possible to get a font in Raphael.

Based on the link on this page , you can get VML support and therefore IE8 functionality. At least theoretically; I never did this, I just found this information that seems to be pointing in the direction you want to go.

+3
source

Source: https://habr.com/ru/post/910982/


All Articles