class PDF::Writer::TagBullet

A callback function to support drawing of a solid bullet style. Use with <C:bullet>.

Constants

DEFAULT_COLOR

The default bullet color.

Attributes

color[RW]

Sets the style for <C:bullet> callback bullets that follow. Default is Color::RGB::Black.

Set this to nil to get the default colour.

Public Class Methods

[](pdf, info) click to toggle source
# File lib/pdf/writer.rb, line 2640
def [](pdf, info)
  @color ||= DEFAULT_COLOR

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

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