2) Justify Hebrew punctuation at the end of a paragraph by typing the RTL (Right-To-Left text) control mark at the end of your paragraph. To do so, type "CTRL-ALT 9" with your Hebrew keyboard.
3) Ensure proper diacritical positioning by following the common standard for keying Hebrew text with diactirics.
NOTE: some browsers still fail to correctly position diacritics. See the browser test results to see which ones are failing.
2) Convert your Unicode Hebrew font from its native format (e.g., TTF) to a number of webfont formats: EOT, WOFF, and SVG. To save you the trouble, I've converted the EzraSIL SR font for you to download.
3) Optional: create a "fonts" directory in your website to upload your fonts to.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
2) Create a font-family for your Unicode Hebrew font in your CSS with @font-face. This best practice was first published at Fontspring. (NOTE: in the example below, I've set a font directory in the root of my directory tree: /fonts/ .)
@font-face { font-family: 'Ezra SIL SR'; src: url('fonts/ezrasilsr-webfont.eot?#iefix') format('embedded-opentype'), url('fonts/ezrasilsr-webfont.woff') format('woff'), url('fonts/ezrasilsr-webfont.ttf') format('truetype'), url('fonts/ezrasilsr-webfont.svg#EzraSILSR') format('svg'); }3) Option 1: Create a class to display your Unicode Hebrew with your font-family in your CSS.
.ezra { font-family: 'Ezra SIL SR'; direction:rtl; text-align: right; }4) Option 2: if you will only be using one Hebrew font on your site, instead of making a CSS class for each Hebrew font, you can always tie the font to the lang attribute. In the example below, I've set all the known open source and Unicode Hebrew fonts supporting the full range of Hebrew diacritics.
:lang(he) { direction:rtl; font-family:'Ezra SIL SR', 'Taamey Frank CLM', 'Taamey David CLM', 'Keter YG', 'Keter Aram Sova', 'Ezra SIL', 'Cardo', serif; }
Here is an example when including text inline with English text:
Hello World, <span xml:lang="he" lang="he" class="ezra">שָׁלוֺם עוֺלָם</span>.
Hello World, שָׁלוֺם עוֺלָם.Here is an example for displaying Hebrew text all on its own:
<div class="ezra"><span xml:lang="he" lang="he">שָׁלוֺם עוֺלָם</span></div>
שָׁלוֺם עוֺלָם
You can make the Hebrew text larger by adding a font-size style:
<div class="ezra"><span style="font-size: x-large" xml:lang="he" lang="he">שָׁלוֺם עוֺלָם</span></div>
שָׁלוֺם עוֺלָם
Note below that the name of the font-family (Ezra SIL SR) is formatted slightly differently than the "font id" (EzraSILSR) in the url. This different reflects the name of the font-family and font id in the Ezra SIL SR svg file.
<style type="text/css"> <![CDATA[ @font-face { font-family: 'Ezra SIL SR'; font-weight: normal; font-style: normal; src: url("http://aharon.varady.net/browser-test/fonts/ezrasilsr-webfont.svg#EzraSILSR") format("svg") } ]]> </style>To see the source of the SVG file below, click here.
If the SVG rendered text above has diacritical mark positioning errors or isn't displaying the same way as the reference image below, it's because some browsers still fail to correctly position Hebrew diacritics in SVG files with CSS @font-face. See the browser test results to see which ones are failing.
HOME: Browser Tests
Please help to improve these tests. All source for this page that might be protected under copyright, is shared with a CC-BY-SA 3.0 Unported license.