Nikita Kalanakov 2 years ago
parent
commit
4620fab22c
2 changed files with 8 additions and 2 deletions
  1. 7 1
      commands.py
  2. 1 1
      makeshot/makeshot.c

+ 7 - 1
commands.py

@@ -147,7 +147,7 @@ async def addgif_handler(bot, event, command):
 # Very, very, VERY evil code...
 async def make_message_shot(bot, message):
   proc = await create_subprocess_shell(
-    f'./makeshot/makeshot',
+    './makeshot/makeshot',
     stdin=PIPE
   )
 
@@ -164,6 +164,12 @@ async def make_message_shot(bot, message):
 
     full_name = get_display_name(message.sender)
 
+  # TO-DO: make it better.
+  mproc = await create_subprocess_shell(
+    f'mogrify -format png {avatar_path}'
+  )
+  await mproc.communicate()
+
   data = bytes()
 
   data += pack('I', len(output_path))

+ 1 - 1
makeshot/makeshot.c

@@ -243,7 +243,7 @@ text_t *new_text(cairo_t *cr, char *s, int size, int weight, int preprocess) {
 
   text = malloc_protected(sizeof(text_t));
 
-  font_description = pango_font_description_from_string("Apple Color Emoji 16,Sans 16");
+  font_description = pango_font_description_from_string("Apple Color Emoji 16,Open Sans 16");
   pango_font_description_set_absolute_size(font_description, size * PANGO_SCALE);
   pango_font_description_set_weight(font_description, weight);