   alias Jumubase.Showtime.Results
 
   @border_style "1px solid black"
+  @certificate_font_size 16
+  @line_height_factor 1.3
   @muted_color "#666"
 
   @doc """

    ] |> to_lines
  end
  defp category_text(_round, %Appearance{}, %Performance{} = p) do
    [[:span, "in der Wertung für "], [:i, category_name(p)]]
  end

  defp rating_points_text(0, _, _), do: "teilgenommen."

  end

  def certificates(performances, contest) do
    render_certificate_pages(performances, contest)
    |> generate_pdf("portrait", "#{@certificate_font_size}px")
  end

  # Private helpers

  defp generate_pdf(body_html, orientation, font_size \\ "18px") do
    html = Sneeze.render([:html,
      [:head, [:meta, %{charset: "UTF-8"}]],
      [:body,
        %{style: style(%{
          "font-family" => "LatoLatin",
          "font-size" => font_size,
          "line-height" => @line_height_factor,
        })},
        body_html
      ]
