obf 0.9.8.1 → 0.9.8.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
  SHA256:
3
- metadata.gz: d8b2361fdfec99c8b50a2be0021d61aa9c4c545caf09989fd6d96f9e732f5917
4
- data.tar.gz: 2fbabe6385416a48422f7ceb1a07a6e7391cd06604f0a59ae17f4758bf1d3f56
3
+ metadata.gz: 10054b15d7b19f6aae4d388b339c8cc105dd091190f687f5b25959f11f4aafbf
4
+ data.tar.gz: 5aff0330d3b04d67f50a2abd4aed606c11b1fba8890f40f113467bc3532edf40
5
5
  SHA512:
6
- metadata.gz: 10ce2547b65c2da2eb44d74cb3095488e502aacdc1cf8f4be3156f5c187d788191f69bd09edb84db69f776f2f48746271bb21f7387f53976acaa40e2d2a8fa65
7
- data.tar.gz: d6bfda8a750433d93b8a9d011da253a14d3e98da3c5fec23acbfaa227d4160d80d3974560b5644406f7734e69534f3d8d0ff6e28edca1195338522e30ce6d83e
6
+ metadata.gz: 2604356e2cd9b5940417eefc1cf81c1c7c63693e1803b03c707f624eaab449cea0f2120f3db10cae751132052432f1034495ec0c3f042e592b3e6f0be987d369
7
+ data.tar.gz: b949477c4d8691570b76db29f56a3a0c01babd426096a0b8cb0c14d2f4ec39db0081dad57c81f0725d45e6fbaf41a9aad365df297e6b841618e679c3b10971b3
Binary file
data/lib/obf/pdf.rb CHANGED
@@ -46,10 +46,13 @@ module OBF::PDF
46
46
  pdf.font_families['THFahKwangBold'] = {
47
47
  normal: {font: 'THFahKwangBold', file: File.expand_path('../../THFahKwangBold.ttf', __FILE__)}
48
48
  }
49
- pdf.font_families['Nepali'] = {
50
- normal: {font: 'Nepali', file: File.expand_path('../../Nepali.ttf', __FILE__)}
49
+ pdf.font_families['MangalRegular'] = {
50
+ normal: {font: 'MangalRegular', file: File.expand_path('../../MangalRegular.ttf', __FILE__)}
51
51
  }
52
- pdf.fallback_fonts = ['THFahKwangBold', 'Nepali']
52
+ pdf.font_families['TimesNewRoman'] = {
53
+ normal: {font: 'TimesNewRoman', file: File.expand_path('../../TimesNewRoman.ttf', __FILE__)}
54
+ }
55
+ pdf.fallback_fonts = ['TimesNewRoman', 'THFahKwangBold', 'MangalRegular']
53
56
 
54
57
  font = opts['font'] if opts['font'] && File.exists?(opts['font'])
55
58
  font ||= File.expand_path('../../TimesNewRoman.ttf', __FILE__)
@@ -198,11 +201,9 @@ module OBF::PDF
198
201
 
199
202
  text = (button['label'] || button['vocalization']).to_s
200
203
  font = options['font']
201
- if text.match(/\p{Thai}/)
202
- font = File.expand_path('../../THFahKwangBold.ttf', __FILE__)
203
- # TODO: I think this can be moved to fallback_fonts instead
204
- # elsif text.match(Regexp.new("[" + NEPALI_ALPHABET + "]")
205
- # font = File.expand_path('../../Nepali.ttf', __FILE__)
204
+ # Nepali text isn't working as a fallback for some reason, it says "bad font family"
205
+ if text.match(Regexp.new("[" + NEPALI_ALPHABET + "]"))
206
+ font = File.expand_path('../../MangalRegular.ttf', __FILE__)
206
207
  end
207
208
  pdf.font(font) if font && File.exists?(font)
208
209
  direction = text.match(rtl_regex) ? :rtl : :ltr
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8.1
4
+ version: 0.9.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Whitmer
@@ -145,7 +145,7 @@ extra_rdoc_files:
145
145
  files:
146
146
  - LICENSE
147
147
  - README.md
148
- - lib/Nepali.ttf
148
+ - lib/MangalRegular.ttf
149
149
  - lib/THFahKwangBold.ttf
150
150
  - lib/TimesNewRoman.ttf
151
151
  - lib/obf.rb
data/lib/Nepali.ttf DELETED
Binary file