|
|
@ -165,11 +165,21 @@ def drawing(id): |
|
|
|
params = params, |
|
|
|
svg = svg) |
|
|
|
|
|
|
|
# __ _ _ _ |
|
|
|
# / _| ___ _ __ | |_ _ __ ___ __ _| | _(_)_ __ __ _ |
|
|
|
# | |_ / _ \| '_ \| __| | '_ ` _ \ / _` | |/ / | '_ \ / _` | |
|
|
|
# | _| (_) | | | | |_ | | | | | | (_| | <| | | | | (_| | |
|
|
|
# |_| \___/|_| |_|\__| |_| |_| |_|\__,_|_|\_\_|_| |_|\__, | |
|
|
|
# |___/ |
|
|
|
# |
|
|
|
# EDITING A FIGGONT ON A PAD TO THEN USE IT |
|
|
|
|
|
|
|
@app.route("/font.html") |
|
|
|
def font(): |
|
|
|
|
|
|
|
params = { |
|
|
|
'pad': request.args.get('p') or 'default', |
|
|
|
'text': request.args.get('t') or 'Cobbled Paths', |
|
|
|
'pad': request.args.get('p') or 'standard', |
|
|
|
'weight': request.args.get('w') or '3', |
|
|
|
} |
|
|
|
params['pad-full'] = etherpad + prefix + params['pad'] |
|
|
@ -179,6 +189,42 @@ def font(): |
|
|
|
title = title, |
|
|
|
params = params) |
|
|
|
|
|
|
|
@app.route("/writing/<id>") |
|
|
|
def writing(id): |
|
|
|
|
|
|
|
params = { |
|
|
|
'text': request.args.get('t') or 'Cobbled Paths', |
|
|
|
'pad': id or 'standard', |
|
|
|
'weight': request.args.get('w') or '3', |
|
|
|
} |
|
|
|
params['pad-full'] = etherpad + prefix + params['pad'] |
|
|
|
|
|
|
|
# get pad content |
|
|
|
print(' getting ' + params['pad-full']) |
|
|
|
pad_export = requests.get(params['pad-full'] + '/export/txt') |
|
|
|
ascii_input = pad_export.text |
|
|
|
|
|
|
|
# store as a temporary file |
|
|
|
print('--- saving figfont as temp ---') |
|
|
|
(figfont_file, figfont_path) = tempfile.mkstemp(suffix='.flf') |
|
|
|
print(figfont_path) |
|
|
|
with open(figfont_path, 'w') as figfont_file: |
|
|
|
figfont_file.write(ascii_input) |
|
|
|
|
|
|
|
print('--- opening the figfont ---') |
|
|
|
f = {} |
|
|
|
f['ascii'] = text2figlet(params['text'], figfont_path) |
|
|
|
print(f['ascii']) |
|
|
|
|
|
|
|
print('--- rendering to svg ---') |
|
|
|
svg = ascii2svg(f['ascii'], params['weight']) |
|
|
|
|
|
|
|
return render_template( |
|
|
|
'drawing.html', |
|
|
|
title = title, |
|
|
|
params = params, |
|
|
|
svg = svg) |
|
|
|
|
|
|
|
# _ _ |
|
|
|
# ___ __ _| |_ __ _| | ___ __ _ _ _ ___ |
|
|
|
# / __/ _` | __/ _` | |/ _ \ / _` | | | |/ _ \ |
|
|
@ -235,12 +281,12 @@ def catalogue(): |
|
|
|
params = params) |
|
|
|
|
|
|
|
|
|
|
|
# _ _ |
|
|
|
# ___ __ _| |_ __ _| | ___ __ _ _ _ ___ |
|
|
|
# / __/ _` | __/ _` | |/ _ \ / _` | | | |/ _ \ |
|
|
|
# | (_| (_| | || (_| | | (_) | (_| | |_| | __/ |
|
|
|
# \___\__,_|\__\__,_|_|\___/ \__, |\__,_|\___| |
|
|
|
# |___/ |
|
|
|
# _ _ _ |
|
|
|
# | |__ _ __ __ _| | _____ ___ __ ___ _ __| |_ |
|
|
|
# | '_ \| '_ \ / _` | | / _ \ \/ / '_ \ / _ \| '__| __| |
|
|
|
# | | | | |_) | (_| | | | __/> <| |_) | (_) | | | |_ |
|
|
|
# |_| |_| .__/ \__, |_| \___/_/\_\ .__/ \___/|_| \__| |
|
|
|
# |_| |___/ |_| |
|
|
|
# |
|
|
|
# FIGLET 2 SVGBOB INTERACTIVE CATALOGUE |
|
|
|
|
|
|
|