Getting extended Western characters working is not too difficult as you can embed most of them in the sIFR SWF without increasing the size of the SWF too much. The current size of my GillSans SWF currently on the site is 32KB and includes the following character sets from Flash (note that some of these contain overlaps):
- Uppercase
- Lowercase
- Numerals
- Punctuation
- Basic Latin
- Latin I
- Latin Extended A
- Latin Extended B
- Greek
- Cyrillic
- Armenian
Embedding fonts for other sets such as Hebrew, however, balloons the size of the SWF to unacceptable sizes.
The workaround I implemented was to use content negotiation to switch sIFR off for various languages. The code (which you can put inside your request handler or in a decorator or middleware method):
use_sifr = True if 'HTTP_ACCEPT_LANGUAGE' in request.META: language = request.META['HTTP_ACCEPT_LANGUAGE'] remove_sifr_for = ('ar', 'zh', 'he', 'ja', 'el', 'ko', 'pa', 'th') for lang_test in remove_sifr_for: if lang_test in language: use_sifr = False context['use_sifr'] = use_sifr
Then, based on the setting of the use_sifr template variable, I conditionally include the JS for sIFR:
{% if use_sifr %}
<script type="text/javascript" src="/js/sifr.js"></script>
<script type="text/javascript" src="/js/sifr-config.js"></script>
{% endif %}
You can easily test this out in Firefox through the Preferences panel (⌘ ,) → General → Languages → Choose... and adding one of the languages for which sIFR is switched off (such as Chinese).
The Conditionally displaying sIFR text for different languages using content negotiation with Django article by Aral Balkan, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial 2.0 UK: England License.

Add Your Comment