On 1/26/12 3:48 AM, islam abofarha wrote:
> Hi everyone,

Hi and welcome.

> i'm comming from gambas and visual basic programming .i built an ERP
> software to manage pharmacies using gambas but i faced alot of bugs
> and errors beside it's for linux only not for Windows OS .so i am
> shifting to python and i i found dabo ...

I don't have any gambas or Visual Basic experience, but I have used Microsoft 
tools 
before (Visual FoxPro).

> when installation on my Ubuntu an error arise bout translation
> missing..as i am in Egypt.My main language is arabic....

Any chance you could post the traceback in its entirety? We'd like to fail as 
gracefully as possible when a given translation isn't yet available.

> i figured out the problem in the absence of ar Folder so i created one
> and added the en LC file in it.
>
> Then i tried adding arabic labels which worked when adding utf-8
> comment at the top of the file..

Good!

> the problem when i tried the Report Designer arabic text becomes
> squres when previewed...i think it's from ReportLab ...

It is because by default reportlab (and dabo report designer) uses Type 1 
Times, 
Helvetica, and Courier fonts. These fonts don't have very many special 
characters 
defined at all, so they are only really useful as default fonts for American 
English 
countries.

You'll have to find a TrueType font or fonts that support the characters you 
want to 
print, put them in your app's resources/ directory, and tell reportlab about 
them.

Add a 'registerFonts.py' script in your application's home directory, with 
these 
contents:

{{{
import os
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont

def registerFonts(homedir):
   for fname in os.listdir(os.path.join(homedir, "resources")):
     name, ext = os.path.splitext(fname)
     if ext == ".ttf":
       #print "registering %s..." % name
       pdfmetrics.registerFont(TTFont(name, os.path.join(homedir, "resources", 
fname)))

}}}

And somewhere in the initialization of your application (main.py file or dApp 
subclass, for instance) make the call:

{{{
from registerFonts import registerFonts
registerFonts(app.HomeDirectory)
}}}

And now, in your reports, modify Reports.Defaults.FontName to be the name of 
the true 
type font you want your objects to use by default. Or, modify each string 
object 
individually.

> is there a chance to make arabic supported in the reports.....?

I don't know which freely-available truetype fonts support arabic (I use the 
DejaVu 
fonts) and I also don't know how to tell you to deal with right-to-left 
presentation 
of the characters. But I hope this at least gets you started.

Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to