summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2015-08-02 02:53:03 -0600
committerDan Allen <dan.j.allen@gmail.com>2015-08-02 02:56:22 -0600
commitdbce17031083f97e9cc54560df4a5df2f1983d59 (patch)
treed6ff4fef9417a033fde9f1cf12e66063e5781214
parentf947a6864559de20a96c115d7a5c7bb067b728fc (diff)
replace unicode_char method with direct unicode sequences
- write unicode char as %(\uXXXX) instead of unicode_char method - add example of checklist to chronicles
-rw-r--r--examples/chronicles-example.adoc8
-rw-r--r--examples/chronicles-example.pdfbin179677 -> 180013 bytes
-rw-r--r--lib/asciidoctor-pdf/converter.rb28
-rw-r--r--lib/asciidoctor-pdf/formatted_text/inline_image_arranger.rb2
-rw-r--r--lib/asciidoctor-pdf/formatted_text/transform.rb4
5 files changed, 22 insertions, 20 deletions
diff --git a/examples/chronicles-example.adoc b/examples/chronicles-example.adoc
index 503f3fe5..455edfc7 100644
--- a/examples/chronicles-example.adoc
+++ b/examples/chronicles-example.adoc
@@ -107,13 +107,19 @@ This potion for a sample document contains the following ingredients, which are
**** two fresh Burdockian leaves
***** They must be harvested by the light of the teal moons.
-Got square?
+Are you square?
[square]
* one
* two
* three
+TODO?
+
+* [x] Done
+* [ ] Next
+* Who's counting?
+
==== Searching for Burdockian
.Steps for finding and preparing Burdockian leaves
diff --git a/examples/chronicles-example.pdf b/examples/chronicles-example.pdf
index 366c3f71..abab9c50 100644
--- a/examples/chronicles-example.pdf
+++ b/examples/chronicles-example.pdf
Binary files differ
diff --git a/lib/asciidoctor-pdf/converter.rb b/lib/asciidoctor-pdf/converter.rb
index a721cf9b..b6843a7f 100644
--- a/lib/asciidoctor-pdf/converter.rb
+++ b/lib/asciidoctor-pdf/converter.rb
@@ -27,10 +27,6 @@ class Converter < ::Prawn::Document
register_for 'pdf'
- def self.unicode_char number
- [number].pack 'U*'
- end
-
# NOTE require_library doesn't support require_relative and we don't modify the load path for this gem
CodeRayRequirePath = ::File.join (::File.dirname __FILE__), 'prawn_ext/coderay_encoder'
RougeRequirePath = ::File.join (::File.dirname __FILE__), 'rouge_ext'
@@ -53,23 +49,23 @@ class Converter < ::Prawn::Document
GuardedInnerIndent = %(\n\u00a0)
TabRx = /\t/
TabIndentRx = /^\t+/
- NoBreakSpace = unicode_char 0x00a0
- NarrowSpace = unicode_char 0x2009
- NarrowNoBreakSpace = unicode_char 0x202f
- ZeroWidthSpace = unicode_char 0x200b
- HairSpace = unicode_char 0x200a
+ NoBreakSpace = %(\u00a0)
+ NarrowSpace = %(\u2009)
+ NarrowNoBreakSpace = %(\u202f)
+ ZeroWidthSpace = %(\u200b)
+ HairSpace = %(\u200a)
DotLeaderDefault = '. '
- EmDash = unicode_char 0x2014
- LowercaseGreekA = unicode_char 0x03b1
+ EmDash = %(\u2014)
+ LowercaseGreekA = %(\u03b1)
Bullets = {
- disc: (unicode_char 0x2022),
- circle: (unicode_char 0x25e6),
- square: (unicode_char 0x25aa)
+ disc: %(\u2022),
+ circle: %(\u25e6),
+ square: %(\u25aa)
}
# NOTE Default theme font uses ballot boxes from FontAwesome
BallotBox = {
- checked: (unicode_char 0x2611),
- unchecked: (unicode_char 0x2610)
+ checked: %(\u2611),
+ unchecked: %(\u2610)
}
IconSets = ['fa', 'fi', 'octicon', 'pf'].to_set
MeasurementRxt = '\\d+(?:\\.\\d+)?(?:in|cm|mm|pt|)'
diff --git a/lib/asciidoctor-pdf/formatted_text/inline_image_arranger.rb b/lib/asciidoctor-pdf/formatted_text/inline_image_arranger.rb
index 3112ab7e..b2e10ebc 100644
--- a/lib/asciidoctor-pdf/formatted_text/inline_image_arranger.rb
+++ b/lib/asciidoctor-pdf/formatted_text/inline_image_arranger.rb
@@ -1,6 +1,6 @@
module Asciidoctor::Pdf::FormattedText
module InlineImageArranger
- #ImagePlaceholderChar = [0x00a0].pack 'U*'
+ #ImagePlaceholderChar = %(\u00a0)
ImagePlaceholderChar = '.'
begin
require 'thread_safe' unless defined? ::ThreadSafe
diff --git a/lib/asciidoctor-pdf/formatted_text/transform.rb b/lib/asciidoctor-pdf/formatted_text/transform.rb
index 8992636f..193bc0df 100644
--- a/lib/asciidoctor-pdf/formatted_text/transform.rb
+++ b/lib/asciidoctor-pdf/formatted_text/transform.rb
@@ -10,7 +10,7 @@ class Transform
:quot => '"',
:apos => '\''
}
- #ZeroWidthSpace = [0x200b].pack 'U*'
+ #ZeroWidthSpace = %(\u200b)
def initialize(options = {})
@merge_adjacent_text_nodes = options[:merge_adjacent_text_nodes]
@@ -105,7 +105,7 @@ class Transform
if (name = node[:name])
text = NamedEntityTable[name]
else
- # NOTE AFM fonts do not include a thin space glyph; set fallback_fonts to allow glyph to be resolved
+ # FIXME AFM fonts do not include a thin space glyph; set fallback_fonts to allow glyph to be resolved
text = [node[:number]].pack('U*')
end
# NOTE the remaining logic is shared with :text