class PDF::Writer::TagDisc

A callback function to support drawing of a disc bullet style.

Constants

DEFAULT_BACKGROUND

The default disc bullet background.

DEFAULT_FOREGROUND

The default disc bullet foreground.

Attributes

background[RW]

The background color for <C:disc> bullets. Default is Color::RGB::White.

Set to nil to get the default color.

foreground[RW]

The foreground color for <C:disc> bullets. Default is Color::RGB::Black.

Set to nil to get the default color.

Public Class Methods

[](pdf, info) click to toggle source
# File lib/pdf/writer.rb, line 2677
def [](pdf, info)
  @foreground ||= DEFAULT_FOREGROUND
  @background ||= DEFAULT_BACKGROUND

  desc  = info[:descender].abs
  xpos  = info[:x] - (desc * 2.00)
  ypos  = info[:y] + (desc * 1.05)

  ss = StrokeStyle.new(desc)
  ss.cap  = :butt
  ss.join = :miter
  pdf.stroke_style! ss
  pdf.stroke_color @foreground
  pdf.circle_at(xpos, ypos, 1).stroke
  pdf.stroke_color @background
  pdf.circle_at(xpos, ypos, 0.5).stroke
end