diff --git a/GenPoster/app.py b/GenPoster/app.py index 346e6d6..93e46be 100644 --- a/GenPoster/app.py +++ b/GenPoster/app.py @@ -82,7 +82,8 @@ def main(): theme = 'day' # Alto y ancho de la imagen en pixeles - height, width = 40, 160 + # height, width = 40, 160 + height, width = 200, 800 # Inicia el dibujo y setea el tema full_panel = MyDraw(height=height, width=width) @@ -112,8 +113,9 @@ def main(): bus_announcement_1 = { 'proportion': 0.6, - 'width_border': 2, - 'font_size': 11, + 'width_border': 3, + # 'font_size': 11, + 'font_size': 80, 'number_background_color': 'yellow', 'letter_background_color': 'green', } @@ -133,8 +135,9 @@ def main(): bus_announcement_2 = { 'proportion': 0.6, - 'width_border': 2, - 'font_size': 11, + 'width_border': 3, + # 'font_size': 11, + 'font_size': 80, 'number_background_color': 'yellow', 'letter_background_color': 'blue', } @@ -145,7 +148,7 @@ def main(): poster2.set_colors() # Se setea la ruta y la direccion en la que va poster2.set_bus_number(bus_number="16") - poster2.set_bus_letter(bus_letter="I") + poster2.set_bus_letter(bus_letter="H") # Se agregan todas las imagenes al canvas full_panel.add_image(time_anmc1, (aprox((0.6)*width), aprox(0.05*height))) diff --git a/GenPoster/example/poster.png b/GenPoster/example/poster.png index 23697ba..38b6a09 100644 Binary files a/GenPoster/example/poster.png and b/GenPoster/example/poster.png differ diff --git a/GenPoster/run_container.sh b/GenPoster/run_container.sh index 5e537b1..e533338 100755 --- a/GenPoster/run_container.sh +++ b/GenPoster/run_container.sh @@ -6,7 +6,5 @@ data_path=$project_folder_path/data scripts_path=$project_folder_path/scripts assets_path=$project_folder_path/assets - - # Ejecuta el contenedor con el enlace de carpeta local -docker run --rm -d -p 8888:8888 --name make_poster -v $data_path:/app/data -v $assets_path:/app/assets -v $scripts_path:/app/scripts bus_poster \ No newline at end of file +docker run --rm -d -p 8888:8888 --name make_poster -v $data_path:/app/data -v $assets_path:/app/assets -v $scripts_path:/app/scripts -v $project_folder_path:/app bus_poster \ No newline at end of file diff --git a/GenPoster/scripts/Poster/BusPoster.py b/GenPoster/scripts/Poster/BusPoster.py index 86ff6e8..6dfd079 100644 --- a/GenPoster/scripts/Poster/BusPoster.py +++ b/GenPoster/scripts/Poster/BusPoster.py @@ -37,10 +37,12 @@ class BusPoster(MyDraw): def set_bus_number(self, bus_number="11"): text_color = 'black' width_border = self.prms['width_border'] + # width_border = 0 text_bbox = self.font.getbbox(str(bus_number)) font_width, font_height = text_bbox[2] - text_bbox[0], text_bbox[3] - text_bbox[1] offset_width = np.round((self.prms['proportion']*self.width-width_border)/2) - np.round(font_width/2) - text_position = (offset_width,0) + # offset_width = 0 + text_position = (offset_width,-15) self.draw.text( text_position, bus_number, @@ -57,7 +59,7 @@ class BusPoster(MyDraw): text_bbox = self.font.getbbox(str(bus_letter)) font_width, font_height = text_bbox[2] - text_bbox[0], text_bbox[3] - text_bbox[1] offset_width = np.round((proportion*self.width-width_border)) + 0.75*np.round(font_width/2) - text_position = (1.1*offset_width,0) + text_position = (1.1*offset_width,-15) self.draw.text( text_position, bus_letter, diff --git a/GenPoster/scripts/Poster/TimeAnnouncement.py b/GenPoster/scripts/Poster/TimeAnnouncement.py index bffcd11..6106358 100644 --- a/GenPoster/scripts/Poster/TimeAnnouncement.py +++ b/GenPoster/scripts/Poster/TimeAnnouncement.py @@ -45,7 +45,7 @@ class TimeAnnouncement(MyDraw): text = "Tiempo aprox" text_color = self.theme_params['text_color'] - self.load_barlow(font_size=11) + self.load_barlow(font_size=70) text_bbox = self.font.getbbox(text) base_font_width, base_font_height = text_bbox[2] - text_bbox[0], text_bbox[3] - text_bbox[1] @@ -56,14 +56,14 @@ class TimeAnnouncement(MyDraw): else: text = f'{min_time} a {max_time} min' - self.load_barlow(font_size=12) + self.load_barlow(font_size=70) text_bbox = self.font.getbbox(text) font_width, font_height = text_bbox[2] - text_bbox[0], text_bbox[3] - text_bbox[1] # print(font_width, font_height) offset_width = (np.round((self.width-self.border)) - np.round(font_width))/2 offset_height = (np.round((self.height-self.border)) - np.round(base_font_height))/2 # text_position = (offset_width,5+offset_height) - text_position = (offset_width,offset_height) + text_position = (offset_width,offset_height-10) # text_position = (0, 0) self.draw.text( text_position,