[reportlab-users] reportlab-users Digest, Vol 193, Issue 6

JOURDAIN, Maël mael_jourdain at myria-am.com
Tue Dec 17 03:26:46 EST 2019


Hello,

Yes, the font "ArialUni.ttf" works to get the checked ballot box.

Thank you for your help.


  Maël JOURDAIN
Myria Asset Management
mael_jourdain at myria-am.com

Std. +33 1 40 69 65 17 - Ld. +33 1 40 69 65 18
32 avenue d'Iéna - 75783 Paris Cedex 16
www.myria-am.com
 
 

-----Message d'origine-----
De : reportlab-users [mailto:reportlab-users-bounces at lists2.reportlab.com] De la part de reportlab-users-request at lists2.reportlab.com
Envoyé : mardi 17 décembre 2019 07:39
À : reportlab-users at lists2.reportlab.com
Objet : reportlab-users Digest, Vol 193, Issue 6

Send reportlab-users mailing list submissions to
	reportlab-users at lists2.reportlab.com

To subscribe or unsubscribe via the World Wide Web, visit
	https://pairlist2.pair.net/mailman/listinfo/reportlab-users
or, via email, send a message with subject or body 'help' to
	reportlab-users-request at lists2.reportlab.com

You can reach the person managing the list at
	reportlab-users-owner at lists2.reportlab.com

When replying, please edit your Subject line so it is more specific than "Re: Contents of reportlab-users digest..."


Today's Topics:

   1. Re: reportlab-users Digest, Vol 193, Issue 5 (JOURDAIN)
   2. Re: reportlab-users Digest, Vol 193, Issue 5 (Tim Roberts)


----------------------------------------------------------------------

Message: 1
Date: Mon, 16 Dec 2019 15:37:58 +0000
From: JOURDAIN, Ma?l <mael_jourdain at myria-am.com>
To: "reportlab-users at lists2.reportlab.com"
	<reportlab-users at lists2.reportlab.com>
Subject: Re: [reportlab-users] reportlab-users Digest, Vol 193, Issue
	5
Message-ID:
	<VI1P194MB04625D402F52A8AD4BA16860A0510 at VI1P194MB0462.EURP194.PROD.OUTLOOK.COM>
	
Content-Type: text/plain; charset="iso-8859-1"

Hello,

When I run this code, trying with Arial and WINGDNG2. I don't get the expected results but white square.

Thank you for your help.


from reportlab.pdfgen.canvas import Canvas from reportlab.platypus import SimpleDocTemplate, Paragraph from reportlab.lib.styles import ParagraphStyle

from reportlab.lib.units import inch, mm from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.ttfonts import TTFont

pdfmetrics.registerFont(TTFont('wingdng', r'C:\Windows\Fonts\WINGDNG2.TTF'))
pdfmetrics.registerFont(TTFont('Arial', r'C:\Windows\Fonts\Arial.ttf'))


style_arial = ParagraphStyle(name = 'style_a', 
                    fontName='Arial',
                    fontSize=10,
                    leading=15,
                    #textColor = self.black_color,
                    #backColor = colors.Color(red=(228/255),green=(240/255),blue=(78/255)),
                    #alignment = TA_JUSTIFY,
                    wordWrap = None,
                    spaceAfter = 0*mm,
                    spaceBefore = 0*mm,
                    leftIndent = 15*mm,
                    bulletIndent = 10*mm,
                    bulletFontSize = 10,
                    bulletFontName = 'Arial',
                    #borderWidth = 0.25,
                    #borderColor =  self.black_color,
                    #top, left, bottom, right
                    #autoLeading = 'off',
                    )

