include_theme('lightning-rabbit') include_theme('body-background-image') @headline_logo_image = "usa1.png" include_theme("headline-logo") def Kernel.log(msg) open('log', 'w') { |f| f.puts msg.to_s } end match(TitleSlide) do |elements| elements.prop_set('size', screen_size(8) * Pango::SCALE) end match('**', BlockQuote) do |elements| elements.prop_set('size', screen_size(5.0) * Pango::SCALE) end match('*', HeadLine) do |elements| elements.prop_set('size', screen_size(5.2) * Pango::SCALE) end match('**', ItemListItem) do |elements| elements.prop_set('size', screen_size(5.0) * Pango::SCALE) elements.padding_top = 0 elements.padding_bottom = 0 elements.margin_top = 0 elements.margin_bottom = 0 end match('**', ItemListItem, '**', ItemListItem) do |elements| elements.prop_set('size', screen_size(4.0) * Pango::SCALE) elements.padding_top = 0 elements.padding_bottom = 0 elements.margin_top = 0 elements.margin_bottom = 0 end match('**', ItemListItem, '**', ItemListItem, '**', ItemListItem) do |elements| elements.prop_set('size', screen_size(3.3) * Pango::SCALE) elements.padding_top = 0 elements.padding_bottom = 0 elements.margin_top = 0 elements.margin_bottom = 0 end match('**', ItemListItem, '**', ItemListItem, '**', ItemListItem, '**', ItemListItem) do |elements| elements.prop_set('size', screen_size(3) * Pango::SCALE) elements.padding_top = 0 elements.padding_bottom = 0 elements.margin_top = 0 elements.margin_bottom = 0 elements.margin_left = screen_size(4) end match('**', Image) do |images| images.each do |image| if image.caption&.match?(/http/) image.add_pre_draw_proc(:save_url) do |canvas, x, y, w, h, simulation| unless @image_caption_font_size_backup @image_caption_font_size_backup = @image_caption_font_size @image_caption_font_size = screen_size(3) * Pango::SCALE end [x, y, w, h] end else image.add_pre_draw_proc(:restore_url) do |canvas, x, y, w, h, simulation| $stderr.puts @image_caption_font_size_backup.inspect if @image_caption_font_size_backup @image_caption_font_size = @image_caption_font_size_backup @image_caption_font_size_backup = nil end [x, y, w, h] end end end end