Class: HarfBuzz::Subset::Input
- Inherits:
-
Object
- Object
- HarfBuzz::Subset::Input
- Defined in:
- lib/harfbuzz/subset.rb
Overview
Wraps hb_subset_input_t — specifies what to include in a subset
Instance Attribute Summary collapse
-
#ptr ⇒ Object
readonly
Returns the value of attribute ptr.
Class Method Summary collapse
Instance Method Summary collapse
-
#flags ⇒ Integer
Current flags bitmask.
- #flags=(flags) ⇒ Object
-
#glyph_set ⇒ HarfBuzz::Set
Returns the set of glyph IDs to include (borrowed reference).
-
#initialize ⇒ Input
constructor
Creates a new subset input.
- #inspect ⇒ Object
-
#unicode_set ⇒ HarfBuzz::Set
Returns the set of Unicode codepoints to include (borrowed reference).
Constructor Details
#initialize ⇒ Input
Creates a new subset input
33 34 35 36 37 38 39 40 |
# File 'lib/harfbuzz/subset.rb', line 33 def initialize raise UnavailableError, "libharfbuzz-subset is not available" unless C.available? @ptr = C.hb_subset_input_create_or_fail raise AllocationError, "Failed to create subset input" if @ptr.null? HarfBuzz::Subset::Input.define_finalizer(self, @ptr) end |
Instance Attribute Details
#ptr ⇒ Object (readonly)
Returns the value of attribute ptr.
28 29 30 |
# File 'lib/harfbuzz/subset.rb', line 28 def ptr @ptr end |
Class Method Details
.define_finalizer(obj, ptr) ⇒ Object
68 69 70 71 |
# File 'lib/harfbuzz/subset.rb', line 68 def self.define_finalizer(obj, ptr) destroy = C.method(:hb_subset_input_destroy) ObjectSpace.define_finalizer(obj, proc { destroy.call(ptr) }) end |
Instance Method Details
#flags ⇒ Integer
Returns Current flags bitmask.
55 56 57 |
# File 'lib/harfbuzz/subset.rb', line 55 def flags C.hb_subset_input_get_flags(@ptr) end |
#flags=(flags) ⇒ Object
60 61 62 |
# File 'lib/harfbuzz/subset.rb', line 60 def flags=(flags) C.hb_subset_input_set_flags(@ptr, flags) end |
#glyph_set ⇒ HarfBuzz::Set
Returns the set of glyph IDs to include (borrowed reference)
50 51 52 |
# File 'lib/harfbuzz/subset.rb', line 50 def glyph_set HarfBuzz::Set.wrap_borrowed(C.hb_subset_input_glyph_set(@ptr)) end |
#inspect ⇒ Object
64 65 66 |
# File 'lib/harfbuzz/subset.rb', line 64 def inspect "#<HarfBuzz::Subset::Input flags=#{flags}>" end |
#unicode_set ⇒ HarfBuzz::Set
Returns the set of Unicode codepoints to include (borrowed reference)
44 45 46 |
# File 'lib/harfbuzz/subset.rb', line 44 def unicode_set HarfBuzz::Set.wrap_borrowed(C.hb_subset_input_unicode_set(@ptr)) end |