Class | PDF::Writer::TagDisc |
In: |
lib/pdf/writer.rb
|
Parent: | Object |
A callback function to support drawing of a disc bullet style.
DEFAULT_FOREGROUND | = | Color::RGB::Black | The default disc bullet foreground. | |
DEFAULT_BACKGROUND | = | Color::RGB::White | The default disc bullet background. |
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. |
# File lib/pdf/writer.rb, line 2706 2706: def [](pdf, info) 2707: @foreground ||= DEFAULT_FOREGROUND 2708: @background ||= DEFAULT_BACKGROUND 2709: 2710: desc = info[:descender].abs 2711: xpos = info[:x] - (desc * 2.00) 2712: ypos = info[:y] + (desc * 1.05) 2713: 2714: ss = StrokeStyle.new(desc) 2715: ss.cap = :butt 2716: ss.join = :miter 2717: pdf.stroke_style! ss 2718: pdf.stroke_color @foreground 2719: pdf.circle_at(xpos, ypos, 1).stroke 2720: pdf.stroke_color @background 2721: pdf.circle_at(xpos, ypos, 0.5).stroke 2722: end