The GNU Unifont <URL:http://en.wikipedia.org/wiki/GNU_Unifont>
<URL:http://unifoundry.com/unifont.html> covers an impressive range of
the Unicode Basic Multilingual Plane.
Unifont is originally a bitmap font, but was recently made available
in TrueType format
<URL:http://www.lgm.cl/trabajos/unifont/index.en.html>.
Both are available in Debian 'lenny'; the 'unifont' and 'ttf-unifont'
packages, respectively.
I found out that dejavu is what I need. It covers the languages I need
and more:
http://dejavu.svn.sourceforge.net/viewvc/dejavu/tags/version_2_26/dejavu-fonts/langcover.txt
Sorry, this did not work either. Dejavu does support cyrillic and greek
characters but I have to load a different ttf for that. They are no
unified. :-( The only one that worked so far was "unifont.tff" but it is
very ugly above point size=10.
Can you tell me what kind of font Geany is using on my Ubuntu system?
The preferences tells that it is "monospace" but when I load
VeraMono.ttf in reportlab, it will not even display latin2 characters.
In contrast, please look at this example that show my test program in Geany:
http://www.shopzeus.com/geany.jpg
It is a real scalable truetype font, displaying latin 1, latin2,
chinese, russian and japanese characters. Is it the same font? Does this
mean that reportlab is buggy? If I could load the same font that geany
uses, it would probably solve my problem forever.
Thanks,
Laszlo
# -*- coding: UTF-8 -*-
import os,sys
import copy
from reportlab.pdfgen import canvas
from reportlab.lib import pagesizes
# we know some glyphs are missing, suppress warnings
import reportlab.rl_config
reportlab.rl_config.warnOnMissingFontGlyphs = 0
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
#pdfmetrics.registerFont(TTFont('wpsu', 'vera/VeraMono.ttf '))
pdfmetrics.registerFont(TTFont('wpsu', 'VeraMono.ttf'))
xsize,ysize = PAGESIZE = pagesizes.A4
lines = [
"ÃRVÃZTŰRÅ TÃKÃRFÃRÃGÃP",
"éèªã®ãã¹ãã»ã©ã¼",
"ä¸å½çç½é¡µ",
"Ð¡Ð°Ð¹Ñ Ð² ÑазÑабоÑке",
]
c = canvas.Canvas('labels.pdf', pagesize=PAGESIZE)
for idx,line in enumerate(lines):
textobject = c.beginText()
textobject.setFont('wpsu',10)
textobject.setTextOrigin(100, 700 - 50*idx)
textobject.textLine(line)
c.drawText(textobject)
c.save()
if sys.platform=='win32':
os.system("labels.pdf")
else:
os.system("evince labels.pdf &")
--
http://mail.python.org/mailman/listinfo/python-list