Upload files to ''

master
camilo 4 years ago
parent a6327efa92
commit 42996a9acd

@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
@ -16,7 +16,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 11,
"metadata": {},
"outputs": [
{
@ -31,7 +31,7 @@
" ['louisa-patch-update', 'number-patch', 'Camilo', 'kendalpatch']]"
]
},
"execution_count": 35,
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
@ -42,7 +42,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 12,
"metadata": {
"collapsed": true,
"jupyter": {
@ -1248,7 +1248,7 @@
" for linenumber in range(74):\n",
" for patch in row:\n",
" print(f\"line {linenumber} {patch}\")\n",
" line = open(f\"patterns/{patch}.txt\").readlines()[linenumber]\n",
" line = open(f\"patches/{patch}.txt\").readlines()[linenumber]\n",
" line = line.rstrip(\"\\n\")\n",
" print(line, file=output, end='')\n",
" print(file=output)\n",
@ -1257,17 +1257,27 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"from reportlab.pdfgen.canvas import Canvas\n",
"from reportlab.lib.pagesizes import A4,A0\n",
"from reportlab.lib.units import mm\n",
"from reportlab.pdfbase.ttfonts import TTFont, pdfmetrics\n",
"\n",
"pagewidth, pageheight = A0\n",
"\n",
"c = Canvas(\"quilt2.pdf\", pagesize=(pagewidth, pageheight), bottomup=0) \n",
"c.setFont('Courier', 12)\n",
"\n",
"\n",
"fontpath = \"fonts/mplus-1m-regular.ttf\"\n",
"font = TTFont('1mregular', fontpath)\n",
"pdfmetrics.registerFont(font)\n",
"\n",
"# To set a font in the PDF\n",
"c.setFont('1mregular', 14.4)\n",
"\n",
"start_y = 5*mm\n",
"y = start_y\n",
"lineheight = 4*mm\n",

Loading…
Cancel
Save