@@ -189,15 +189,21 @@ def layout_card(
189189 card_mnemonics = card_bottom .add_region_proportional (
190190 Region ( 'card-mnemonics' , x1 = 0 , y1 = 0 , x2 = 13 / 16 , y2 = 1 )
191191 )
192+
193+ # QR codes sqaare, and anchored to top and bottom of card.
192194 card_qr1 = card_bottom .add_region_proportional (
193195 Image ( 'card-qr1' , x1 = 13 / 16 , y1 = 0 , x2 = 1 , y2 = 1 / 2 )
194196 )
195- card_qr1 .y2 = card_qr1 .y1 + (card_qr1 .x2 - card_qr1 .x1 ) # make height same as width
197+ card_qr1_size = min ( card_qr1 .x2 - card_qr1 .x1 , card_qr1 .y2 - card_qr1 .y1 )
198+ card_qr1 .x1 = card_qr1 .x2 - card_qr1_size
199+ card_qr1 .y2 = card_qr1 .y1 + card_qr1_size
196200
197201 card_qr2 = card_bottom .add_region_proportional (
198202 Image ( 'card-qr2' , x1 = 13 / 16 , y1 = 1 / 2 , x2 = 1 , y2 = 1 )
199203 )
200- card_qr2 .y1 = card_qr2 .y2 - (card_qr2 .x2 - card_qr2 .x1 ) # make height same as width
204+ card_qr2_size = min ( card_qr2 .x2 - card_qr2 .x1 , card_qr2 .y2 - card_qr2 .y1 )
205+ card_qr2 .x1 = card_qr2 .x2 - card_qr2_size
206+ card_qr2 .y1 = card_qr2 .y2 - card_qr2_size
201207
202208 card_top .add_region_proportional (
203209 Text ( 'card-title' , x1 = 0 , y1 = 0 , x2 = 1 , y2 = 40 / 100 , bold = True )
@@ -266,6 +272,18 @@ def layout_wallet(
266272 Text ( f'crypto-b{ c_n } ' , x1 = 2 / 8 , y1 = - 1 / 16 , x2 = 7 / 8 , y2 = 7 / 16 , foreground = int ( COLOR [c_n ], 16 ), rotate = - 45 )
267273 )
268274
275+ # # The background rosette and cryptocurrency symbol in the center
276+ # public_center_size = min( public.x2 - public.x1, public.y2 - public.y1 )
277+ # public.add_region(
278+ # Image(
279+ # 'center-bg',
280+ # x1 = public.x1 + ( public.x2 - public.x1 ) / 2 - public_center_size / 2,
281+ # y1 = public.y1 + ( public.y2 - public.y1 ) / 2 - public_center_size / 2,
282+ # x2 = public.x1 + ( public.x2 - public.x1 ) / 2 + public_center_size / 2,
283+ # y2 = public.y1 + ( public.y2 - public.y1 ) / 2 + public_center_size / 2,
284+ # )
285+ # )
286+
269287 # Public addresses are vertical on left- and right-hand of public Region. In order to fit the
270288 # longer ETH addresses into a space with a fixed-width font, we know that the ratio of the width
271289 # to the height has to be about 1/20. Rotation is downward around upper-left corner; so,
@@ -510,7 +528,7 @@ def output_pdf(
510528 version = None ,
511529 error_correction = qrcode .constants .ERROR_CORRECT_M ,
512530 box_size = 10 ,
513- border = 0
531+ border = 1
514532 )
515533 qrc .add_data ( acct .address )
516534 qrc .make ( fit = True )
@@ -688,19 +706,21 @@ def write_pdfs(
688706 wall_tpl [f"crypto-b{ c_n } " ] = account .crypto
689707
690708 wall_tpl ['name-label' ] = "Wallet name:"
691- wall_tpl ['name-bg' ] = os .path .join ( images , '1x1-ffffff7f .png' )
709+ wall_tpl ['name-bg' ] = os .path .join ( images , '1x1-ffffff54 .png' )
692710 wall_tpl ['name' ] = name
693711
712+ # wall_tpl['center-bg'] = os.path.join( images, 'guilloche-center.png' )
713+
694714 public_qr = qrcode .QRCode (
695715 version = None ,
696716 error_correction = qrcode .constants .ERROR_CORRECT_M ,
697717 box_size = 10 ,
698718 border = 1 ,
699719 )
700720 public_qr .add_data ( account .address )
701- wall_tpl ['address-l-bg' ] = os .path .join ( images , '1x1-ffffff7f .png' )
721+ wall_tpl ['address-l-bg' ] = os .path .join ( images , '1x1-ffffff54 .png' )
702722 wall_tpl ['address-l' ] = account .address
703- wall_tpl ['address-r-bg' ] = os .path .join ( images , '1x1-ffffff7f .png' )
723+ wall_tpl ['address-r-bg' ] = os .path .join ( images , '1x1-ffffff54 .png' )
704724 wall_tpl ['address-r' ] = account .address
705725
706726 wall_tpl ['address-qr-t' ] = 'PUBLIC ADDRESS'
@@ -716,14 +736,14 @@ def write_pdfs(
716736 )
717737 private_qr .add_data ( private_enc )
718738
719- wall_tpl ['private-bg' ] = os .path .join ( images , '1x1-ffffff7f .png' )
739+ wall_tpl ['private-bg' ] = os .path .join ( images , '1x1-ffffff54 .png' )
720740
721741 # If not enough lines, will throw Exception, as it should! We don't want
722742 # to emit a Paper Wallet without the entire encrypted private key present.
723743 for ln ,line in enumerate ( chunker ( private_enc , 40 )):
724744 wall_tpl [f"private-{ ln } " ] = line
725745 wall_tpl ['private-hint-t' ] = 'PASSPHRASE HINT:'
726- wall_tpl ['private-hint-bg' ] = os .path .join ( images , '1x1-ffffff7f .png' )
746+ wall_tpl ['private-hint-bg' ] = os .path .join ( images , '1x1-ffffff54 .png' )
727747 wall_tpl ['private-hint' ] = wallet_pwd_hint
728748 wall_tpl ['private-qr-t' ] = 'PRIVATE KEY'
729749 wall_tpl ['private-qr' ] = private_qr .make_image ( back_color = "transparent" ).get_image ()
0 commit comments