Fixes
h3rald h3rald@h3rald.com
Wed, 15 Apr 2020 23:09:57 +0200
2 files changed,
10 insertions(+),
12 deletions(-)
M
src/hastyscribe.nim
→
src/hastyscribe.nim
@@ -2,10 +2,8 @@ import
os, parseopt, strutils, - sequtils, times, pegs, - base64, tables, httpclient, logging@@ -164,14 +162,14 @@ let fonts = @[
create_font_face(hastyscribe_font, "HastyScribe", "normal", 400), create_font_face(fa_solid_font, "Font Awesome 5 Free", "normal", 900), create_font_face(fa_brands_font, "Font Awesome 5 Brands", "normal", 400), - create_font_face(sourcecodepro_font, "Source Code Pro", "normal", 300), - create_font_face(sourcecodepro_it_font, "Source Code Pro", "italic", 300), - create_font_face(sourcecodepro_bold_font, "Source Code Pro", "normal", 600), - create_font_face(sourcecodepro_boldit_font, "Source Code Pro", "italic", 600), - create_font_face(sourcesanspro_font, "Source Sans Pro", "normal", 300), - create_font_face(sourcesanspro_bold_font, "Source Sans Pro", "normal", 600), - create_font_face(sourcesanspro_it_font, "Source Sans Pro", "italic", 300), - create_font_face(sourcesanspro_boldit_font, "Source Sans Pro", "italic", 600) + create_font_face(sourcecodepro_font, "Source Code Pro", "normal", 400), + create_font_face(sourcecodepro_it_font, "Source Code Pro", "italic", 400), + create_font_face(sourcecodepro_bold_font, "Source Code Pro", "normal", 800), + create_font_face(sourcecodepro_boldit_font, "Source Code Pro", "italic", 800), + create_font_face(sourcesanspro_font, "Source Sans Pro", "normal", 400), + create_font_face(sourcesanspro_bold_font, "Source Sans Pro", "normal", 400), + create_font_face(sourcesanspro_it_font, "Source Sans Pro", "italic", 400), + create_font_face(sourcesanspro_boldit_font, "Source Sans Pro", "italic", 800) ] return style_tag(fonts.join);
M
src/hastyscribepkg/utils.nim
→
src/hastyscribepkg/utils.nim
@@ -30,7 +30,7 @@ proc style_tag*(css: string): string =
result = "<style>$1</style>" % [css] proc encode_image*(contents, format: string): string = - let enc_contents = contents.encode(contents.len*3) + let enc_contents = contents.encode return "data:image/$format;base64,$enc_contents" % ["format", format, "enc_contents", enc_contents] proc encode_image_file*(file, format: string): string =@@ -53,7 +53,7 @@ let img = imgfile.encode_image_file(imgfile.image_format)
result = (watermark_style % [img]).style_tag proc encode_font*(font, format: string): string = - let enc_contents = font.encode(font.len*3) + let enc_contents = font.encode return "data:application/$format;charset=utf-8;base64,$enc_contents" % ["format", format, "enc_contents", enc_contents] proc create_font_face*(font, family, style: string, weight: int): string=