style_wingdng = ParagraphStyle(name = 'style_w', 
                    fontName='Arial',
                    fontSize=10,
                    leading=15,
                    #textColor = self.black_color,
                    #backColor = colors.Color(red=(228/255),green=(240/255),blue=(78/255)),
                    #alignment = TA_JUSTIFY,
                    wordWrap = None,
                    spaceAfter = 0*mm,
                    spaceBefore = 0*mm,
                    leftIndent = 15*mm,
                    bulletIndent = 10*mm,
                    bulletFontSize = 10,
                    bulletFontName = 'wingdng',
                    #borderWidth = 0.25,
                    #borderColor =  self.black_color,
                    #top, left, bottom, right
                    #autoLeading = 'off',
                    )


# bullet points
bullet_1  ="""<bullet>\u2611</bullet> method one with Arial"""
bullet_2  = """<bullet>R</bullet> method two with WINGDNG2"""


#paragraph
para_1 = Paragraph(bullet_1  ,style_arial)
para_2 = Paragraph(bullet_2 ,style_wingdng)

#add paragraph to sory
story= []
story.append(para_1)
story.append(para_2)

#pdf creation
doc = SimpleDocTemplate("phello.pdf")
doc.build(story)
  Ma?l JOURDAIN
Myria Asset Management
mael_jourdain at myria-am.com

Std. +33 1 40 69 65 17 - Ld. +33 1 40 69 65 18
32 avenue d'Iéna - 75783 Paris Cedex 16 www.myria-am.com
 
 

-----Message d'origine-----
De?: reportlab-users [mailto:reportlab-users-bounces at lists2.reportlab.com] De la part de reportlab-users-request at lists2.reportlab.com
Envoy??: samedi 14 d?cembre 2019 07:39
??: reportlab-users at lists2.reportlab.com
Objet?: reportlab-users Digest, Vol 193, Issue 5

Send reportlab-users mailing list submissions to
	reportlab-users at lists2.reportlab.com

To subscribe or unsubscribe via the World Wide Web, visit
	https://pairlist2.pair.net/mailman/listinfo/reportlab-users
or, via email, send a message with subject or body 'help' to
	reportlab-users-request at lists2.reportlab.com

You can reach the person managing the list at
	reportlab-users-owner at lists2.reportlab.com

When replying, please edit your Subject line so it is more specific than "Re: Contents of reportlab-users digest..."


Today's Topics:

   1. Re: [BULK] reportlab-users Digest, Vol 193, Issue 4 (JOURDAIN)
   2. Re: bullet checkbox (Tim Roberts)
   3. Re: bullet checkbox (Robin Becker)


----------------------------------------------------------------------

Message: 1
Date: Fri, 13 Dec 2019 09:17:44 +0000
From: JOURDAIN, Ma?l <mael_jourdain at myria-am.com>
To: "reportlab-users at lists2.reportlab.com"
	<reportlab-users at lists2.reportlab.com>
Subject: Re: [reportlab-users] [BULK] reportlab-users Digest, Vol 193,
	Issue 4
Message-ID:
	<VI1P194MB04621BD2C8F893A69A8927A5A0540 at VI1P194MB0462.EURP194.PROD.OUTLOOK.COM>
	
Content-Type: text/plain; charset="iso-8859-1"

Hello,

Yes, It is a "checked ballot box".

I try to use Arial Font and Wingdings 2.

ttf = TTFont('wingdng', r'C:\Windows\Fonts\WINGDNG2.TTF')

pdfmetrics.registerFont(ttf)

But with Wingdings 2, the result is a white square.

How can I get the mark and not the white square ?
  Ma?l JOURDAIN
Myria Asset Management
mael_jourdain at myria-am.com

Std. +33 1 40 69 65 17 - Ld. +33 1 40 69 65 18
32 avenue d'Iéna - 75783 Paris Cedex 16 www.myria-am.com
 
 

-----Message d'origine-----
De?: reportlab-users [mailto:reportlab-users-bounces at lists2.reportlab.com] De la part de reportlab-users-request at lists2.reportlab.com
Envoy??: vendredi 13 d?cembre 2019 03:06
??: reportlab-users at lists2.reportlab.com
Objet?: [BULK] reportlab-users Digest, Vol 193, Issue 4

