Class PDF::Writer::TagDisc
In: lib/pdf/writer.rb
Parent: Object
TechBook Transaction::Simple SimpleTable Complex Action FontDescriptor Procset Catalog FontEncoding Pages Destination Info Encryption Annotation Contents Outline Page Outlines Font ViewerPreferences Image Hash OHash QuickRef StdDev FontMetrics StrokeStyle ARC4 PolygonPoint ImageInfo lib/pdf/simpletable.rb lib/pdf/writer.rb lib/pdf/techbook.rb lib/pdf/quickref.rb lib/pdf/charts/stddev.rb Charts Math lib/pdf/writer/ohash.rb lib/pdf/writer/fontmetrics.rb lib/pdf/writer/strokestyle.rb lib/pdf/writer/arc4.rb lib/pdf/writer/graphics.rb lib/pdf/writer/object.rb lib/pdf/writer/object/image.rb External lib/pdf/writer/object/font.rb lib/pdf/writer/object/outlines.rb lib/pdf/writer/object/contents.rb lib/pdf/writer/object/annotation.rb lib/pdf/writer/object/destination.rb lib/pdf/writer/object/viewerpreferences.rb lib/pdf/writer/object/info.rb lib/pdf/writer/object/fontencoding.rb lib/pdf/writer/object/page.rb lib/pdf/writer/object/catalog.rb lib/pdf/writer/object/outline.rb lib/pdf/writer/object/encryption.rb lib/pdf/writer/object/procset.rb lib/pdf/writer/object/action.rb lib/pdf/writer/object/pages.rb lib/pdf/writer/object/fontdescriptor.rb Object OffsetReader EN Lang lib/pdf/writer/graphics/imageinfo.rb Graphics Writer 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 2677
2677:       def [](pdf, info)
2678:         @foreground ||= DEFAULT_FOREGROUND
2679:         @background ||= DEFAULT_BACKGROUND
2680: 
2681:         desc  = info[:descender].abs
2682:         xpos  = info[:x] - (desc * 2.00)
2683:         ypos  = info[:y] + (desc * 1.05)
2684: 
2685:         ss = StrokeStyle.new(desc)
2686:         ss.cap  = :butt
2687:         ss.join = :miter
2688:         pdf.stroke_style! ss
2689:         pdf.stroke_color @foreground
2690:         pdf.circle_at(xpos, ypos, 1).stroke
2691:         pdf.stroke_color @background
2692:         pdf.circle_at(xpos, ypos, 0.5).stroke
2693:       end

[Validate]