I want to create a quiz web application using django where the quiz question will be in Bengali. How can i generate the bengali font in my desired site. Please if anyone tell me .. i will be grateful to him
Asked
Active
Viewed 1,351 times
2
-
What do you mean by `generate`? You want to just use some ready-to-go TTF font do you want to do it programatically? – bx2 Oct 04 '10 at 11:33
-
I am having some problem showing bangla texts in html pages from django template.I have included utf-8 and still it's not working.Shed some light? – Sihat Afnan Jul 15 '20 at 16:49
1 Answers
1
Django is not involved in font rendering on the browser. Embedding a particular font via CSS is still problematical until today. You may find answers at How to embed fonts in HTML?.
In Django, you specify only the character codes. You may have to use unicode escape sequences in strings, unless you can enter Bengali characters directly. Bengali characters reside in the unicode range U+0981 to U+09FA. I assume that your target audience will have glyphs installed for those characters, so there may be no need to provide an embedded font at all.
You can use the following script to display a list of the defined Bengali unicode characters.
import sys
import unicodedata as ucd
try:
chr = unichr
except NameError:
# Python 3
unicode = str
def filter_bengali():
for i in range(256, sys.maxunicode + 1):
try:
name = ucd.name(chr(i))
if 'BENGALI' in name:
print(unicode('U+{0:04X} {1:<60} {2}').format(i, name, chr(i)))
except ValueError:
pass
if __name__ == '__main__':
filter_bengali()

Community
- 1
- 1

Bernd Petersohn
- 2,234
- 1
- 15
- 7