Send reportlab-users mailing list submissions to
	reportlab-users at lists2.reportlab.com

To subscribe or unsubscribe via the World Wide Web, visit
	https://pairlist2.pair.net/mailman/listinfo/reportlab-users
or, via email, send a message with subject or body 'help' to
	reportlab-users-request at lists2.reportlab.com

You can reach the person managing the list at
	reportlab-users-owner at lists2.reportlab.com

When replying, please edit your Subject line so it is more specific than "Re: Contents of reportlab-users digest..."


Today's Topics:

   1. bullet checkbox (JOURDAIN)
   2. Re: bullet checkbox (Tim Roberts)


----------------------------------------------------------------------

Message: 1
Date: Thu, 12 Dec 2019 13:55:42 +0000
From: JOURDAIN, Ma?l <mael_jourdain at myria-am.com>
To: "reportlab-users at lists2.reportlab.com"
	<reportlab-users at lists2.reportlab.com>
Subject: [reportlab-users] bullet checkbox
Message-ID:
	<VI1P194MB04626A322882C18BA6BB7504A0550 at VI1P194MB0462.EURP194.PROD.OUTLOOK.COM>
	
Content-Type: text/plain; charset="iso-8859-1"

Hello,

In a paragraph, I would like to have a checkbox bullet. But the result is a blackbox.

The code of the checkbox is the following '\u2611'.

How can I display properly the bullet checkbox ?

Thank you for your help.


  Ma?l JOURDAIN
Myria Asset Management
mael_jourdain at myria-am.com

Std. +33 1 40 69 65 17 - Ld. +33 1 40 69 65 18
32 avenue d'Iéna - 75783 Paris Cedex 16 www.myria-am.com
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20191212/e5ef564b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 9169 bytes
Desc: not available
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20191212/e5ef564b/attachment-0002.jpe>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 473 bytes
Desc: not available
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20191212/e5ef564b/attachment-0003.jpe>

------------------------------

Message: 2
Date: Thu, 12 Dec 2019 18:06:08 -0800
From: Tim Roberts <timr at probo.com>
To: reportlab-users <reportlab-users at lists2.reportlab.com>
Subject: Re: [reportlab-users] bullet checkbox
Message-ID: <d12b114b-5d4c-4920-a5f2-fd48ebc2f40f at probo.com>
Content-Type: text/plain; charset="windows-1252"; Format="flowed"

JOURDAIN, Ma?l wrote:
>
> In a paragraph, I would like to have a checkbox bullet. But the result 
> is a blackbox.
>
> The code of the checkbox is the following ?\u2611?.
>
> How can I display properly the bullet checkbox??
>
It's not a "bullet checkbox".? It's a "checked ballot box," as in a box you would find on a ballot.? The black box just means the font you chose doesn't include that character.? What font were you trying to use?

--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20191212/3e5e1dd1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3389 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20191212/3e5e1dd1/attachment.bin>

------------------------------

Subject: Digest Footer

_______________________________________________
reportlab-users mailing list
reportlab-users at lists2.reportlab.com
https://pairlist2.pair.net/mailman/listinfo/reportlab-users


------------------------------

End of reportlab-users Digest, Vol 193, Issue 4
***********************************************



------------------------------

Message: 2
Date: Fri, 13 Dec 2019 12:16:58 -0800
From: Tim Roberts <timr at probo.com>
To: reportlab-users <reportlab-users at lists2.reportlab.com>
Subject: Re: [reportlab-users] bullet checkbox
Message-ID: <80080adb-f590-ec96-a040-d1f46895db9b at probo.com>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

JOURDAIN, Ma?l wrote:
> I try to use Arial Font and Wingdings 2.
>
> ttf = TTFont('wingdng', r'C:\Windows\Fonts\WINGDNG2.TTF')
> pdfmetrics.registerFont(ttf)
>
> But with Wingdings 2, the result is a white square.

