4

在 CSS 中,您可以对背景图像进行自定义下划线。此处解释了此技术:

http://alistapart.com/article/customunderlines

使用这种技术,我可以做这样的事情:

在此处输入图像描述

使用 Prawn,我所知道的唯一下划线是使用内联格式:

text "<u>Ugly Underline</u>", size: 60, inline_format: TRUE

在此处输入图像描述

我对某些人有细微的差别,但作为一名平面设计师,这一切都不同。

有谁知道是否有任何技术可以让我使用 Prawn 进行自定义下划线?

4

2 回答 2

1

我最终使用了 formatted_text_box 的 :callback 选项。

class CustomUnderlineCallback

  def initialize(options)
    @document = options[:document]
  end

  def render_in_front(fragment)
    @document.stroke_color COLOR_WHITE
    @document.stroke_polygon fragment.bottom_left, fragment.bottom_right
    @document.stroke_color COLOR_BLACK
  end

end
于 2013-10-23T00:05:54.057 回答
0

尝试这个:

table([["Does this work?"]] , :cell_style => {:borders => [:bottom]})

有设置border-color width等选项。

于 2013-10-22T00:03:03.467 回答