Compare commits
10 commits
5230ad74d8
...
2761c0be90
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2761c0be90 | ||
|
|
905ab60248 | ||
|
|
8e7f0c232f | ||
|
|
12835e1c82 | ||
|
|
a6685df77f | ||
|
|
521c8fbdf6 | ||
|
|
357e76cb13 | ||
|
|
9b9ba78bcb | ||
|
|
5a45aed544 | ||
|
|
f4d133c1d0 |
181
README.md
|
|
@ -15,30 +15,108 @@ unzip zinme_maker.zip -d /home/user/destination
|
|||
|
||||
## OR use git clone:
|
||||
```
|
||||
git clone https://zine-push:glpat-zHtx4dd5xgmdMHRGA-t6@git.systerserver.net/mara/zine_maker.git
|
||||
git clone https://developer:glpat-38qN45wE_xLiNv1q4n5F@git.systerserver.net/mara/zine_maker.git
|
||||
cd zine_maker
|
||||
```
|
||||
|
||||
# Requirements
|
||||
|
||||
Basic requirements are listed here.
|
||||
Python3 should be installed on the computer
|
||||
https://www.python.org/downloads/
|
||||
|
||||
And also the pip command if it didn't get installed with Python
|
||||
- Terminal
|
||||
- for MacOS and Linux, it comes together with the system, we can find the application by searching for terminal
|
||||
- for Windows 10 and 11 follow the steps here (can you find a howto in Korean?)
|
||||
- command line tool pdftk
|
||||
- for MacOS we can download it from https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_server-2.02-mac_osx-10.11-setup.pkg
|
||||
- for Linux we can install with sudo apt install poppler-utils
|
||||
- for windows we can download it from https://pdftk.en.softonic.com/?ex=RAMP-1768.1
|
||||
- Python3 should be installed in the computer
|
||||
Check by opening the terminal and run `python -i`
|
||||
- And also the pip command if it didn't get installed with Python
|
||||
https://pip.pypa.io/en/stable/installation/
|
||||
- On macOS, ImageMagick needs to be installed. If using MacPorts, then use the ImageMagic7 port and then change the path to include the bin subdirectory as per the MacPorts’ note.
|
||||
- To use pdfunite on macOS, one can download Poppler (there is a port for it in MacPorts)
|
||||
|
||||
Once these are installed, from within zine_maker folder run:
|
||||
|
||||
`pip install -r requirements.txt`
|
||||
|
||||
## Language
|
||||
for non latin languages, you need to add language specific fonts in the `fonts` folder. At the moment there are Chinese and Korean fonts.
|
||||
|
||||
## Images
|
||||
For making use of images in the script
|
||||
image magick needs to be installed
|
||||
http://www.imagemagick.org/
|
||||
|
||||
# Run the code!
|
||||
|
||||
## Parameters
|
||||
The python scripts `cover.py`, `body.py` and `colophon.py` take a text file as input, and a path for the output. If we give no input and not output, the default input comes from the files under the `input` folder and is saved in the output folder as cover.pdf, body.pdf and colophon.pdf respectively.
|
||||
|
||||
## Make the zine in 3 steps
|
||||
1. Generate a cover pdf
|
||||
from the root of the folder run:
|
||||
`python cover.py`
|
||||
|
||||
2. Generate the body (the content) pdf
|
||||
from the root of the folder run:
|
||||
`python body.py`
|
||||
|
||||
3. Generate the colophon (the back cover) pdf
|
||||
from the root of the folder run:
|
||||
`python colophon.py`
|
||||
|
||||
The pdf documents are saved in the `output` folder.
|
||||
|
||||
To make your own zine modify the text files for the cover, for the body and for the colophon in the input folder.
|
||||
Or provide your own files with the full pathname:
|
||||
for example run:
|
||||
`python body.py <path>/<your-input-file>.txt <path>/<your-output-file>.pdf`
|
||||
|
||||
## Add images in the zine
|
||||
You need to add in your input text file the path of your image.
|
||||
For example if you add images in the `image` folder you can add them in the `input/body.txt` as `/images/<image-filename>.jpg<img>. You can also give the full path of your system font.
|
||||
See the `input/images.txt` as an example of how to add images in your content.
|
||||
|
||||
## Final PDF
|
||||
For merging the cover, body and colophon pdf files, there are many pdf merger tools. One that is command line based and is used in this tutorial is pdfunite
|
||||
http://linux-commands-examples.com/pdfunite
|
||||
|
||||
from the root directory run:
|
||||
```
|
||||
pdfunite input/cover.pdf input/body.pdf input/colophon.pdf output/final.pdf
|
||||
```
|
||||
You shall substitute the file paths to your own corresponding /path/filenames
|
||||
|
||||
## See this readme as the generated pdf zine:
|
||||
open the file `output/zinemaker.pdf`
|
||||
|
||||
# Print
|
||||
For preparing the final pdf for printing you need the pdfseparate command
|
||||
http://www.linux-commands-examples.com/pdfseparate
|
||||
|
||||
Run from the root directory:
|
||||
```
|
||||
python book.py `output/final.pdf` `output/print_final.pdf`
|
||||
```
|
||||
|
||||
## Prepare pages for printing
|
||||

|
||||
|
||||
In the printer settings opt-in for the following settings:
|
||||
```
|
||||
- A4 Landscape
|
||||
- Two pages per side
|
||||
- Double side - short edge
|
||||
```
|
||||
|
||||
# Miscellaneous
|
||||
|
||||
## Fonts
|
||||
The source code comes with some fonts under the fonts folder. You can use your
|
||||
fonts of preference by adding them either in the fonts folder and edit the
|
||||
files cover.py, colophon.py and doc_pdf.py to give the new names. Or add your
|
||||
absolute font path directly to the python scripts.
|
||||
files cover.py, colophon.py and body.py to give the new names. Or add your
|
||||
absolute font path directly in the python scripts.
|
||||
|
||||
## Text
|
||||
The input texts should be clean from characters added by some text editors or
|
||||
|
|
@ -60,89 +138,6 @@ https://www.cyberciti.biz/faq/sed-remove-m-and-line-feeds-under-unix-linux-bsd-a
|
|||
## Layout
|
||||
All the font styling happens in the zine_maker function create_pages(). The
|
||||
input text is parsed for specific tags or symbols in the begining of each line
|
||||
and changes to the font color and size happen accordingly. We can add more or edit
|
||||
existing rules, directly in the zine_maker code.
|
||||
|
||||
## Parameters
|
||||
The python scripts cover.py, colophon.py and doc_pdf.py take a text input and an output filename. If we give no input/output, the default input is the related readme files under covers/body/colophons/
|
||||
|
||||
## Merge
|
||||
For merging the cover, body and colophon pdf files, there are many pdf merger tools. One that is command line based and is used in this tutorial is pdfunite
|
||||
http://linux-commands-examples.com/pdfunite
|
||||
|
||||
## Print
|
||||
For shuffling the final pdf and prepare it for printing you need the pdfseparate command
|
||||
http://www.linux-commands-examples.com/pdfseparate
|
||||
it is used inside the shuffle_pdf.py file (see details at the end of this README).
|
||||
|
||||
## Images
|
||||
For making use of images in the script
|
||||
image magick needs to be installed
|
||||
http://www.imagemagick.org/
|
||||
|
||||
# Run the code!
|
||||
|
||||
## Make the content of the pdf
|
||||
The default parameters included in the script would create a zine from this
|
||||
readme:
|
||||
`python doc_pdf.py `
|
||||
|
||||
OR you can experiment with the other sample text found in this repository.
|
||||
|
||||
`python doc_pdf.py text/images.txt body/images.pdf`
|
||||
|
||||
OR get real and add your own text file and replace respectively the input and
|
||||
output filenames.
|
||||
|
||||
`python doc_pdf.py text/<your_file>.txt body/<output-name>.pdf`
|
||||
|
||||
## Make the cover of the pdf
|
||||
Same, the default parameters included in the script would create the cover for the zine_maker:
|
||||
`python cover.py`
|
||||
|
||||
OR try-out the other cover samples:
|
||||
|
||||
`python cover.py text/cover.txt covers/cover.pdf`
|
||||
|
||||
OR add your cover text file and replace respectively:
|
||||
|
||||
`python cover.py text/<your-cover>.txt covers/<cover-name>.pdf`
|
||||
|
||||
## Make the colophon of the pdf
|
||||
Same, the default parameters included in the script would create the colophon for the zine_maker:
|
||||
`python colophon.py `
|
||||
|
||||
OR try-out the other colophon samples:
|
||||
|
||||
`python colophon.py text/colophon.txt colophons/colophon.pdf`
|
||||
|
||||
OR add your own colophon text file and replace respectively:
|
||||
|
||||
`python colophon.py text/<your-colophon>.txt colophons/<output-colophon>.pdf`
|
||||
|
||||
# Make a screen PDF
|
||||
|
||||
## For the final screen version
|
||||
from the terminal run:
|
||||
|
||||
`pdfunite covers/cover.pdf body/body.pdf colophons/colophon.pdf zines/final.pdf`
|
||||
|
||||
You shall substitute the file paths to your own corresponding /path/filenames
|
||||
|
||||
## See this readme as the generated screen version zine:
|
||||
open the file zines/zinemaker.pdf
|
||||
|
||||
# Make a zine
|
||||
|
||||
## Prepare signatures for printing
|
||||
|
||||
<img>./thumbs/printer_settings.png<img>
|
||||
|
||||
Default parameters: as input "zines/zinemaker_screen.pdf" and as output "zinemaker{random_number}.pdf"
|
||||
Run it for your own pdf files as following:
|
||||
`python shuffle_pdf.py` <input_file>.pdf <output_file>.pdf`
|
||||
|
||||
In the printer settings opt-in for the following settings:
|
||||
- A4 Landscape
|
||||
- Two pages per side
|
||||
- Double side - short edge
|
||||
and changes to the font color and size happen accordingly. We can add more or edit existing rules, directly in the zine_maker code.
|
||||
To add new functions for text style visit the [fpdf2 text documentation](https://py-pdf.github.io/fpdf2/TextStyling.html)
|
||||
To add new functions for drawing shapes visit the [fpdf2 drawing documentation](https://py-pdf.github.io/fpdf2/fpdf/drawing.html)
|
||||
|
|
|
|||
|
|
@ -20,20 +20,23 @@ def make(inputfile, output):
|
|||
zine = Zine(orientation="P", unit="mm", format="A5")
|
||||
|
||||
# text font
|
||||
zine.add_font(
|
||||
'Kpalter', '',
|
||||
r"fonts/KpProgrammerAlternatesNbp-Zg1q.ttf", uni=True
|
||||
)
|
||||
zine.add_font('CasaleNBP', '', r"./fonts/CasaletwoNbp-Bp4V.ttf", uni=True)
|
||||
header_font = 'CasaleNBP'
|
||||
#header_font = 'Kpalter'
|
||||
text_font = 'helvetica'
|
||||
zine.set_font(text_font, '', size=text_font_size)
|
||||
zine.add_font( 'chinese', '', r"fonts/tinming.ttf")
|
||||
zine.add_font( 'korean', '', r"fonts/GmarketSansTTFMedium.ttf")
|
||||
zine.add_font( 'english', '', r"./fonts/CasaletwoNbp-Bp4V.ttf")
|
||||
# zine.add_font( 'english', '', r"fonts/tinming.ttf")
|
||||
header_font = 'english'
|
||||
english_font = 'english'
|
||||
chinese_font = 'chinese'
|
||||
korean_font = 'korean'
|
||||
# zine.set_font(chinese_font, '', size=text_font_size)
|
||||
zine.set_font(english_font, '', size=text_font_size)
|
||||
zine.set_text_shaping(True)
|
||||
|
||||
zine.create_pages(inputfile, max_height, left_margin,
|
||||
left_max_margin, top_margin, right_margin,
|
||||
cell_width, cell_height, cell_header_height,
|
||||
header_font, text_font, text_font_size)
|
||||
header_font, english_font, chinese_font, korean_font,
|
||||
text_font_size)
|
||||
|
||||
zine.output(output)
|
||||
print("PDF saved as {}".format(output))
|
||||
|
|
@ -43,12 +46,12 @@ if __name__ == '__main__':
|
|||
# input text and output pdf
|
||||
if len(sys.argv) > 1:
|
||||
if len(sys.argv) == 2:
|
||||
output = "./body/readme.pdf"
|
||||
output = "./output/body.pdf"
|
||||
if len(sys.argv) == 3:
|
||||
output = sys.argv[2]
|
||||
inputfile = sys.argv[1]
|
||||
else:
|
||||
inputfile = "./text/readme"
|
||||
output = "./body/readme.pdf"
|
||||
inputfile = "./input/body.txt"
|
||||
output = "./output/body.pdf"
|
||||
|
||||
make(inputfile, output)
|
||||
BIN
body/images.pdf
BIN
body/oulipo.pdf
BIN
body/oulipo1.pdf
BIN
body/readme.pdf
|
|
@ -13,7 +13,6 @@ from zine_maker import Zine
|
|||
|
||||
|
||||
def shuffle_zine(finput, foutput):
|
||||
# set font for all text
|
||||
zine = Zine(orientation="P", unit="mm", format="A5")
|
||||
chapter_list = zine.shuffle_chapters(finput)
|
||||
|
||||
|
|
@ -36,6 +35,8 @@ def shuffle_zine(finput, foutput):
|
|||
print("PDF saved as {}".format(foutput))
|
||||
os.system("mv ./*_chapter.pdf ./.tmp")
|
||||
os.system("rm ./.tmp/*_chapter.pdf")
|
||||
os.system("rm ./doc_data.txt")
|
||||
os.system("rm ./chapters.txt")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
@ -34,7 +34,7 @@ if __name__ == '__main__':
|
|||
output = sys.argv[2]
|
||||
inputfile = sys.argv[1]
|
||||
else:
|
||||
inputfile = "./text/colophon_readme.txt"
|
||||
output = "./colophons/colophon_readme.pdf".format(random.randint(1, 40))
|
||||
inputfile = "./input/colophon.txt"
|
||||
output = "./output/colophon.pdf".format(random.randint(1, 40))
|
||||
|
||||
make_colophon(inputfile, output)
|
||||
|
|
|
|||
4
cover.py
|
|
@ -22,7 +22,7 @@ if __name__ == '__main__':
|
|||
output = sys.argv[2]
|
||||
inputfile = sys.argv[1]
|
||||
else:
|
||||
inputfile = "./text/cover_readme.txt"
|
||||
output = "./covers/cover_readme.pdf"
|
||||
inputfile = "./input/cover.txt"
|
||||
output = "./output/cover.pdf"
|
||||
|
||||
make_cover(inputfile, output)
|
||||
|
|
|
|||
BIN
covers/cover.pdf
BIN
fonts/GmarketSansTTFBold.ttf
Normal file
BIN
fonts/GmarketSansTTFLight.ttf
Normal file
BIN
fonts/GmarketSansTTFMedium.ttf
Normal file
BIN
fonts/fireflysung.ttf
Normal file
BIN
fonts/tinming.ttf
Normal file
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
458
input/body.txt
Normal file
|
|
@ -0,0 +1,458 @@
|
|||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# 해커스 앤 디자이너스 - 걸어다니는 신호들 / 와이파이-진 워크숍.
|
||||
|
||||
## 와이파이-진(zine) 이란?
|
||||
|
||||
### 한 줄 설명
|
||||
|
||||
- 스마트폰이 핫스팟 로그인을 시도할때, 웹진 형식의 자주독립출판물을 서비스하도록 설계된 무선통신 및 웹서비스 장치
|
||||
|
||||
[{:width="500px"}](./assets/hotspot-zine-ssid.jpg)
|
||||
[{:width="500px"}](./assets/hotspot-zine-login.jpg)
|
||||
|
||||
- [더보기](http://pilote.byus.net/wpdiana/?page_id=1064)
|
||||
|
||||
### 선행 프로젝트
|
||||
|
||||
- [CaptiveIntraweb by AReResearch (Andy Reischle) @ 2015](https://github.com/reischle/CaptiveIntraweb)
|
||||
|
||||
[{:width="500px"}](./assets/areresearch/img4.png)
|
||||
|
||||
### 구성요소
|
||||
|
||||
- 유형 요소 (tangible components)
|
||||
- Espressif사의 ESP32 모듈
|
||||
- 전원장치 (배터리 또는 DC 아답타)
|
||||
- (선택적) 통 또는 외형
|
||||
- (선택적) 자석
|
||||
|
||||
[{:width="500px"}](./assets/areresearch/img1.png)
|
||||
|
||||
[{:width="500px"}](./assets/areresearch/img2.png)
|
||||
|
||||
[{:width="500px"}](./assets/areresearch/img5.png)
|
||||
|
||||
[{:width="500px"}](./assets/areresearch/img6.png)
|
||||
|
||||
[{:width="500px"}](./assets/areresearch/img7.png)
|
||||
|
||||
(위 이미지들은 Andy Reischle (AReResearch) 님이 게시한 것들입니다.)
|
||||
|
||||
- 무형 요소 (intangible components)
|
||||
- [ESP-IDF 개발 환경](https://github.com/espressif/esp-idf/tree/master/components)
|
||||
- [ESP32 아두이노 호환성 패키지](https://github.com/espressif/arduino-esp32)
|
||||
- [SPIFFS 파일 시스템](https://github.com/espressif/arduino-esp32/tree/master/libraries/SPIFFS)
|
||||
- [ESP 웹서버 라이브러리](https://github.com/me-no-dev/ESPAsyncWebServer)
|
||||
- [도메인 네임서버(captive portal)](https://github.com/espressif/arduino-esp32/tree/master/libraries/DNSServer)
|
||||
- 웹페이지 (웹-진)
|
||||
|
||||
[{:width="500px"}](./assets/Wi-Fi-zine-stacks.png)
|
||||
|
||||
- [더 많은 정보](http://esp32.net/)
|
||||
- [Wi-Fi 스택이 오픈소스가 아닌 문제](https://github.com/espressif/esp32-wifi-lib/issues/2)
|
||||
|
||||
### 알아두어야 할 와이파이-진 시스템의 한계
|
||||
|
||||
- 저장용량 2MB 이하
|
||||
- 일반적인 웹서버에 비해 다소 느린 속도
|
||||
- 일반적인 웹서버에 비해 다소 불안정한 작동 (때때로, 시스템 재시작이 필요할 수 있음)
|
||||
|
||||
## 와이파이-진 만들기
|
||||
|
||||
### 재료 및 준비물
|
||||
|
||||
- 컴퓨터
|
||||
- ESP32 모듈이 탑재된 개발보드
|
||||
- 통신용 마이크로 USB 케이블 (안드로이드 데이타 케이블)
|
||||
- 배터리, 배터리팩 또는 DC 아답타
|
||||
- 웹페이지 (html/css/js + 미디어 파일)
|
||||
- (선택적으로) 센서 또는 작동장치 (스피커 등)
|
||||
|
||||
### 와이파이-진 보드 준비하기
|
||||
|
||||
- [Arduino 다운로드](https://www.arduino.cc/en/Main/Software)
|
||||
|
||||
- Arduino 설치하기
|
||||
|
||||
- [Windows](https://www.arduino.cc/en/Guide/Windows)
|
||||
|
||||
- [Mac OSX](https://www.arduino.cc/en/Guide/MacOSX)
|
||||
|
||||
[{:width="300px"}](./assets/arduino-confirm.png)
|
||||
|
||||
'Open' 을 클릭.
|
||||
|
||||
- [Linux](https://www.arduino.cc/en/Guide/Linux)
|
||||
|
||||
- Arduino IDE 실행 화면
|
||||
|
||||
[{:width="300px"}](./assets/arduino-screen.png)
|
||||
|
||||
- Arduino IDE 설정
|
||||
|
||||
- 컴파일 및 업로드 과정 표시 모드를 '상세한 표기'로 변경
|
||||
|
||||
[{:width="300px"}](./assets/arduino-verbose.png)
|
||||
|
||||
'Show verbose output during:' 항목에서 compilation과 upload에 체크
|
||||
|
||||
- [Arduino IDE에 esp32 보드를 추가하기](https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/boards_manager.md)
|
||||
|
||||
- 'Additional Boards Manager URLs' 에 다음 내용을 복사하여 붙여넣고 'Ok'.
|
||||
|
||||
```
|
||||
https://dl.espressif.com/dl/package_esp32_index.json
|
||||
```
|
||||
|
||||
[{:width="300px"}](./assets/arduino-board-url.png)
|
||||
|
||||
- 보드 매니져 실행
|
||||
|
||||
[{:width="300px"}](./assets/arduino-board-manager.png)
|
||||
|
||||
- 보드 매니져 팝업창의 모습
|
||||
|
||||
[{:width="300px"}](./assets/arduino-board-manager-popup.png)
|
||||
|
||||
- 검색창에 'esp32'라고 입력 후, 'Install' 클릭
|
||||
|
||||
[{:width="300px"}](./assets/arduino-board-manager-esp32.png)
|
||||
|
||||
- Arduino IDE에 와이파이-진 코드와 필요한 라이브러리들 추가하기
|
||||
|
||||
- [와이파이-진](https://github.com/applecargo/WifiZineThrowie/) 다운로드 및 설치
|
||||
|
||||
'Clone or download' -> 'Download ZIP' 클릭
|
||||
|
||||
[{:width="300px"}](./assets/arduino-00010.png)
|
||||
|
||||
압축 해제 후, 폴더 이름 변경
|
||||
|
||||
[{:width="300px"}](./assets/arduino-00011.png)
|
||||
[{:width="300px"}](./assets/arduino-00012.png)
|
||||
|
||||
~/Documents/Arduino에 해당 폴더 복사
|
||||
|
||||
[{:width="300px"}](./assets/arduino-00013.png)
|
||||
|
||||
- [ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer)와 [AsyncTCP](https://github.com/me-no-dev/AsyncTCP) 라이브러리 다운로드 및 설치
|
||||
|
||||
'Clone or download' -> 'Download ZIP' 클릭
|
||||
|
||||
[{:width="300px"}](./assets/arduino-00001.png)
|
||||
|
||||
압축 해제 후, 폴더 이름 변경
|
||||
|
||||
[{:width="300px"}](./assets/arduino-00003.png)
|
||||
[{:width="300px"}](./assets/arduino-00004.png)
|
||||
|
||||
'Clone or download' -> 'Download ZIP' 클릭
|
||||
|
||||
[{:width="300px"}](./assets/arduino-00006.png)
|
||||
|
||||
압축 해제 후, 폴더 이름 변경
|
||||
|
||||
[{:width="300px"}](./assets/arduino-00007.png)
|
||||
[{:width="300px"}](./assets/arduino-00008.png)
|
||||
|
||||
~/Documents/Arduino/libraries에 해당 폴더 (2개) 복사
|
||||
|
||||
[{:width="300px"}](./assets/arduino-00009.png)
|
||||
|
||||
- 컴파일 확인
|
||||
|
||||
- Arduino IDE를 재시작
|
||||
|
||||
- 'WifiZineThrowie' 스케치를 연다
|
||||
|
||||
[{:width="300px"}](./assets/arduino-wifizine.png)
|
||||
|
||||
- ESP32 Dev Module 보드를 선택한다
|
||||
|
||||
[{:width="300px"}](./assets/arduino-wifizine-select-board.png)
|
||||
|
||||
- ESP32 Dev Module 보드 설정을 조정한다
|
||||
|
||||
[{:width="300px"}](./assets/arduino-wifizine-config-board.png)
|
||||
|
||||
- Upload Speed : 921600
|
||||
- CPU Frequency : 240MHz
|
||||
- Flash Frequency : 80MHz
|
||||
- Flash Mode : DIO
|
||||
- Flash Size : 4MB (32Mb)
|
||||
- Partition Scheme : Default
|
||||
- Core Debug Level : None
|
||||
- PSRAM : Disabled
|
||||
|
||||
- 컴파일 버튼(빨간 화살표)을 클릭한다
|
||||
|
||||
[{:width="300px"}](./assets/arduino-wifizine-popup.png)
|
||||
|
||||
- 컴파일 과정이 정상적으로 끝나면, 성공
|
||||
|
||||
[{:width="300px"}](./assets/arduino-wifizine-compile-done.png)
|
||||
|
||||
- 컴파일 과정이 비-정상적으로 끝나면, 실패
|
||||
|
||||
[{:width="300px"}](./assets/arduino-wifizine-compile-failed.png)
|
||||
|
||||
- ESP32 모듈과 통신하기 위한 USB 장치 드라이버 설치하기 (칩 이름 : SiliconLabs CP2012)
|
||||
|
||||
- [USB 통신 칩 드라이버 다운로드](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers)
|
||||
|
||||
- [Windows 10](https://www.silabs.com/documents/public/software/CP210x_Universal_Windows_Driver.zip)
|
||||
- [Windows 7/8/8.1](https://www.silabs.com/documents/public/software/CP210x_Windows_Drivers.zip)
|
||||
|
||||
- [설치 과정](https://www.pololu.com/docs/0J7/all)
|
||||
|
||||
- [Mac OSX](https://www.silabs.com/documents/public/software/Mac_OSX_VCP_Driver.zip)
|
||||
|
||||
- [GateKeeper와의 전쟁](https://support.apple.com/ko-kr/HT202491)
|
||||
|
||||
- Yosemite (10.10.x)
|
||||
|
||||
- [Legacy 드라이버를 설치해야 함](https://www.silabs.com/community/interface/forum.topic.html/latest_vcp_driverfo-96RK)
|
||||
|
||||
[{:width="300px"}](./assets/yosemite-cp2102.png)
|
||||
[{:width="300px"}](./assets/yosemite-cp2102-legacy.png)
|
||||
|
||||
- El capitan (10.11.x)
|
||||
|
||||
- [GateKeeper 비활성화 방법](https://medium.com/@krukmat/macos-el-capitan-enabling-usb-for-cp2102-usb-to-ttl-3b63449e02e9)
|
||||
- [csrutil enable --without kext](https://forums.developer.apple.com/thread/17452)
|
||||
|
||||
- Sierra (10.12.x)
|
||||
|
||||
- [GateKeeper 비활성화 방법](https://www.tekrevue.com/tip/gatekeeper-macos-sierra/)
|
||||
- sudo spctl --master-disable
|
||||
|
||||
- High Sierra (10.13.x)
|
||||
|
||||
- [GateKeeper 비활성화 방법](https://stackoverflow.com/questions/47109036/cp2102-device-is-not-listed-in-dev-on-macos-10-13)
|
||||
- [GateKeeper 비활성화 방법](https://pikeralpha.wordpress.com/2017/08/29/user-approved-kernel-extension-loading/)
|
||||
- [GateKeeper 비활성화 방법](https://www.silabs.com/community/interface/knowledge-base.entry.html/2018/03/30/usb_to_uart_bridgev-Dnef)
|
||||
- spctl kext-consent disable
|
||||
|
||||
- Mojave (10.14.x)
|
||||
|
||||
- [GateKeeper 비활성화 방법](http://osxdaily.com/2016/09/27/allow-apps-from-anywhere-macos-gatekeeper/)
|
||||
- sudo spctl --master-disable
|
||||
|
||||
- Linux 3.x.x & 4.x.x
|
||||
|
||||
- 드라이버 설치 불필요 (커널에 포함되어 있음)
|
||||
- [udev rules 업데이트 필요](https://docs.platformio.org/en/latest/faq.html#platformio-udev-rules)
|
||||
- [99-platformio-udev.rules](https://raw.githubusercontent.com/platformio/platformio-core/develop/scripts/99-platformio-udev.rules)
|
||||
|
||||
- [Linux 2.6.x](https://www.silabs.com/documents/login/software/Linux_2.6.x_VCP_Driver_Source.zip)
|
||||
|
||||
- 정보 없음
|
||||
|
||||
- USB 드라이버 작동 여부 확인하기
|
||||
|
||||
- 드라이버를 지금 막 설치했다면, 컴퓨터를 재시작한다
|
||||
|
||||
- 재시작한 후에 GateKeeper가 드라이버 로딩을 방해하지는 않았는지 확인한다.
|
||||
|
||||
- System Preferences -> Security & Privacy -> General
|
||||
|
||||
[{:width="300px"}](./assets/gatekeeper-check.png)
|
||||
[{:width="300px"}](./assets/gatekeeper-check-popup.png)
|
||||
|
||||
빨간색으로 표시된 상자안에 에러문구가 있다면, GateKeeper가 드라이버 작동을 방해한 경우이다.
|
||||
|
||||
[{:width="300px"}](./assets/security_and_privacy_kextload_approval.png)
|
||||
|
||||
위와 유사한 상태가 되어있을경우, 'Allow'를 클릭하고 관리자 암호를 넣어 승인해준 후, 컴퓨터를 재시작한다.
|
||||
|
||||
- Arduino IDE를 시작한 후에, ESP32 모듈과 통신 가능한지 확인
|
||||
|
||||
[{:width="300px"}](./assets/arduino-esp32-comm.png)
|
||||
|
||||
통신이 가능한 경우, 위와 같이 /dev/cu.SLAB_USBtoUART를 선택할 수가 있다.
|
||||
|
||||
[{:width="300px"}](./assets/arduino-esp32-comm-failed.png)
|
||||
|
||||
통신이 불가능한 경우, 위와 같이 /dev/cu.SLAB_USBtoUART가 존재하지 않는다.
|
||||
|
||||
- 와이파이-진 네트워크의 이름, 즉 SSID를 정하고 코드를 수정한다.
|
||||
|
||||
[{:width="300px"}](./assets/arduino-wifizine-ssid-change.png)
|
||||
|
||||
- 글자 수나 띄어쓰기 등에 의해서 안될 수도 있으므로, 처음에는 공백문자가 포함되지 않은 간단한 영문으로 테스트해본다.
|
||||
- 한글을 사용해도 된다.
|
||||
|
||||
- 보드에 업로드 한다
|
||||
|
||||
- 업로드 버튼(빨간 화살표)을 클릭하고, 'Connecting...' 이란 문구가 나타났을때, [ESP 보드의 'BOOT'라는 버튼을 1초간 눌렀다가 뗍니다](https://randomnerdtutorials.com/solved-failed-to-connect-to-esp32-timed-out-waiting-for-packet-header/).
|
||||
|
||||
[{:width="300px"}](./assets/arduino-wifizine-upload.png)
|
||||
|
||||
업로드 성공한 화면
|
||||
|
||||
[{:width="300px"}](./assets/arduino-wifizine-upload-done.png)
|
||||
|
||||
업로드 실패한 화면
|
||||
|
||||
[{:width="300px"}](./assets/arduino-wifizine-upload-failed.png)
|
||||
|
||||
- [다양한 문제 요인들](https://randomnerdtutorials.com/esp32-troubleshooting-guide/)
|
||||
|
||||
### 와이파이-진 보드 업로드 용량 늘리기 (선택적인 과정)
|
||||
|
||||
- 제공된 ESP32 모듈의 플래쉬 메모리 용량은 4MB이지만, 전부 다 와이파이-진 컨텐츠를 위해서 사용할 수는 없다. 그 이유는 와이파이-진을 구동하는 코드와 칩 자체의 작동을 위한 코드, 그리고 파일 시스템의 구조 (폴더 구조 및 파일의 구분 등)를 표현하기 위해 사용되는 데이터, 즉 SPIFFS의 구현에 의한 오버헤드와 같은 것들이 4MB 중 일부분을 사용하지 않을 수 없기 때문이다.
|
||||
|
||||
- ESP32 모듈의 플래쉬 메모리는 작동하는 데이터(즉, 코드), 저장해 두어야 하는 데이터(즉, 메모리), 구조를 기록하는 데이터(즉, 파일 시스템) 등이 파티션을 통해 4MB를 나누어 사용하도록 되어있다.
|
||||
|
||||
- 위의 과정 중에서, ESP32 보드를 설정할때,
|
||||
|
||||
[{:width="300px"}](./assets/arduino-wifizine-config-board.png)
|
||||
|
||||
```
|
||||
Partition Scheme : Default
|
||||
```
|
||||
|
||||
를 선택했었는데, 기본 파티션 구성의 경우 와이파이-진을 위해서 반드시 필요하지 않은 요소들을 포함하고 있으며, 기본 파티션 구성에서 와이파이-진 컨텐츠에 사용할 수 있는 메모리 용량은 1MB 정도밖에는 되지 않는다.
|
||||
|
||||
- 따라서, Partition Scheme을 보다 효율적으로 재구성하면, 와이파이-진 컨텐츠를 조금 더 많이 업로드 할 수 있게 할 수도 있다. 이렇게 하면, 약 1.9MB 정도의 용량을 사용할 수 있게 된다.
|
||||
|
||||
- 본 과정을 마치게 되면, 다음과 같이
|
||||
|
||||
[{:width="300px"}](./assets/arduino-wifizine-custom-partition.png)
|
||||
|
||||
```
|
||||
Partition Scheme : WIFI ZINE
|
||||
```
|
||||
|
||||
을 선택할 수 있게 된다.
|
||||
|
||||
- 작업 과정
|
||||
|
||||
- [파티션 설정 파일](https://raw.githubusercontent.com/applecargo/WifiZineThrowie/master/partition/wifi_zine.csv) 다운로드 및 설치
|
||||
|
||||
~/Library/Arduino15/packages/esp32/hardware/esp32/1.0.1/tools/partitions 에 붙여넣는다
|
||||
|
||||
[{:width="300px"}](./assets/arduino-partition-00001.png)
|
||||
|
||||
~/Library/ 폴더는 Finder에서 숨겨진 폴더이므로 Cmd-Shift-G를 누르고 Library 라고 타이핑하여 들어간다
|
||||
|
||||
[{:width="300px"}](./assets/arduino-partition-00002.png)
|
||||
|
||||
이후, Arduino15 폴더는 일반적인 폴더와 같이 더블 클릭하여 들어간다
|
||||
|
||||
[{:width="300px"}](./assets/arduino-partition-00003.png)
|
||||
|
||||
위와 같은 위치로 이동한다
|
||||
|
||||
[{:width="300px"}](./assets/arduino-partition-00004.png)
|
||||
|
||||
위와 같은 상태로 만든다
|
||||
|
||||
- boards.txt 파일 수정
|
||||
|
||||
[{:width="300px"}](./assets/arduino-partition-00005.png)
|
||||
|
||||
위와 같은 위치에 존재하는 파일 boards.txt 파일을 열어 다음에 +로 표시된 4줄을 추가한다 (+표시는 제거한다!)
|
||||
|
||||
```diff
|
||||
--- /Users/doohoyi/Downloads/Telegram Desktop/boards.txt
|
||||
+++ /Users/doohoyi/Library/Arduino15/packages/esp32/hardware/esp32/1.0.1/boards.txt
|
||||
@@ -52,6 +52,10 @@
|
||||
esp32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
|
||||
esp32.menu.PartitionScheme.fatflash=16M Fat
|
||||
esp32.menu.PartitionScheme.fatflash.build.partitions=ffat
|
||||
+esp32.menu.PartitionScheme.wifi_zine=WIFI ZINE
|
||||
+esp32.menu.PartitionScheme.wifi_zine.build.partitions=wifi_zine
|
||||
+esp32.menu.PartitionScheme.wifi_zine.upload.maximum_size=1048576
|
||||
+esp32.menu.PartitionScheme.wifi_zine.upload.maximum_data_size=2752512
|
||||
|
||||
esp32.menu.CPUFreq.240=240MHz (WiFi/BT)
|
||||
esp32.menu.CPUFreq.240.build.f_cpu=240000000L
|
||||
```
|
||||
|
||||
- Arduino IDE 를 재시작한 후, ESP32 DEV Module 설정 중 PartitionScheme을 WIFI ZINE으로 선택하고, 컴파일해본다.
|
||||
|
||||
### 와이파이-진 컨텐츠 업로드/출판 하기
|
||||
|
||||
- 와이파이-진 컨텐츠는 작동하는 코드와는 별도로 저장된다. 따라서, 일반적인 Arduino IDE의 코드 업로드 과정과는 별도의 과정을 거친다. 이를 위해, 별도의 확장 플러그인을 설치해야 합니다.
|
||||
|
||||
- [ESP32FS 플러그인](https://github.com/me-no-dev/arduino-esp32fs-plugin/releases) 다운로드 및 설치
|
||||
|
||||
~/Documents/Arduino/tools 라는 폴더 생성
|
||||
|
||||
[{:width="300px"}](./assets/arduino-esp32fs-00002.png)
|
||||
|
||||
압축이 풀린 ESP32FS 를 이곳에 복사 설치
|
||||
|
||||
[{:width="300px"}](./assets/arduino-esp32fs-00003.png)
|
||||
|
||||
폴더의 구성에 조심해야 합니다. 다음 그림과 같이 설치되어야 합니다. (폴더의 이름이 ESP32FS 인 것도 주의!)
|
||||
|
||||
[{:width="300px"}](./assets/arduino-esp32fs-00004.png)
|
||||
|
||||
Arduino IDE를 재시작한 후, 플러그인 설치가 성공했는지 확인합니다. 성공했다면, 'ESP32 Sketch Data Upload' 라는 메뉴가 추가된 것을 확인할 수 있습니다.
|
||||
|
||||
[{:width="300px"}](./assets/arduino-esp32fs-00005.png)
|
||||
|
||||
이 메뉴를 실행하면, ~/Documents/Arduino/WifiZineThrowie/data 폴더에 들어있는 모든 파일을 ESP32 모듈의 웹 페이지 저장소에 이동시키게 됩니다.
|
||||
|
||||
[{:width="300px"}](./assets/arduino-wifizine-webpage-upload.png)
|
||||
|
||||
업로드를 실행하십시오. 업로드 중 출력되는 메세지의 색깔이 빨간색이 아니라 흰색으로 출력됩니다. 코드를 업로드 할 때와 마찬가지로, 'Connecting...' 이란 문구가 나타났을때, [ESP 보드의 'BOOT'라는 버튼을 1초간 눌렀다가 땝니다](https://randomnerdtutorials.com/solved-failed-to-connect-to-esp32-timed-out-waiting-for-packet-header/).
|
||||
|
||||
업로드가 성공적으로 완료된 경우의 화면
|
||||
|
||||
[{:width="300px"}](./assets/arduino-wifizine-webpage-upload-done.png)
|
||||
|
||||
축하합니다. 와아파이-진을 제작/출판하기 위한 모든 준비가 끝났습니다.
|
||||
|
||||
## 와이파이-진 컨텐츠 예시
|
||||
|
||||
- 예시 1 텍스트 페이지
|
||||
|
||||
- [Hello, Text?](https://github.com/applecargo/WifiZineThrowie/blob/master/data-text.zip?raw=true)
|
||||
|
||||
- [폰트 구하기](https://www.dafont.com/)
|
||||
|
||||
- 예시 2
|
||||
|
||||
- [Imaginary, world](https://github.com/applecargo/WifiZineThrowie/blob/master/data-image.zip?raw=true)
|
||||
|
||||
- 예시 3
|
||||
|
||||
- [Sound-world!](https://github.com/applecargo/WifiZineThrowie/blob/master/data-sound.zip?raw=true)
|
||||
|
||||
- 예시 4
|
||||
|
||||
- Looooong story! (TBD)
|
||||
|
||||
- 예시 5
|
||||
|
||||
- (advanced) WebSocket - socket.io + server-side programming @ arduino (TBD)
|
||||
|
||||
- 해본적 없지만, 가능해 보임. 예제를 만들어 봅시다.
|
||||
|
||||
## 형태와 재질을 가지고 놀아보기
|
||||
|
||||
- 센서를 붙여보기
|
||||
|
||||
- 스위치?
|
||||
|
||||
- 작동하는 것을 붙여보기
|
||||
|
||||
- 모터?
|
||||
|
||||
## 장소와 함께 생각하기
|
||||
|
||||
- 자석을 이용해서 거리나 공간의 철골 구조에 부착
|
||||
|
||||
## 프로젝트에 기여하기
|
||||
|
||||
- ZINE 컨텐츠를 공유해주면, 다른 사람들이 각자 ZINE을 제작할 때, 아이디어와 영감을 얻을 수 있습니다. 이때, ZINE이 제작된 배경 이야기나 맥락, 형태 등 부가정보를 알려주면 더 좋습니다.
|
||||
- 와이파이-진 프로그램의 여러가지 부분을 개선할 수 있는 아이디어가 있으시다면, github의 PR 기능으로 수정내역을 보내주세요.
|
||||
- 그밖에 여러가지 생각들이나 의견들은 이메일로 주시면 됩니다. <mailto:pilotedeguerre@gmail.com>
|
||||
|
||||
## 고맙습니다!
|
||||
69
input/body_2.txt
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
## Content:
|
||||
|
||||
p.1: front cover
|
||||
p.2: Blank
|
||||
p.3: introduction
|
||||
### The idea of hiding, and why need to hide?
|
||||
p.4: ### Quote from Yung Au (2023) ref: https://datarelations.acca.melbourne/?entry=erasure-by-any-other-name
|
||||
+++
|
||||
Delete:
|
||||
|
||||
刪 (remove; erase)
|
||||
除 (eliminate; divide)
|
||||
|
||||
Censor:
|
||||
審 (examine; caution; interrogate)
|
||||
查 (inspect; consult)
|
||||
|
||||
Disappear; Fade Away:
|
||||
消 (vanish; disperse)
|
||||
失 (mistake; omit; neglect)
|
||||
|
||||
Obscure; veil; make ambiguous:
|
||||
隱 (hide; cover up; latent)
|
||||
晦 (dark; night)
|
||||
+++
|
||||
p.5: Index
|
||||
p.6: Context
|
||||
### about the artwork series
|
||||
|
||||
p.7: Hiding text in Unerasable Characters III
|
||||
<!show image-->
|
||||
p.8: ### HTML and CSS (and view source code)
|
||||
p.9: ### Black Out technique
|
||||
p.10: ### Blurring technique
|
||||
|
||||
p.11: Hiding text in Unerasable Characters II
|
||||
<!show image-->
|
||||
p.12: ### Javascript and parsing simple data
|
||||
p.13: ### Displaying text otherwise
|
||||
|
||||
p.14: Hiding text in Unerasable Characters I
|
||||
<!show image-->
|
||||
p.15: ### Destroying text with Machine Learning
|
||||
<!show graphviz diagram: digitized data > input > training > output-->
|
||||
p.16: ### Producing gabbage text
|
||||
p.17: ### Making a hidden book
|
||||
|
||||
p.18:Quotes
|
||||
### from Yung Au (2023) again
|
||||
+++
|
||||
All of us have lived through some form of erasure. That is the experience of having our sentences cut short. Or the experience of being the subject of the moderation that occurs across communication infrastructures. It is having information curated for you, whether by machine, by hand or by something else entirely. Forgetting, too, is inherently a part of human memory. But, of course, as varied as our experiences of erasure, is our experiences of storage, of memory deposits, of keeping less tangible things in safe places.
|
||||
|
||||
The Chinese term for ‘forget’ (忘記) is made up of the individual characters ‘to forget/overlook’ and ‘to remember/keep in mind’. Likewise, the term for amnesia (失憶) is created by the individual characters ‘to omit/lose’ and ‘to recall’.
|
||||
|
||||
What, then, are your architectures of forgetting and remembering? What, for you, will never be erased?
|
||||
+++
|
||||
p.19: Blank page
|
||||
p.20: Back cover
|
||||
### licencing, acknowlegements (e.g zine maker)
|
||||
|
||||
```
|
||||
tar -xvf zine_maker.tar -C /home/user/destination
|
||||
unzip zinme_maker.zip -d /home/user/destination
|
||||
```
|
||||
|
||||
TEST:
|
||||
|
||||
# show image
|
||||
<img>./thumbs/exhibition.jpg<img>
|
||||
73
input/body_ko.txt
Executable file
|
|
@ -0,0 +1,73 @@
|
|||
## 와이파이-공간 감각
|
||||
|
||||
도쿄 여행은 와이파이 진에 대해 생각하게 된 계기가 되었습니다. 당시만 해도 한국보다 공공장소에서 무료 인터넷을 찾기가 어려웠습니다. 마찬가지로 공공장소에서 담배를 피울 수 있는 곳도 없었어요. 조금 핍박을 받았던 것 같아요. 지하철역 앞에는 항상 흡연구역이 있었고 무료 인터넷도 있었어요. 흡연자들은 이곳에 모여 담배 연기와 인터넷 신호를 공유하며 흡연을 합니다. 한 손에는 스마트폰을, 한 손에는 담배를 들고 있는 모습에서 묘한 정체성과 연대의식을 느낄 수 있습니다. 만약 혁명이 일어난다면 이곳이 그 출발점이 될 수 있습니다.
|
||||
|
||||
<img>images/담배피는 사람들!.jpg<img>
|
||||
|
||||
<newpage>
|
||||
|
||||
<caption>담배피는 사람들<caption>
|
||||
|
||||
한 공간에 함께 존재하고 점유하는 것. 제가 한국에서 초등학생이었을 때는 베이비붐으로 한 학급에 50명이 넘는 학생이 있었고, 한 학년에 10학급이 넘는 학교도 있었어요. 1학년부터 6학년까지 한 학교에 학생 수가 꽤 많았죠. 일주일에 한 번씩 학교 운동장에 모이는 시간이 있었는데, 학교의 큰 어른이 전교생에게 말을 걸고... 에헴. 그때 우리가 함께 있다는 느낌은 교장 선생님의 목소리 가청 범위 안에 모두 모였기 때문일 거예요.
|
||||
|
||||
<img>images/img2.jpg<img>
|
||||
|
||||
가상의 놀이터에서 함께 존재하고 점거하는 것. 새벽 3시경, 대한민국 국회에서는 악법 통과를 지연시키기 위한 자율 토론회(필리버스터)가 열리고 있었습니다. 당시 많은 사람들이 온라인을 통해 토론과 연설을 지켜보고 있었는데, 30000명이 넘는 사람들이 시청했습니다.
|
||||
|
||||
<img>images/img3.jpg<img>
|
||||
|
||||
사진은 출퇴근 피크 시간대의 지하철 내부 풍경을 보여줍니다. 거의 모든 사람들이 스마트폰을 사용하며 30분 이상 붙어 있습니다. 그들은 서로의 땀 냄새를 공유합니다. 모두가 이런 상황을 피하고 싶어 합니다. 그래서 각자 스마트폰 너머의 누군가 또는 어딘가와 연결을 시도합니다. "스마트폰이 다른 사람의 얼굴에 닿지 않도록 주의하세요."라는 주의 표시를 본 적이 있습니다. 처음에는 "얼굴"을 이해하지 못했습니다. 하지만 구체적으로 이런 상황이 발생했습니다. 우리 모두는 함께 있지만 함께 있지 않은 상황에 처해 있습니다.
|
||||
|
||||
<img>images/img4.jpg<img>
|
||||
|
||||
<img>images/img5.jpg<img>
|
||||
|
||||
무료 인터넷을 사용하기 위해 WiFi를 켜면 재미있는 제목의 WiFi가 나타납니다. 내 WiFi를 사용하지 마세요.
|
||||
|
||||
<img>images/img6.jpg<img>
|
||||
|
||||
하지만 여전히 흥미로운 것은 많은 사람들이 스마트폰을 사용하고 있다는 것입니다. 이것은 대부분의 사람들이 기본적으로 동일한 구조, 메이다의 형성을 가지고 있다는 영감을 줄 수 있습니다. 이 플랫폼으로 함께 해보자고 제안할 수 있습니다. 서울의 한 대학교 학생들이 국가와 대학의 잘못을 고발하기 위해 스마트폰 LED를 들고 행진하고 있습니다. 함께 존재하고 점거하며 행동하는 것. 존재와 점거.
|
||||
|
||||
<img>images/img8.jpg<img>
|
||||
|
||||
소리가 전파되는 공간, 신호가 전파되는 공간, 침입하는 문구. 그 틈새로 살짝 밀고 들어가는 선언.
|
||||
|
||||
<img>images/img10.jpg<img>
|
||||
|
||||
보행 신호는 어떨까요?
|
||||
|
||||
<img>images/img12.jpg<img>
|
||||
|
||||
와이파이 신호가 잡히면 팝업 페이지가 뜨고 ... WWW와 연결되지 않은 웹 진입니다.
|
||||
|
||||
<img>images/img13.jpg<img>
|
||||
|
||||
Wi-Fi ZINE 플래그
|
||||
|
||||
<img>images/img14.jpg<img>
|
||||
|
||||
스마트폰을 가지고 있는 주변 사람들이 로컬 네트워크에 접속할 수 있습니다.
|
||||
|
||||
<img>images/img15.jpg<img>
|
||||
|
||||
보행 신호
|
||||
|
||||
<img>images/img19.jpg<img>
|
||||
|
||||
글로벌 - 로컬, 메가진 - 진
|
||||
|
||||
<img>images/img20.jpg<img>
|
||||
|
||||
분산 네트워크
|
||||
|
||||
<img>images/img21.jpg<img>
|
||||
|
||||
<img>images/img23.jpg<img>
|
||||
|
||||
닫힌 장치
|
||||
|
||||
<img>images/img24.jpg<img>
|
||||
|
||||
무엇을 만들 수 있을까요?
|
||||
|
||||
<img>images/img25.jpg<img>
|
||||
62
input/bodyclean.txt
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
|
||||
Delete:
|
||||
|
||||
(remove; erase)
|
||||
(eliminate; divide)
|
||||
|
||||
Censor:
|
||||
(examine; caution; interrogate)
|
||||
(inspect; consult)
|
||||
|
||||
Disappear; Fade Away:
|
||||
(vanish; disperse)
|
||||
(mistake; omit; neglect)
|
||||
|
||||
Obscure; veil; make ambiguous:
|
||||
(hide; cover up; latent)
|
||||
(dark; night)
|
||||
+++
|
||||
p.5: Index
|
||||
p.6: Context
|
||||
### about the artwork series
|
||||
|
||||
p.7: Hiding text in Unerasable Characters III
|
||||
<!show image-->
|
||||
p.8: ### HTML and CSS (and view source code)
|
||||
p.9: ### Black Out technique
|
||||
p.10: ### Blurring technique
|
||||
|
||||
p.11: Hiding text in Unerasable Characters II
|
||||
<!show image-->
|
||||
p.12: ### Javascript and parsing simple data
|
||||
p.13: ### Displaying text otherwise
|
||||
|
||||
p.14: Hiding text in Unerasable Characters I
|
||||
<!show image-->
|
||||
p.15: ### Destroying text with Machine Learning
|
||||
<!show graphviz diagram: digitized data > input > training > output-->
|
||||
p.16: ### Producing gabbage text
|
||||
p.17: ### Making a hidden book
|
||||
|
||||
p.18:Quotes
|
||||
### from Yung Au (2023) again
|
||||
+++
|
||||
All of us have lived through some form of erasure. That is the experience of having our sentences cut short. Or the experience of being the subject of the moderation that occurs across communication infrastructures. It is having information curated for you, whether by machine, by hand or by something else entirely. Forgetting, too, is inherently a part of human memory. But, of course, as varied as our experiences of erasure, is our experiences of storage, of memory deposits, of keeping less tangible things in safe places.
|
||||
|
||||
The Chinese term for ‘forget’ (忘記) is made up of the individual characters ‘to forget/overlook’ and ‘to remember/keep in mind’. Likewise, the term for amnesia (失憶) is created by the individual characters ‘to omit/lose’ and ‘to recall’.
|
||||
|
||||
What, then, are your architectures of forgetting and remembering? What, for you, will never be erased?
|
||||
+++
|
||||
p.19: Blank page
|
||||
p.20: Back cover
|
||||
### licencing, acknowlegements (e.g zine maker)
|
||||
|
||||
```
|
||||
tar -xvf zine_maker.tar -C /home/user/destination
|
||||
unzip zinme_maker.zip -d /home/user/destination
|
||||
```
|
||||
|
||||
TEST:
|
||||
|
||||
# show image
|
||||
<img>./thumbs/exhibition.jpg<img>
|
||||
1
input/cover.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
Hiding Characters with Code
|
||||
3
input/korean.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# test korean
|
||||
|
||||
## 한국어
|
||||
BIN
output/body.pdf
Normal file
BIN
output/colophon.pdf
Normal file
BIN
output/cover.pdf
Normal file
BIN
output/final.pdf
Normal file
BIN
output/final_print.pdf
Normal file
BIN
output/korean.pdf
Normal file
BIN
output/print_korean.pdf
Normal file
BIN
output/zine.pdf
Normal file
|
|
@ -1,2 +1,3 @@
|
|||
fpdf==1.7.2
|
||||
fpdf2
|
||||
Werkzeug==2.0.1
|
||||
uharfbuzz
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
oulipo poems
|
||||
|
|
@ -1 +0,0 @@
|
|||
ZINE MAKER
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
Bold Nassan quits his
|
||||
<i>caravan,</i>
|
||||
A hazy mountain grot to
|
||||
<i>scan;</i>
|
||||
Climis jaggy rocks to find his
|
||||
<i>way,</i>
|
||||
Doth tax his sight, iut far doth
|
||||
<i>stray.</i>
|
||||
|
||||
Not work of man, nor sport of
|
||||
<i>child</i>
|
||||
Finds Nassan on this mazy
|
||||
<i>wild;</i>
|
||||
Lax grow his joints, limis toil in
|
||||
<i>vain-</i>
|
||||
Poor wight! why didst thou quit that
|
||||
<i>plain?</i>
|
||||
|
||||
Vainly for succour Nassan
|
||||
<i>calls;</i>
|
||||
Know, Zillah, that thy Nassan
|
||||
<i>falls;</i>
|
||||
But prowling wolf and fox may
|
||||
<i>joy</i>
|
||||
To quarry on thy Arai
|
||||
<i>ioy.</i>
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<h2> If Youth, </h2>
|
||||
|
||||
throughout all history, had had a champion to stand up for it;
|
||||
to show a doubting world that a child can think;
|
||||
and, possibly, do it practically;
|
||||
you wouldn't constantly run across folks today who claim that "a child don't know anything."
|
||||
A child's brain starts functioning at birth; and has, amongst its many infant convolutions, thousands of dormant atoms, into which God has put a mystic possibility for noticing an adult's act, and figuring out its purport.
|
||||
|
||||
# Up to about its primary school days a child thinks, naturally, only of play.
|
||||
But many a form of play contains disciplinary factors. "You can't do this," or "that puts you out," shows a child that it must think, practically, or fail.
|
||||
Now, if, throughout childhood, a brain has no opposition, it is plain that it will attain a position of "status quo," as with our ordinary animals. Man knows not why a cow, dog or lion was not born with a brain on a par with ours; why such animals cannot add, subtract, or obtain from books and schooling, that paramount position which Man holds today.
|
||||
157
text/readme
|
|
@ -1,157 +0,0 @@
|
|||
# Introduction
|
||||
|
||||
This tutorial helps in navigating the zine_maker code, a small software tool derived from pyFPDF library. The code is written in Python, and provides a few scripts for creating covers, colophons, content, and also signatures for preparing a PDF for the printer. The scripts run with python version 3.x.x and we can feed to the scripts inputs and outputs. As an input, we give the path to a text file, which shall create the text and images content of the zine, and as an output we give a the path/filename of our choice. We can also run the scripts with no input nor output, in which case, they take as default parameters the readme text from the 'text/' folder and produce an output to either of the folders 'covers', 'colophons', 'body', or 'zines', depending on which script we are running each time.
|
||||
|
||||
# Get the code
|
||||
|
||||
## Download the source code
|
||||
The code is under development by the author and can be cloned or downloaded from https://git.systerserver.net/mara/zine_maker.
|
||||
|
||||
To download the project, near the top of the gitlab page, click on the download icon next to "Find file". Once downloaded, right-click to extract the files, or from terminal run:
|
||||
```
|
||||
tar -xvf zine_maker.tar -C /home/user/destination
|
||||
unzip zinme_maker.zip -d /home/user/destination
|
||||
```
|
||||
|
||||
Or with git clone:
|
||||
```
|
||||
export username=zine
|
||||
export token=DskM_8XxtKt-Wym1xHd1
|
||||
export repo=git.systerserver.net/mara/zine_maker.git
|
||||
git clone https://$username:$token@$repo
|
||||
cd zine_maker
|
||||
```
|
||||
# Requirements
|
||||
|
||||
Basic requirements are listed here.
|
||||
Python3 should be installed on the computer
|
||||
https://www.python.org/downloads/
|
||||
|
||||
And also the pip command if it didn't get installed with Python
|
||||
https://pip.pypa.io/en/stable/installation/
|
||||
|
||||
Once these are installed, from within zine_maker folder run:
|
||||
|
||||
`pip install -r requirements.txt`
|
||||
|
||||
# Miscellaneous
|
||||
|
||||
## Fonts
|
||||
The source code comes with some fonts under the 'fonts' folder. You can use your fonts of preference by adding them either in the 'fonts' folder and edit the files cover.py, colophon.py and doc_pdf.py to give the new names. Or add your absolute font path directly to the python scripts.
|
||||
|
||||
## Text
|
||||
The input texts should be clean from characters added by some text editors or Operating Systems. Use the cat command to check your text is ready as input
|
||||
with:
|
||||
`cat --show-nonprinting input.txt`
|
||||
|
||||
Characters such as M-oM-;M or ^M (carriage Return / line feed) need to be removed. A cool tool for that is dos2unix, which is available as command line, but needs to be installed:
|
||||
`dos2unix filename`
|
||||
|
||||
Or with the sed command:
|
||||
`sed -e "s/\r//g" file > newfile`
|
||||
|
||||
Extensive info can be find at:
|
||||
https://www.cyberciti.biz/faq/sed-remove-m-and-line-feeds-under-unix-linux-bsd-appleosx/
|
||||
|
||||
## Layout
|
||||
All the font styling happens in the zine_maker function create_pages(). The input text is parsed for specific tags or symbols in the begining of each line and changes to the font color and size happen accordingly. We can add more or edit existing rules, directly in the zine_maker code.
|
||||
|
||||
## Parameters
|
||||
The python scripts cover.py, colophon.py and doc_pdf.py take a text input and an output filename. If we give no input/output, the default input is the related readme files under 'covers/', 'body/', 'colophons/' folders.
|
||||
|
||||
## Merge
|
||||
For merging the cover, body and colophon pdf files, there are many pdf merger tools. One that is command line based and is used in this tutorial is pdfunite (http://linux-commands-examples.com/pdfunite).
|
||||
|
||||
## Print
|
||||
For shuffling the final pdf and prepare it for printing you need the pdfseparate command (http://www.linux-commands-examples.com/pdfseparate).
|
||||
it is used inside the shuffle_pdf.py file (see details at the end of this README).
|
||||
|
||||
## Images
|
||||
For making use of images in the script image magick needs to be installed (http://www.imagemagick.org/)
|
||||
|
||||
# Run the code!
|
||||
|
||||
## Make the content of the pdf
|
||||
The default parameters included in the script would create a zine from this readme:
|
||||
`python doc_pdf.py `
|
||||
|
||||
OR you can experiment with the other sample text found in this repository under the 'text' folder.
|
||||
|
||||
`python doc_pdf.py text/images.txt body/images.pdf`
|
||||
|
||||
OR get real and add your own text file and replace respectively the input and output filenames.
|
||||
|
||||
`python doc_pdf.py text/<your_file>.txt body/<output-name>.pdf`
|
||||
|
||||
## Make the cover of the pdf
|
||||
Same, the default parameters included in the script would create the cover for the zine_maker:
|
||||
`python cover.py`
|
||||
|
||||
OR try-out the other cover samples:
|
||||
|
||||
`python cover.py text/cover.txt covers/cover.pdf`
|
||||
|
||||
OR add your cover text file and replace respectively:
|
||||
|
||||
`python cover.py text/<your-cover>.txt covers/<cover-name>.pdf`
|
||||
|
||||
## Make the colophon of the pdf
|
||||
Same, the default parameters included in the script would create the colophon for the zine_maker:
|
||||
`python colophon.py `
|
||||
|
||||
OR try-out the other colophon samples:
|
||||
|
||||
`python colophon.py text/colophon.txt colophons/colophon.pdf`
|
||||
|
||||
OR add your own colophon text file and replace respectively:
|
||||
|
||||
`python colophon.py text/<your-colophon>.txt colophons/<output-colophon>.pdf`
|
||||
|
||||
# Make a screen PDF
|
||||
|
||||
## For the final screen version
|
||||
from the terminal run:
|
||||
|
||||
`pdfunite covers/cover.pdf body/body.pdf colophons/colophon.pdf zines/final.pdf`
|
||||
|
||||
You shall substitute the file paths to your own corresponding /path/filenames
|
||||
|
||||
## See this readme as a zine:
|
||||
open the file zines/zinemaker.pdf
|
||||
|
||||
# Make a zine
|
||||
|
||||
## Prepare signatures for printing
|
||||
|
||||
<img>./thumbs/printer_settings.png<img>
|
||||
|
||||
The script shuffle.py creates signatures for printing and folding the A4 in two, to create a zine. Default parameters: as input "zines/zinemaker_screen.pdf" and as output "zinemaker{random_number}.pdf"
|
||||
Run it for your own pdf files as following:
|
||||
`python shuffle_pdf.py` zines/<input_file>.pdf zines/<output_file>.pdf`
|
||||
|
||||
Note: your input file needs to have an even number of pages, divisible by 4, which is the number of pages needed for one signature. We can add blank pages in the begining and end of the body pdf file we created before if we need to make the total page number divisible by 4.
|
||||
|
||||
In the printer settings opt-in for the following:
|
||||
- A4 Landscape
|
||||
- Two pages per side
|
||||
- Double side - short edge
|
||||
|
||||
# References
|
||||
code repository:
|
||||
https://git.systerserver.net/mara/zine_maker
|
||||
|
||||
install python:
|
||||
https://www.python.org/downloads/
|
||||
|
||||
install pip:
|
||||
https://pip.pypa.io/en/stable/installation/
|
||||
|
||||
clean the text file for parsing:
|
||||
https://www.cyberciti.biz/faq/sed-remove-m-and-line-feeds-under-unix-linux-bsd-appleosx/
|
||||
|
||||
merge and split pdf files:
|
||||
http://linux-commands-examples.com/pdfunite
|
||||
http://www.linux-commands-examples.com/pdfseparate
|
||||
|
||||
process images:
|
||||
http://www.imagemagick.org/
|
||||
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 43 KiB |
BIN
thumbs/venv.png
|
Before Width: | Height: | Size: 35 KiB |
197
zine_maker.py
|
|
@ -84,11 +84,13 @@ class Zine(FPDF):
|
|||
left_max_margin, top_margin, right_margin, *args):
|
||||
if args:
|
||||
cell_width = args[0]
|
||||
cell_height = args[1]
|
||||
cell_default_height = args[1]
|
||||
cell_header_height = args[2]
|
||||
header_font = args[3]
|
||||
text_font = args[4]
|
||||
text_font_size = args[5]
|
||||
english_font = args[4]
|
||||
chinese_font = args[5]
|
||||
korean_font = args[6]
|
||||
default_font_size = args[7]
|
||||
|
||||
f = open(filename, 'rt')
|
||||
lines = f.readlines()
|
||||
|
|
@ -98,18 +100,23 @@ class Zine(FPDF):
|
|||
self.set_margins(left_margin, top_margin, right_margin)
|
||||
self.set_xy(left_margin, top_margin)
|
||||
self.add_page()
|
||||
text_font = None
|
||||
text_font_size = None
|
||||
|
||||
for line in lines:
|
||||
position = 'L'
|
||||
|
||||
if ">>" in line:
|
||||
self.set_font(text_font, '', size=16)
|
||||
self.cell(cell_width, cell_height, line,
|
||||
0, ln=1, align='L')
|
||||
self.set_font(text_font, '', size=text_font_size)
|
||||
|
||||
if re.search(u'[\u4e00-\u9fff]', line):
|
||||
text_font = chinese_font
|
||||
elif re.search(u'[\uac00-\ud7af]', line):
|
||||
text_font = korean_font
|
||||
else:
|
||||
text_font = english_font
|
||||
# check if we have an image
|
||||
elif line.startswith("<img>"):
|
||||
if line.startswith("<img>"):
|
||||
img_filename = line.split("<img>")[1]
|
||||
img_path = img_filename.split(".")[-2]
|
||||
img_name = img_path.split("/")[-1]
|
||||
kwargs = {
|
||||
"max_height": max_height,
|
||||
"left_margin": left_margin,
|
||||
|
|
@ -117,123 +124,61 @@ class Zine(FPDF):
|
|||
}
|
||||
self.position_img(
|
||||
img_filename, self.get_x(), self.get_y(), **kwargs)
|
||||
line = re.sub('^<img>[\w|\W]+\..+$', img_name, line)
|
||||
line = re.sub('<img>', '', line)
|
||||
position = 'C'
|
||||
|
||||
# check if we have a title
|
||||
elif line.startswith("<h2>"):
|
||||
line = re.sub('((<h2>)|(</h2>$))', '', line)
|
||||
purple_shades = random.randrange(100, 180, 20)
|
||||
#self.set_text_color(130, 50, 250)
|
||||
self.set_text_color(purple_shades, 0, 200)
|
||||
self.set_font(header_font, size=22)
|
||||
if self.get_y() > top_margin:
|
||||
self.set_xy(left_margin, top_margin+9)
|
||||
self.add_page()
|
||||
self.cell(cell_width, cell_header_height, line,
|
||||
0, ln=1, align='C')
|
||||
left_x = self.get_x()
|
||||
top_y = self.get_y()
|
||||
# self.dashed_line(
|
||||
# left_x, top_y, left_x+cell_width, top_y,
|
||||
# dash_length=3, space_length=3)
|
||||
self.set_text_color(0, 0, 0)
|
||||
self.set_font(text_font, size=text_font_size)
|
||||
|
||||
elif line.startswith("<i>"):
|
||||
line = re.sub('((<i>)|(</i>$))', '', line)
|
||||
self.set_font('helvetica', 'I', size=19)
|
||||
self.multi_cell(cell_width, cell_height, line,
|
||||
0, align='L')
|
||||
self.set_font(text_font, '', size=text_font_size)
|
||||
|
||||
elif line.startswith("<b>"):
|
||||
line = re.sub('((<b>)|(</b>$))', '', line)
|
||||
font_size = 14
|
||||
self.set_font(header_font, '', font_size)
|
||||
bold_header_height = font_size
|
||||
self.cell(cell_width, bold_header_height, line,
|
||||
0, ln=1, align='C')
|
||||
self.set_font(text_font, '', size=text_font_size)
|
||||
elif line.startswith("<caption>"):
|
||||
line = re.sub('<caption>', '', line)
|
||||
line = re.sub('<caption>', '', line)
|
||||
position = 'C'
|
||||
|
||||
elif line.startswith("# "):
|
||||
#insert a new page in the zine
|
||||
if self.get_y() > top_margin:
|
||||
self.set_xy(left_margin, top_margin+9)
|
||||
self.add_page()
|
||||
self.set_font(header_font, size=25)
|
||||
|
||||
text_font_size = 32
|
||||
pink_shades = random.randrange(60, 150, 20)
|
||||
self.set_text_color(255, pink_shades, pink_shades)
|
||||
self.cell(cell_width, cell_header_height, line,
|
||||
0, ln=1, align='L')
|
||||
# go back to text font
|
||||
self.set_text_color(0, 0, 0)
|
||||
self.set_font(text_font, '', size=text_font_size)
|
||||
print('1#', text_font_size)
|
||||
|
||||
elif line.startswith("##"):
|
||||
elif line.startswith("<newpage>"):
|
||||
line = re.sub('<newpage>', '', line)
|
||||
#insert a new page in the zine
|
||||
if self.get_y() > top_margin:
|
||||
self.set_xy(left_margin, top_margin+9)
|
||||
self.add_page()
|
||||
|
||||
elif line.startswith("## "):
|
||||
line = re.sub('()', '', line)
|
||||
subheader_font = "helvetica"
|
||||
cell_subheader_height = 10
|
||||
text_font_size = 20
|
||||
#gray_shades = random.randrange(0, 256, 60)
|
||||
self.set_font(subheader_font, size=18)
|
||||
self.set_text_color(0, 0, 0)
|
||||
self.multi_cell(cell_width, cell_subheader_height, line,
|
||||
0, align='L')
|
||||
# go back to text font
|
||||
self.set_font(text_font, '', size=text_font_size)
|
||||
self.set_text_color(0, 255, 0)
|
||||
print('two #', text_font_size)
|
||||
|
||||
elif line.startswith("### "):
|
||||
line = re.sub('()', '', line)
|
||||
text_font_size = 13
|
||||
self.set_text_color(255, 0, 0)
|
||||
print('three #', text_font_size)
|
||||
|
||||
elif line.startswith("`") or line.startswith("```"):
|
||||
self.set_font('helvetica', '', size=11)
|
||||
self.set_text_color(0, 30, 255)
|
||||
line = re.sub('((`)|(```))', '', line)
|
||||
|
||||
self.multi_cell(cell_width, cell_height, line,
|
||||
0, align='L')
|
||||
|
||||
elif len(line.strip()) == 0:
|
||||
# go back to text font
|
||||
self.set_text_color(0, 0, 0)
|
||||
self.set_font(text_font, '', size=text_font_size)
|
||||
|
||||
elif line.startswith("$") or line.startswith("(venv)"):
|
||||
self.set_font('helvetica', 'B', size=9)
|
||||
self.set_text_color(0, 30, 255)
|
||||
|
||||
self.multi_cell(cell_width, cell_height, line,
|
||||
0, align='L')
|
||||
# go back to text font
|
||||
self.set_text_color(0, 0, 0)
|
||||
self.set_font(text_font, '', size=text_font_size)
|
||||
|
||||
elif line.startswith("<quote>"):
|
||||
line = re.sub('(<quote>$)', '', line)
|
||||
self.set_font(text_font, '', size=13)
|
||||
self.set_text_color(150, 0, 205)
|
||||
self.multi_cell(cell_width, cell_height, line,
|
||||
0, align='C')
|
||||
elif line.startswith("</quote>"):
|
||||
line = re.sub('(</quote>$)', '', line)
|
||||
self.multi_cell(cell_width, cell_height, line,
|
||||
0, align='L')
|
||||
self.set_font(text_font, '', text_font_size)
|
||||
self.set_text_color(0, 0, 0)
|
||||
|
||||
elif "<index>" in line:
|
||||
line = re.sub('(<index>$)', '', line)
|
||||
self.set_font(text_font, '', size=18)
|
||||
self.set_text_color(0, 0, 0)
|
||||
self.set_text_color(41, 98, 255)
|
||||
self.cell(cell_width/8, cell_height, line, 0, align='C')
|
||||
|
||||
elif "</index>" in line:
|
||||
line = re.sub('(</index>$)', '', line)
|
||||
self.set_font(text_font, '', size=text_font_size)
|
||||
self.set_text_color(0, 0, 0)
|
||||
self.multi_cell(cell_width, cell_height, line,
|
||||
0, align='L')
|
||||
|
||||
else:
|
||||
# check if we need the following
|
||||
text_font_size = default_font_size
|
||||
|
||||
variable_x = self.get_x()
|
||||
self.multi_cell(cell_width, cell_height, line, 0, align='L')
|
||||
self.set_font(text_font, '', size=text_font_size)
|
||||
# self.multi_cell(cell_width, cell_default_height, line, 0, align='L')
|
||||
self.multi_cell(cell_width, cell_default_height, line, 0, align=position)
|
||||
self.set_xy(variable_x, self.get_y())
|
||||
# go back to text font
|
||||
self.set_text_color(0, 0, 0)
|
||||
self.set_font(size=default_font_size)
|
||||
|
||||
# close file
|
||||
f.close()
|
||||
|
|
@ -251,32 +196,40 @@ class Zine(FPDF):
|
|||
else:
|
||||
for line in title.readlines():
|
||||
for letter in line:
|
||||
if letter.isspace():
|
||||
col += 40
|
||||
self.set_xy(margin+col, margin)
|
||||
|
||||
if self.get_y() >= max_height:
|
||||
self.set_xy(margin+col, margin)
|
||||
col += 40
|
||||
size = random.randrange(15, 30, 10)
|
||||
size = random.randrange(16, 30, 5)
|
||||
print(size)
|
||||
self.set_font(cover_font, '', size)
|
||||
self.set_text_color(255, 0, 0)
|
||||
variable_x = margin+col
|
||||
print(
|
||||
"LETTER {}, POSITION Y {}".format(letter, self.get_y())
|
||||
)
|
||||
print("VAR X {}".format(variable_x))
|
||||
|
||||
self.set_xy(variable_x, self.get_y())
|
||||
|
||||
self.cell(size, size, letter)
|
||||
self.line(size, size, self.get_x(), self.get_y())
|
||||
if(size % 2 == 0):
|
||||
var = "DF"
|
||||
R = random.randrange(30, 255, 40)
|
||||
G = random.randrange(0, 55, 55)
|
||||
#self.line(size, size, self.get_x(), self.get_y())
|
||||
if (size % 2 == 0):
|
||||
var = "D"
|
||||
else:
|
||||
var = "DF" # fills with color the shapes
|
||||
R = random.randrange(0, 255, 40)
|
||||
G = random.randrange(0, 255, 55)
|
||||
B = random.randrange(0, 155, 50)
|
||||
self.set_fill_color(R, G, B)
|
||||
else:
|
||||
var = "D"
|
||||
print(var)
|
||||
self.rect(
|
||||
|
||||
self.rect( # draw boxes
|
||||
float(self.get_x()), float(self.get_y()),
|
||||
float(size/2), float(size*4), style=var)
|
||||
float(size/2), float(size/2), style=var)
|
||||
|
||||
self.circle( # draw circles
|
||||
float(self.get_x()+ size/2), float(self.get_y()+ size/2),
|
||||
float(size), style=var)
|
||||
self.ln(size/2)
|
||||
|
||||
# close the file
|
||||
|
|
|
|||