Right, because Wingdings 2 does not contain that character.? You can see that with the "charmap" application.? It does contain the "checked ballot box" glyph, but it's in the slot for the capital letter R.


> How can I get the mark and not the white square ?

There are two ways.? You can use "\u2611" in a font that contains that glyph, like Arial.? Or, you can use Wingdings 2 and use "R" instead.

--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3389 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20191213/880be6bf/attachment-0001.bin>

------------------------------

Message: 3
Date: Fri, 13 Dec 2019 21:34:57 +0000
From: Robin Becker <robin at reportlab.com>
To: reportlab-users <reportlab-users at lists2.reportlab.com>
Subject: Re: [reportlab-users] bullet checkbox
Message-ID:
	<CAOBYczpJHYUg7D1wc5vOBcVsfgtCTd4PtPKfiCwO0BDDMvmBPA at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Thanks for picking this up Tim. I'm stuck in compile technology trying to fix the impossible sandbox problem. happy Christmas to you and all the other open sourcerers :)


On Fri, 13 Dec 2019 at 20:17, Tim Roberts <timr at probo.com> wrote:

> JOURDAIN, Ma?l wrote:
> > I try to use Arial Font and Wingdings 2.
> >
> > ttf = TTFont('wingdng', r'C:\Windows\Fonts\WINGDNG2.TTF')
> > pdfmetrics.registerFont(ttf)
> >
> > But with Wingdings 2, the result is a white square.
>
> Right, because Wingdings 2 does not contain that character.  You can 
> see that with the "charmap" application.  It does contain the "checked 
> ballot box" glyph, but it's in the slot for the capital letter R.
>
>
> > How can I get the mark and not the white square ?
>
> There are two ways.  You can use "\u2611" in a font that contains that 
> glyph, like Arial.  Or, you can use Wingdings 2 and use "R" instead.
>
> --
> Tim Roberts, timr at probo.com
> Providenza & Boekelheide, Inc.
>
>
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at lists2.reportlab.com
> https://pairlist2.pair.net/mailman/listinfo/reportlab-users
>


--
Robin Becker
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20191213/37915b90/attachment-0001.html>

------------------------------

Subject: Digest Footer

_______________________________________________
reportlab-users mailing list
reportlab-users at lists2.reportlab.com
https://pairlist2.pair.net/mailman/listinfo/reportlab-users


------------------------------

End of reportlab-users Digest, Vol 193, Issue 5
***********************************************



------------------------------

Message: 2
Date: Mon, 16 Dec 2019 18:20:38 -0800
From: Tim Roberts <timr at probo.com>
To: reportlab-users <reportlab-users at lists2.reportlab.com>
Subject: Re: [reportlab-users] reportlab-users Digest, Vol 193, Issue
	5
Message-ID: <6aba0e26-541a-ede3-a7d5-b8a42ab5f659 at probo.com>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

JOURDAIN, Ma?l wrote:
> When I run this code, trying with Arial and WINGDNG2. I don't get the expected results but white square.

I'm not sure about why the WingDings 2 test didn't work.? It doesn't use Unicode mapping for its code points; perhaps that's the issue.

However, I think I told you that Arial does not contain the U+2611 character.? It's never going to work.? Check to see if you have the "Arial Unicode" font, "ArialUni.ttf".? It does contain that symbol, and when I add a registerFont and set the bulletFontName to that, it does work.

--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3389 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20191216/64902325/attachment-0001.bin>

------------------------------

Subject: Digest Footer

_______________________________________________
reportlab-users mailing list
reportlab-users at lists2.reportlab.com
https://pairlist2.pair.net/mailman/listinfo/reportlab-users


------------------------------

End of reportlab-users Digest, Vol 193, Issue 6
***********************************************



More information about the reportlab-users mailing list