[reportlab-users] Fonts

Andy Robinson reportlab-users@reportlab.com
Fri, 16 Jan 2004 17:09:04 -0000


This is a multi-part message in MIME format.

------=_NextPart_000_0091_01C3DC53.71B72490
Content-Type: text/plain;
	charset="koi8-r"
Content-Transfer-Encoding: 8bit

Para is a new experimental implementation by Aaron Watters. He was
not considering encodings when working on it and it would need to
be fixed up.  Nobody has yet got around to merging these two
implementations,
I'm sorry.

As far as I am concerned, UL and OL should never be part of
a paragraph; I think HTML got this wrong, and numerous people
writing formatters complain about this.  They are 'block level' constructs.
You will need a slightly smarter parser which sees the <ul> or <ol> and
ends the current paragraph; then creates an indent token; then outputs
a para with a 'bullet' style for each list item.

If you do manage to write a HTML-to-PDF converter than handles a useful
subset of HTML, we'd love to see a contribution though....

Thanks,

Andy Robinson
  -----Original Message-----
  From: reportlab-users-admin@reportlab.com
[mailto:reportlab-users-admin@reportlab.com]On Behalf Of Porsev Eugene
  Sent: 16 January 2004 12:31
  To: reportlab-users@reportlab.com
  Subject: [reportlab-users] Fonts


  Hello, I'm new to Reportlab - so don't be very strict to me.

  I'm trying to convert quite simple HTML into PDF using Paragraph and Para
and I have problems
  with cyrillic fonts. After I register it by:

  registerFont(TTFont('Courier','cour.ttf'))
  registerFont(TTFont('Courier-Oblique','couri.ttf'))
  registerFont(TTFont('Courier-Bold','courbd.ttf'))
  registerFont(TTFont('Courier-BoldOblique','courbi.ttf'))

  the Paragraph works properly, but when I use Para the document becomes a
mess.

  Or tell me how can I make tags <ul> <ol> to be parsed using Paragraph.

  Thanks in advance.
  ______________________________________________
  С уважением, Порсев Евгений
  компания NAUMEN
  eporsev@naumen.ru

------=_NextPart_000_0091_01C3DC53.71B72490
Content-Type: text/html;
	charset="koi8-r"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dkoi8-r">
<META content=3D"MSHTML 6.00.2800.1276" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><SPAN class=3D986110317-16012004><FONT face=3DArial color=3D#0000ff =
size=3D2>Para=20
is a new experimental implementation by Aaron Watters. He=20
was</FONT></SPAN></DIV>
<DIV><SPAN class=3D986110317-16012004><FONT face=3DArial color=3D#0000ff =
size=3D2>not=20
considering encodings when working on it and it would need=20
to</FONT></SPAN></DIV>
<DIV><SPAN class=3D986110317-16012004><FONT face=3DArial color=3D#0000ff =
size=3D2>be=20
fixed up.&nbsp; Nobody has yet got around to merging these two=20
implementations,</FONT></SPAN></DIV>
<DIV><SPAN class=3D986110317-16012004><FONT face=3DArial color=3D#0000ff =
size=3D2>I'm=20
sorry.</FONT></SPAN></DIV>
<DIV><SPAN class=3D986110317-16012004><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D986110317-16012004><FONT face=3DArial color=3D#0000ff =
size=3D2>As far=20
as I am concerned, UL and OL should never be part of</FONT></SPAN></DIV>
<DIV><SPAN class=3D986110317-16012004><FONT face=3DArial color=3D#0000ff =
size=3D2>a=20
paragraph; I think HTML got this wrong, and numerous =
people</FONT></SPAN></DIV>
<DIV><SPAN class=3D986110317-16012004><FONT face=3DArial color=3D#0000ff =

