Class PDF::Writer::TagDisc
In: lib/pdf/writer.rb
Parent: Object
Transaction::Simple SimpleTable TechBook Complex Action Procset FontDescriptor FontEncoding Destination Info Catalog Encryption Contents Pages Outline Outlines Annotation Page Font ViewerPreferences Image Hash OHash QuickRef FontMetrics ARC4 StrokeStyle PolygonPoint ImageInfo StdDev lib/pdf/simpletable.rb lib/pdf/techbook.rb lib/pdf/writer.rb lib/pdf/quickref.rb Math lib/pdf/writer/fontmetrics.rb lib/pdf/writer/ohash.rb lib/pdf/writer/arc4.rb lib/pdf/writer/strokestyle.rb lib/pdf/writer/graphics.rb lib/pdf/writer/object.rb lib/pdf/writer/object/image.rb External EN Lang OffsetReader lib/pdf/writer/graphics/imageinfo.rb Graphics lib/pdf/writer/object/outlines.rb lib/pdf/writer/object/destination.rb lib/pdf/writer/object/viewerpreferences.rb lib/pdf/writer/object/fontencoding.rb lib/pdf/writer/object/page.rb lib/pdf/writer/object/contents.rb lib/pdf/writer/object/procset.rb lib/pdf/writer/object/pages.rb lib/pdf/writer/object/info.rb lib/pdf/writer/object/encryption.rb lib/pdf/writer/object/catalog.rb lib/pdf/writer/object/outline.rb lib/pdf/writer/object/fontdescriptor.rb lib/pdf/writer/object/action.rb lib/pdf/writer/object/font.rb lib/pdf/writer/object/annotation.rb Object Writer lib/pdf/charts/stddev.rb Charts PDF dot/m_33_0.png

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

Methods

[]  

Constants

DEFAULT_FOREGROUND = Color::RGB::Black   The default disc bullet foreground.
DEFAULT_BACKGROUND = Color::RGB::White   The default disc bullet background.

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

[Source]

      # 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

[Validate]