* src/docgen/Makefile.am, src/docgen/Makefile.in: Ship LPRDoc.py.

* src/plugins/GraphViz.py (dump_index): Remove utf8 to latin
conversion. Switch to FreeSans.
* src/docgen/PdfDoc.py (draw_text, rotate_text): Fix encoding.


svn: r3024
This commit is contained in:
Alex Roitman 2004-03-17 01:50:50 +00:00
parent e96e59c3b2
commit d30ee3086f
4 changed files with 19 additions and 9 deletions

View File

@ -13,7 +13,8 @@ pkgpython_PYTHON = \
PdfDoc.py\ PdfDoc.py\
PSDrawDoc.py\ PSDrawDoc.py\
RTFDoc.py\ RTFDoc.py\
SvgDrawDoc.py SvgDrawDoc.py\
LPRDoc.py
pkgpyexecdir = @pkgpyexecdir@/docgen pkgpyexecdir = @pkgpyexecdir@/docgen
pkgpythondir = @pkgpythondir@/docgen pkgpythondir = @pkgpythondir@/docgen

View File

@ -118,7 +118,8 @@ pkgpython_PYTHON = \
PdfDoc.py\ PdfDoc.py\
PSDrawDoc.py\ PSDrawDoc.py\
RTFDoc.py\ RTFDoc.py\
SvgDrawDoc.py SvgDrawDoc.py\
LPRDoc.py
GRAMPS_PY_MODPATH = "../" GRAMPS_PY_MODPATH = "../"

View File

@ -454,13 +454,13 @@ class PdfDoc(BaseDoc.BaseDoc):
fc = make_color(font.get_color()) fc = make_color(font.get_color())
fnt = self.pdf_set_font(font) fnt = self.pdf_set_font(font)
if p.get_alignment() == BaseDoc.PARA_ALIGN_CENTER: if p.get_alignment() == BaseDoc.PARA_ALIGN_CENTER:
twidth = ((FontScale.string_width(font,str(text)))/2.0)*cm twidth = ((FontScale.string_width(font,enc(text)))/2.0)*cm
xcm = (stype.get_width() - x) - twidth xcm = (stype.get_width() - x) - twidth
else: else:
xcm = x * cm xcm = x * cm
s = reportlab.graphics.shapes.String(xcm, s = reportlab.graphics.shapes.String(xcm,
y-size, y-size,
str(text), enc(text),
strokeColor=sc, strokeColor=sc,
fillColor=fc, fillColor=fc,
fontName=fnt, fontName=fnt,
@ -493,7 +493,7 @@ class PdfDoc(BaseDoc.BaseDoc):
sc = make_color(font.get_color()) sc = make_color(font.get_color())
fc = make_color(font.get_color()) fc = make_color(font.get_color())
for line in text: for line in text:
s = reportlab.graphics.shapes.String(0,yval,str(line), s = reportlab.graphics.shapes.String(0,yval,enc(line),
fontName=fnt, fontName=fnt,
fontSize=size, fontSize=size,
strokeColor=sc, strokeColor=sc,

View File

@ -1,7 +1,7 @@
# #
# Gramps - a GTK+/GNOME based genealogy program # Gramps - a GTK+/GNOME based genealogy program
# #
# Copyright (C) 2000-2003 Donald N. Allingham # Copyright (C) 2000-2004 Donald N. Allingham
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -18,6 +18,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# #
# $Id$
"Generate files/Relationship graph" "Generate files/Relationship graph"
#------------------------------------------------------------------------ #------------------------------------------------------------------------
@ -64,6 +66,9 @@ _pagecount_map = {
_("Multiple") : _multiple, _("Multiple") : _multiple,
} }
_PS_FONT = 'Helvetica'
_TT_FONT = 'FreeSans'
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# #
# GraphVizDialog # GraphVizDialog
@ -150,12 +155,12 @@ class GraphVizDialog(Report.ReportDialog):
menu = gtk.Menu() menu = gtk.Menu()
menuitem = gtk.MenuItem(_("TrueType")) menuitem = gtk.MenuItem(_("TrueType"))
menuitem.set_data('t', 'Arial') menuitem.set_data('t', _TT_FONT)
menuitem.show() menuitem.show()
menu.append(menuitem) menu.append(menuitem)
menuitem = gtk.MenuItem(_("PostScript")) menuitem = gtk.MenuItem(_("PostScript"))
menuitem.set_data('t', 'Helvetica') menuitem.set_data('t', _PS_FONT)
menuitem.show() menuitem.show()
menu.append(menuitem) menu.append(menuitem)
@ -474,6 +479,9 @@ def dump_index(person_list,file,includedates,includeurl,colorize,
file.write('color=deeppink, ') file.write('color=deeppink, ')
else: else:
file.write('color=black, ') file.write('color=black, ')
if font == _TT_FONT:
file.write('fontname="%s", label="%s"];\n' % (font,label))
else:
file.write('fontname="%s", label="%s"];\n' % (font,utf8_to_latin(label))) file.write('fontname="%s", label="%s"];\n' % (font,utf8_to_latin(label)))
# Output families's nodes. # Output families's nodes.
if show_families: if show_families: