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
2651 def [](pdf, info)
2652   @color ||= DEFAULT_COLOR
2653 
2654   desc  = info[:descender].abs
2655   xpos  = info[:x] - (desc * 2.00)
2656   ypos  = info[:y] + (desc * 1.05)
2657 
2658   pdf.save_state
2659   ss = StrokeStyle.new(desc)
2660   ss.cap  = :butt
2661   ss.join = :miter
2662   pdf.stroke_style! ss
2663   pdf.stroke_color @color
2664   pdf.circle_at(xpos, ypos, 1).stroke
2665   pdf.restore_state
2666 end