size=3D2>writing formatters complain about this.&nbsp; =
</FONT></SPAN><SPAN=20
class=3D986110317-16012004><FONT face=3DArial color=3D#0000ff =
size=3D2>They are 'block=20
level' constructs</FONT></SPAN><FONT face=3DArial><FONT size=3D2><FONT=20
color=3D#0000ff><SPAN class=3D986110317-16012004><FONT>.&nbsp;=20
</FONT></SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=3DArial><FONT size=3D2><FONT color=3D#0000ff><SPAN=20
class=3D986110317-16012004>You will need a slightly smarter parser which =
sees the=20
&lt;ul&gt; or &lt;ol&gt; and</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=3DArial><FONT size=3D2><FONT color=3D#0000ff><SPAN=20
class=3D986110317-16012004>ends the current paragraph; then creates an =
indent=20
token; then outputs</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=3DArial><FONT size=3D2><FONT color=3D#0000ff><SPAN=20
class=3D986110317-16012004>a para with a 'bullet' style for each list=20
item.</SPAN></FONT></FONT></FONT></DIV>
<DIV><SPAN class=3D986110317-16012004><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D986110317-16012004><FONT face=3DArial color=3D#0000ff =
size=3D2>If you=20
do manage to write a HTML-to-PDF converter than handles a=20
useful</FONT></SPAN></DIV>
<DIV><SPAN class=3D986110317-16012004><FONT face=3DArial color=3D#0000ff =
size=3D2>subset=20
of HTML, we'd love to see a contribution though....</FONT></SPAN></DIV>
<DIV><SPAN class=3D986110317-16012004><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D986110317-16012004><FONT face=3DArial color=3D#0000ff =

size=3D2>Thanks,</FONT></SPAN></DIV>
<DIV><SPAN class=3D986110317-16012004><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D986110317-16012004><FONT face=3DArial color=3D#0000ff =
size=3D2>Andy=20
Robinson</FONT></SPAN></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px =
solid; MARGIN-RIGHT: 0px">
  <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
  size=3D2>-----Original Message-----<BR><B>From:</B>=20
  reportlab-users-admin@reportlab.com=20
  [mailto:reportlab-users-admin@reportlab.com]<B>On Behalf Of </B>Porsev =

  Eugene<BR><B>Sent:</B> 16 January 2004 12:31<BR><B>To:</B>=20
  reportlab-users@reportlab.com<BR><B>Subject:</B> [reportlab-users]=20
  Fonts<BR><BR></FONT></DIV>
  <DIV>
  <DIV><FONT face=3DArial size=3D2>Hello, I'm new to Reportlab - so =
don't be very=20
  strict to me.</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>I'm trying to convert quite simple =
HTML into PDF=20
  using Paragraph and Para and I have problems </FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>with cyrillic fonts. After I register =
it=20
  by:</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial=20
  =
size=3D2>registerFont(TTFont('Courier','cour.ttf'))<BR>registerFont(TTFon=
t('Courier-Oblique','couri.ttf'))<BR>registerFont(TTFont('Courier-Bold','=
courbd.ttf'))<BR>registerFont(TTFont('Courier-BoldOblique','courbi.ttf'))=
</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>the Paragraph works properly, but =
when I use Para=20
  the document becomes a mess.</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>Or tell me how can I make tags=20
  &lt;ul&gt;&nbsp;&lt;ol&gt; to be parsed&nbsp;using =
Paragraph.</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>Thanks in advance.</FONT></DIV></DIV>
  <DIV><FONT face=3DArial=20
  size=3D2>______________________________________________<BR>=F3 =
=D5=D7=C1=D6=C5=CE=C9=C5=CD, =F0=CF=D2=D3=C5=D7=20
  =E5=D7=C7=C5=CE=C9=CA<BR>=CB=CF=CD=D0=C1=CE=C9=D1 NAUMEN<BR><A=20
  =
href=3D"mailto:eporsev@naumen.ru">eporsev@naumen.ru</A></FONT></DIV></BLO=
CKQUOTE></BODY></HTML>

------=_NextPart_000_0091_01C3DC53.71B72490--