harfbuzz 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 88bd6dee65ceba054a1ff2ba5b4329bfea310689
4
- data.tar.gz: fc6e012e4e25a3f579cea5946f9e6a7afcd963e4
3
+ metadata.gz: 425a156ab5d58b38e4f614832449cc65a9d20820
4
+ data.tar.gz: 9f3f54a1a7151bd5a14b0ec8fa82f9ed37dc669e
5
5
  SHA512:
6
- metadata.gz: 4ddabd5869af1957fbe68864b1bba1f0dba915b0392f6c66549645b5d3f34ae1c6c2bffd473d104443cdd383aabcfc763dba1a1b2ffd0c2ebe28fa19fc058b7c
7
- data.tar.gz: 1d5ed18e405ae2c595d31403898facdc1722f28d268176799042cfb8f9aeb18b505bbf2dfb6eac83f0e86225472cdec2613199660dde863f1e4cb3c7d3014f9f
6
+ metadata.gz: c4f00d562f047bcfeb3314fe0252e5941d186b4a2b43321ae6f9bbc20d522bbfdcb484129303ed9485105c5a2ef116f9a6b41959461035f922f8b0bfd901dac1
7
+ data.tar.gz: e516082b7432448465b819ea6ff8ed69c2ef2572bcb8b3f00f001e2507ad14b427481b3b0852100e99b39ed86651177f4b1ff42806b4ca61c33983483b8ab55f
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  .DS_Store
2
- Gemfile.lock
2
+ Gemfile.lock
3
+ pkg/
data/README.md CHANGED
@@ -2,7 +2,7 @@ The Harfbuzz gem is a Ruby interface to the Harfbuzz text shaping engine. By usi
2
2
 
3
3
  For more information about Harfbuzz itself, see [harfbuzz.org](http://harfbuzz.org).
4
4
 
5
- For an example of use, see [example.rb](harfbuzz/examples/example.rb). From the base directory of this gem, you can run this example:
5
+ For an example of use, see [examples/example.rb](https://github.com/jslabovitz/harfbuzz-gem/blob/master/examples/example.rb). You can run this from the base directory of the gem:
6
6
 
7
7
  ruby examples/example.rb
8
8
 
@@ -53,6 +53,13 @@ There are no tests or specs.
53
53
  Memory management may not be correct.
54
54
 
55
55
 
56
+ ## To-do
57
+
58
+ Implement hb_buffer_set_* functions.
59
+
60
+ Add documentation & tests.
61
+
62
+
56
63
  ## Feedback
57
64
 
58
65
  As this is a new project, I'd love to hear your feedback. Email me at [johnl@johnlabovitz.com](mailto:johnl@johnlabovitz.com).
@@ -15,8 +15,16 @@ puts "Shapers: #{Harfbuzz.shapers.join(', ')}"
15
15
  #
16
16
 
17
17
  face = Harfbuzz::Face.new(File.open('/Library/Fonts/ACaslonPro-Regular.otf', 'rb'))
18
+
19
+ puts "Font face index: #{face.index}"
20
+ puts "Font face upem: #{face.upem}"
21
+ puts "Font face glyph count: #{face.glyph_count}"
22
+
18
23
  font = Harfbuzz::Font.new(face)
19
24
 
25
+ puts "Font scale: #{font.scale}"
26
+ puts "Font ppem: #{font.ppem}"
27
+
20
28
  #
21
29
  # Create a buffer to hold the text and the resulting glyphs/positions.
22
30
  #
@@ -30,6 +30,12 @@ module Harfbuzz
30
30
  ]
31
31
  end
32
32
 
33
+ MinimumHarfbuzzVersion = '1.0.4'
34
+
35
+ unless Gem::Version.new(Harfbuzz.version_string) >= Gem::Version.new(MinimumHarfbuzzVersion)
36
+ raise "Harfbuzz C library is version #{Harfbuzz.version_string}, but this gem requires version #{MinimumHarfbuzzVersion} or later"
37
+ end
38
+
33
39
  end
34
40
 
35
41
  require 'harfbuzz/base'
@@ -26,7 +26,7 @@ module Harfbuzz
26
26
  raise "Unknown input type: #{input.class}"
27
27
  end
28
28
  @hb_face = Harfbuzz.hb_face_create(blob.hb_blob, face_index)
29
- define_finalizer(:hb_buffer_destroy, @hb_face)
29
+ define_finalizer(:hb_face_destroy, @hb_face)
30
30
  end
31
31
 
32
32
  def index
@@ -22,7 +22,7 @@ module Harfbuzz
22
22
  attach_function :hb_font_glyph_to_string, [
23
23
  :hb_font_t, # font
24
24
  :hb_codepoint_t, # glyph
25
- :pointer, # s
25
+ :pointer, # string
26
26
  :uint, # size
27
27
  ], :void
28
28
 
@@ -1,5 +1,5 @@
1
1
  module Harfbuzz
2
2
 
3
- VERSION = '0.1'
3
+ VERSION = '0.2'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: harfbuzz
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Labovitz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-02 00:00:00.000000000 Z
11
+ date: 2015-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  version: '0'
95
95
  requirements: []
96
96
  rubyforge_project:
97
- rubygems_version: 2.4.8
97
+ rubygems_version: 2.5.0
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: Ruby interface to the Harfbuzz text shaping engine