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
2688 def [](pdf, info)
2689   @foreground ||= DEFAULT_FOREGROUND
2690   @background ||= DEFAULT_BACKGROUND
2691 
2692   desc  = info[:descender].abs
2693   xpos  = info[:x] - (desc * 2.00)
2694   ypos  = info[:y] + (desc * 1.05)
2695 
2696   ss = StrokeStyle.new(desc)
2697   ss.cap  = :butt
2698   ss.join = :miter
2699   pdf.stroke_style! ss
2700   pdf.stroke_color @foreground
2701   pdf.circle_at(xpos, ypos, 1).stroke
2702   pdf.stroke_color @background
2703   pdf.circle_at(xpos, ypos, 0.5).stroke
2704 end