lib/forkforge/unicode.rb in forkforge-0.0.3 vs lib/forkforge/unicode.rb in forkforge-0.0.4
- old
+ new
@@ -69,9 +69,15 @@
define_method(m) { |s|
compose decompose(s), m.to_sym, :lazy
}
}
+ def fraktur s
+ s.split('').map do |c|
+ Forkforge::UnicodeData::code_points.send(:math_fraktur_bold, c).to_s
+ end.join
+ end
+
# Decomposes symbols to their combined representation, e.g. ASCII c-cedilla to 2 symbols
def decompose s, tags = []
s.codepoints.map { |cp|
Forkforge::UnicodeData::decompose_cp cp, tags
}.flatten.map { |cp| cp.to_i(16) }.pack('U*')