473,569 Members | 2,584 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

universal unicode font for reportlab

I need to create multi lingual invoices from reportlab. I think it is
possible to use UTF 8 strings but there is a problem with the font. I
could not find any free TTF font that can do latin1, latin2, arabic,
chinese and other languages at the same time. Is there a single font
that is able to handle these languages? (Most of our invoices will be
for EN, FR, DE, HU, SK, CZ, RO but some of them needs to be in Chinese.)

Thanks,

Laszlo

Sep 8 '08 #1
16 8624
Laszlo Nagy <ga*****@shopze us.comwrites:
I could not find any free TTF font that can do latin1, latin2,
arabic, chinese and other languages at the same time. Is there a
single font that is able to handle these languages?
The GNU Unifont <URL:http://en.wikipedia.or g/wiki/GNU_Unifont>
<URL:http://unifoundry.com/unifont.htmlcov ers 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.

--
\ “Science doesn't work by vote and it doesn't work by |
`\ authority.” —Richard Dawkins, _Big Mistake_ (The Guardian, |
_o__) 2006-12-27) |
Ben Finney
Sep 8 '08 #2
Laszlo Nagy <ga*****@shopze us.comwrites:

>I could not find any free TTF font that can do latin1, latin2,
arabic, chinese and other languages at the same time. Is there a
single font that is able to handle these languages?

The GNU Unifont <URL:http://en.wikipedia.or g/wiki/GNU_Unifont>
<URL:http://unifoundry.com/unifont.htmlcov ers 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/vi.../langcover.txt
Thanks four your help!

L

Sep 8 '08 #3
>>
The GNU Unifont <URL:http://en.wikipedia.or g/wiki/GNU_Unifont>
<URL:http://unifoundry.com/unifont.htmlcov ers 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/vi.../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.tf f" 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
Sep 8 '08 #4
Iain Dalton wrote:
Why don't you want to use multiple typefaces? Many programs that deal
with multilingual strings use multiple fonts (cf. any Web browser and
Emacs).
You are right, but these PDF documents will show mixed strings. The end
user can enter arbitrary strings into the database, and they must be
presented. For example, the name of a product can be arabic or german.
It might be possible to guess the language used from the unicode string,
and then select a different font. But I don't want to go into that trouble.

It would be a great idea to use pango. Apparently pango is able to
change fonts on the fly and render the requested glyph. However, if I
use pango then I loose the much higher level of abstraction that comes
with reportlab and platypus: I need automatic page headers and footers,
I need to be able to repeat table headers on each page automatically
(when the table doesn't fit one page) etc. Developing my own "platypus"
like engine for pango and PDF rendering is a nightmare.

Better than that, I can develop my own flowable object for platypus: a
special paragraph that changes the used true type font on the fly.
(Split input string into parts, determine language for the parts and
display each part with its own font.) But of course this is a lot of
extra programming.

The simplest solution would be to use a font that is able to handle all
encodings that I need.

Thanks,

Laszlo

Sep 8 '08 #5
The simplest solution would be to use a font that is able to handle all
encodings that I need.
My OpenOffice on WinXP uses a unicode font, I believe Lucida Sans
Unicode, that seems to cover the entire BMP. I don't know whether it
was already installed or installed by OO or how one would get to it to
extract it.

Sep 8 '08 #6
Terry Reedy <tj*****@udel.e duwrote:
>My OpenOffice on WinXP uses a unicode font, I believe Lucida Sans
Unicode, that seems to cover the entire BMP.
Lucida Sans Unicode only covers a small subset of Unicode. It may seem
to cover a wider range because Windows (and possibly OpenOffice) will
automatically substitute characters from other fonts, if necessary.
>I don't know whether it was already installed or installed by OO or
how one would get to it to extract it.
It's a standard Windows font.

Ross Ridge

--
l/ // Ross Ridge -- The Great HTMU
[oo][oo] rr****@csclub.u waterloo.ca
-()-/()/ http://www.csclub.uwaterloo.ca/~rridge/
db //
Sep 9 '08 #7


Ross Ridge wrote:
Terry Reedy <tj*****@udel.e duwrote:
>My OpenOffice on WinXP uses a unicode font, I believe Lucida Sans
Unicode, that seems to cover the entire BMP.

Lucida Sans Unicode only covers a small subset of Unicode. It may seem
to cover a wider range because Windows (and possibly OpenOffice) will
automatically substitute characters from other fonts, if necessary.
Sorry, I posted the wrong name.
Ariel Unicode MS is the one that seems pretty complete.

>I don't know whether it was already installed or installed by OO or
how one would get to it to extract it.

It's a standard Windows font.
From the MS, I would guess that is a Windows font too ;-).

Sep 9 '08 #8
Terry Reedy <tj*****@udel.e duwrote:
>Sorry, I posted the wrong name.
Ariel Unicode MS is the one that seems pretty complete.
....
From the MS, I would guess that is a Windows font too ;-).
It's made by Microsoft, but it's not a standard Windows font. I think
it comes with Microsoft Office.

Ross Ridge

--
l/ // Ross Ridge -- The Great HTMU
[oo][oo] rr****@csclub.u waterloo.ca
-()-/()/ http://www.csclub.uwaterloo.ca/~rridge/
db //
Sep 9 '08 #9


Jeroen Ruigrok van der Werven wrote:
-On [20080909 05:23], Terry Reedy (tj*****@udel.e du) wrote:
>Ariel Unicode MS is the one that seems pretty complete.

Not really. It misses a lot of characters.
Well, it has Latin, Greek, Cyrillic, Hebrew, Arabic, several south
Asian, Tibetan, CJK, Japanese, Korean, and numerous symbols and special
forms. I don't know what it misses, but I think that covers what the OP
asked for.

Sep 9 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5293
by: Andreas Jung | last post by:
Reportlab has some problems with creating PDFs from UTF8 encoded text. For this reason they are using a truetype font rina.ttf which looks *very ugly*. Does anyone know of a suitable free available truetype font that works with UTF8? -aj
5
1438
by: John Roth | last post by:
I've got an interesting little problem that I can't find an answer to after hunting through the doc (2.3.3). I've got a string that contains something that kind of resembles an HTML document. On looking through it, I find a <meta http-equiv="content-type" content="text/html; charset=UTF-8"> tag. The problem is that I've got a normal string...
4
5362
by: Active8 | last post by:
I did this once and can't remember how <blush> so I read the reportlab user guid. It says to unzip the reportlab archive - this is on w2k, BTW, with Python23 - to a directory and make a file called reportlab.pth in the pythod dir. The only line in this file is supposed to be the path to the reportlib dir. Then I'm instructed to open the ......
1
2373
by: Joerg | last post by:
I am in the process of creating an international GUI application with C# on ..NET1.1 (Win2k), which is supposed to implement a particular look/design. In order to achieve this, I plan amongst others to define a certain font (MS Arial Unicode) for the user controls, and provide custom controls which have the font property fixed set to this...
1
2574
by: NevilleDNZ | last post by:
Hi, Apologies first as I am not a unicode expert.... indeed I the details probably totally elude me. Not withstanding: how can I convert a binary string containing UTF-8 binary into a python unicode string? cutdown example: $ cat ./uc.py #!/usr/bin/env python imported="\304\246\311\231\316\257\316\271\303\222
5
9552
by: =?Utf-8?B?S2V2aW4gVGFuZw==?= | last post by:
In MFC, CRichEditCtrl contrl, I want to set the codepage for the control to Unicode. I used the following method to set codepage for it (only for ANSI or BIG5, etc, not unicode). How should I change codepage to Unicode? Get the default character format. GetDefaultCharFormat(CHARFORMAT2& _cf)
2
4813
by: Jeffrey Walton | last post by:
Hi All, BMP Strings are a subset of Universal Strings.The BMP string uses approximately 65,000 code points from Universal String encoding. BMP Strings: ISO/IEC 10646, 2-octet canonical form, Universal String: ISO/ IEC 10646, 4-octet canonical form. An excellent discussion occured with respect to BMP Strings and .Net (see...
24
3354
by: Donn Ingle | last post by:
Hello, I hope someone can illuminate this situation for me. Here's the nutshell: 1. On start I call locale.setlocale(locale.LC_ALL,''), the getlocale. 2. If this returns "C" or anything without 'utf8' in it, then things start to go downhill: 2a. The app assumes unicode objects internally. i.e. Whenever there is
0
903
by: jonathon | last post by:
On Mon, Sep 8, 2008 at 01:51, Laszlo Nagy wrote: Use Code2000 http://www.code2000.net/ xan jonathon
0
7711
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main...
0
7628
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7938
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8145
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7694
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6317
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3679
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2128
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.