asciidoctor-pdf 1.5.0.alpha.16 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +5 -5
  2. data/.yardopts +12 -0
  3. data/CHANGELOG.adoc +415 -1
  4. data/LICENSE.adoc +1 -1
  5. data/NOTICE.adoc +14 -11
  6. data/README.adoc +647 -222
  7. data/asciidoctor-pdf.gemspec +47 -44
  8. data/bin/asciidoctor-pdf +5 -9
  9. data/bin/asciidoctor-pdf-optimize +20 -0
  10. data/data/fonts/ABOUT-mplus1mn-subset +26 -0
  11. data/data/fonts/ABOUT-mplus1p-subset +26 -0
  12. data/data/fonts/ABOUT-notoemoji-subset +3 -0
  13. data/data/fonts/ABOUT-notoserif-subset +26 -0
  14. data/data/fonts/{LICENSE-mplus-testflight-58 → LICENSE-mplus} +2 -2
  15. data/data/fonts/{LICENSE-noto-2015-06-05 → LICENSE-notoserif} +0 -0
  16. data/data/fonts/mplus1mn-bold-ascii.ttf +0 -0
  17. data/data/fonts/mplus1mn-bold-subset.ttf +0 -0
  18. data/data/fonts/mplus1mn-bold_italic-ascii.ttf +0 -0
  19. data/data/fonts/mplus1mn-bold_italic-subset.ttf +0 -0
  20. data/data/fonts/mplus1mn-italic-ascii.ttf +0 -0
  21. data/data/fonts/mplus1mn-italic-subset.ttf +0 -0
  22. data/data/fonts/mplus1mn-regular-ascii-conums.ttf +0 -0
  23. data/data/fonts/mplus1mn-regular-subset.ttf +0 -0
  24. data/data/fonts/mplus1p-regular-fallback.ttf +0 -0
  25. data/data/fonts/notoemoji-subset.ttf +0 -0
  26. data/data/fonts/notoserif-bold-subset.ttf +0 -0
  27. data/data/fonts/notoserif-bold_italic-subset.ttf +0 -0
  28. data/data/fonts/notoserif-italic-subset.ttf +0 -0
  29. data/data/fonts/notoserif-regular-subset.ttf +0 -0
  30. data/data/themes/base-theme.yml +26 -4
  31. data/data/themes/default-theme.yml +76 -60
  32. data/data/themes/default-with-fallback-font-theme.yml +9 -0
  33. data/docs/theming-guide.adoc +2731 -922
  34. data/lib/asciidoctor/pdf/converter.rb +4489 -0
  35. data/lib/asciidoctor/pdf/ext/asciidoctor/abstract_block.rb +7 -0
  36. data/lib/asciidoctor/pdf/ext/asciidoctor/abstract_node.rb +7 -0
  37. data/lib/asciidoctor/pdf/ext/asciidoctor/document.rb +5 -0
  38. data/lib/asciidoctor/pdf/ext/asciidoctor/image.rb +35 -0
  39. data/lib/{asciidoctor-pdf/asciidoctor_ext → asciidoctor/pdf/ext/asciidoctor}/list.rb +4 -2
  40. data/lib/{asciidoctor-pdf/asciidoctor_ext → asciidoctor/pdf/ext/asciidoctor}/list_item.rb +3 -1
  41. data/lib/asciidoctor/pdf/ext/asciidoctor/logging_shim.rb +33 -0
  42. data/lib/asciidoctor/pdf/ext/asciidoctor/section.rb +45 -0
  43. data/lib/asciidoctor/pdf/ext/asciidoctor.rb +11 -0
  44. data/lib/{asciidoctor-pdf/core_ext → asciidoctor/pdf/ext/core}/array.rb +6 -6
  45. data/lib/asciidoctor/pdf/ext/core/file.rb +9 -0
  46. data/lib/asciidoctor/pdf/ext/core/hash.rb +7 -0
  47. data/lib/asciidoctor/pdf/ext/core/numeric.rb +26 -0
  48. data/lib/{asciidoctor-pdf/core_ext → asciidoctor/pdf/ext/core}/object.rb +3 -1
  49. data/lib/{asciidoctor-pdf/core_ext → asciidoctor/pdf/ext/core}/quantifiable_stdout.rb +9 -1
  50. data/lib/asciidoctor/pdf/ext/core/regexp.rb +5 -0
  51. data/lib/{asciidoctor-pdf/core_ext → asciidoctor/pdf/ext/core}/string.rb +9 -13
  52. data/lib/asciidoctor/pdf/ext/core.rb +10 -0
  53. data/lib/asciidoctor/pdf/ext/pdf-core/page.rb +54 -0
  54. data/lib/asciidoctor/pdf/ext/pdf-core/pdf_object.rb +8 -0
  55. data/lib/asciidoctor/pdf/ext/pdf-core.rb +4 -0
  56. data/lib/asciidoctor/pdf/ext/prawn/coderay_encoder.rb +117 -0
  57. data/lib/asciidoctor/pdf/ext/prawn/extensions.rb +922 -0
  58. data/lib/{asciidoctor-pdf/prawn_ext → asciidoctor/pdf/ext/prawn}/font/afm.rb +14 -10
  59. data/lib/asciidoctor/pdf/ext/prawn/font_metric_cache.rb +9 -0
  60. data/lib/asciidoctor/pdf/ext/prawn/formatted_text/box.rb +66 -0
  61. data/lib/{asciidoctor-pdf/prawn_ext → asciidoctor/pdf/ext/prawn}/formatted_text/fragment.rb +21 -18
  62. data/lib/asciidoctor/pdf/ext/prawn/images.rb +54 -0
  63. data/lib/asciidoctor/pdf/ext/prawn-svg/interface.rb +14 -0
  64. data/lib/asciidoctor/pdf/ext/prawn-svg.rb +6 -0
  65. data/lib/asciidoctor/pdf/ext/prawn-table/cell/asciidoc.rb +76 -0
  66. data/lib/{asciidoctor-pdf/prawn-table_ext → asciidoctor/pdf/ext/prawn-table}/cell/text.rb +6 -3
  67. data/lib/asciidoctor/pdf/ext/prawn-table/cell.rb +60 -0
  68. data/lib/asciidoctor/pdf/ext/prawn-table.rb +6 -0
  69. data/lib/{asciidoctor-pdf/prawn-templates_ext.rb → asciidoctor/pdf/ext/prawn-templates.rb} +2 -0
  70. data/lib/asciidoctor/pdf/ext/prawn.rb +9 -0
  71. data/lib/asciidoctor/pdf/ext/pygments.rb +34 -0
  72. data/lib/asciidoctor/pdf/ext/rouge/formatters/prawn.rb +208 -0
  73. data/lib/{asciidoctor-pdf/rouge_ext/themes/pastie.rb → asciidoctor/pdf/ext/rouge/themes/asciidoctor_pdf_default.rb} +7 -5
  74. data/lib/asciidoctor/pdf/ext/rouge.rb +5 -0
  75. data/lib/asciidoctor/pdf/ext.rb +9 -0
  76. data/lib/asciidoctor/pdf/formatted_text/formatter.rb +43 -0
  77. data/lib/asciidoctor/pdf/formatted_text/fragment_position_renderer.rb +14 -0
  78. data/lib/asciidoctor/pdf/formatted_text/inline_destination_marker.rb +21 -0
  79. data/lib/asciidoctor/pdf/formatted_text/inline_image_arranger.rb +134 -0
  80. data/lib/asciidoctor/pdf/formatted_text/inline_image_renderer.rb +51 -0
  81. data/lib/asciidoctor/pdf/formatted_text/inline_text_aligner.rb +22 -0
  82. data/lib/{asciidoctor-pdf → asciidoctor/pdf}/formatted_text/parser.rb +175 -53
  83. data/lib/{asciidoctor-pdf → asciidoctor/pdf}/formatted_text/parser.treetop +20 -14
  84. data/lib/asciidoctor/pdf/formatted_text/source_wrap.rb +43 -0
  85. data/lib/asciidoctor/pdf/formatted_text/text_background_and_border_renderer.rb +55 -0
  86. data/lib/asciidoctor/pdf/formatted_text/transform.rb +394 -0
  87. data/lib/{asciidoctor-pdf → asciidoctor/pdf}/formatted_text.rb +6 -0
  88. data/lib/asciidoctor/pdf/index_catalog.rb +133 -0
  89. data/lib/asciidoctor/pdf/measurements.rb +62 -0
  90. data/lib/asciidoctor/pdf/optimizer.rb +44 -0
  91. data/lib/asciidoctor/pdf/pdfmark.rb +41 -0
  92. data/lib/asciidoctor/pdf/roman_numeral.rb +128 -0
  93. data/lib/asciidoctor/pdf/sanitizer.rb +45 -0
  94. data/lib/asciidoctor/pdf/text_transformer.rb +116 -0
  95. data/lib/asciidoctor/pdf/theme_loader.rb +305 -0
  96. data/lib/asciidoctor/pdf/version.rb +8 -0
  97. data/lib/asciidoctor/pdf.rb +15 -0
  98. data/lib/asciidoctor-pdf/converter.rb +2 -3343
  99. data/lib/asciidoctor-pdf/version.rb +3 -5
  100. data/lib/asciidoctor-pdf.rb +3 -3
  101. metadata +242 -128
  102. data/Gemfile +0 -22
  103. data/Rakefile +0 -81
  104. data/lib/asciidoctor-pdf/asciidoctor_ext/image.rb +0 -24
  105. data/lib/asciidoctor-pdf/asciidoctor_ext/section.rb +0 -34
  106. data/lib/asciidoctor-pdf/asciidoctor_ext.rb +0 -5
  107. data/lib/asciidoctor-pdf/core_ext/numeric.rb +0 -15
  108. data/lib/asciidoctor-pdf/core_ext/ostruct.rb +0 -17
  109. data/lib/asciidoctor-pdf/core_ext.rb +0 -4
  110. data/lib/asciidoctor-pdf/formatted_text/formatter.rb +0 -27
  111. data/lib/asciidoctor-pdf/formatted_text/inline_destination_marker.rb +0 -21
  112. data/lib/asciidoctor-pdf/formatted_text/inline_image_arranger.rb +0 -172
  113. data/lib/asciidoctor-pdf/formatted_text/inline_image_renderer.rb +0 -46
  114. data/lib/asciidoctor-pdf/formatted_text/transform.rb +0 -261
  115. data/lib/asciidoctor-pdf/implicit_header_processor.rb +0 -63
  116. data/lib/asciidoctor-pdf/index_catalog.rb +0 -119
  117. data/lib/asciidoctor-pdf/measurements.rb +0 -58
  118. data/lib/asciidoctor-pdf/pdf-core_ext/page.rb +0 -25
  119. data/lib/asciidoctor-pdf/pdf-core_ext/pdf_object.rb +0 -6
  120. data/lib/asciidoctor-pdf/pdf-core_ext.rb +0 -2
  121. data/lib/asciidoctor-pdf/pdfmark.rb +0 -33
  122. data/lib/asciidoctor-pdf/prawn-svg_ext/interface.rb +0 -10
  123. data/lib/asciidoctor-pdf/prawn-svg_ext.rb +0 -4
  124. data/lib/asciidoctor-pdf/prawn-table_ext/cell/asciidoc.rb +0 -69
  125. data/lib/asciidoctor-pdf/prawn-table_ext.rb +0 -3
  126. data/lib/asciidoctor-pdf/prawn_ext/coderay_encoder.rb +0 -115
  127. data/lib/asciidoctor-pdf/prawn_ext/extensions.rb +0 -863
  128. data/lib/asciidoctor-pdf/prawn_ext/images.rb +0 -40
  129. data/lib/asciidoctor-pdf/prawn_ext.rb +0 -5
  130. data/lib/asciidoctor-pdf/roman_numeral.rb +0 -114
  131. data/lib/asciidoctor-pdf/rouge_ext/css_theme.rb +0 -15
  132. data/lib/asciidoctor-pdf/rouge_ext/formatters/prawn.rb +0 -164
  133. data/lib/asciidoctor-pdf/rouge_ext.rb +0 -4
  134. data/lib/asciidoctor-pdf/sanitizer.rb +0 -88
  135. data/lib/asciidoctor-pdf/temporary_path.rb +0 -13
  136. data/lib/asciidoctor-pdf/theme_loader.rb +0 -247
  137. data/lib/asciidoctor-pdf/ttfunk_ext.rb +0 -8
@@ -1,54 +1,57 @@
1
- # -*- encoding: utf-8 -*-
2
- require File.expand_path '../lib/asciidoctor-pdf/version', __FILE__
3
- require 'open3' unless defined? Open3
1
+ begin
2
+ require_relative 'lib/asciidoctor/pdf/version'
3
+ rescue LoadError
4
+ require 'asciidoctor/pdf/version'
5
+ end
4
6
 
5
7
  Gem::Specification.new do |s|
6
8
  s.name = 'asciidoctor-pdf'
7
- s.version = Asciidoctor::Pdf::VERSION
8
-
9
- s.summary = 'Converts AsciiDoc documents to PDF using Prawn'
10
- s.description = <<-EOS
11
- An extension for Asciidoctor that converts AsciiDoc documents to PDF using the Prawn PDF library.
12
- EOS
13
-
9
+ s.version = Asciidoctor::PDF::VERSION
10
+ s.summary = 'Converts AsciiDoc documents to PDF using Asciidoctor and Prawn'
11
+ s.description = 'An extension for Asciidoctor that converts AsciiDoc documents to PDF using the Prawn PDF library.'
14
12
  s.authors = ['Dan Allen', 'Sarah White']
15
13
  s.email = 'dan@opendevise.com'
16
- s.homepage = 'https://github.com/asciidoctor/asciidoctor-pdf'
14
+ s.homepage = 'https://asciidoctor.org/docs/asciidoctor-pdf'
17
15
  s.license = 'MIT'
18
-
19
- s.required_ruby_version = '>= 1.9.3'
20
-
21
- files = begin
22
- (result = Open3.popen3('git ls-files -z') {|_, out| out.read }.split %(\0)).empty? ? Dir['**/*'] : result
16
+ # NOTE required ruby version is informational only; it's not enforced since it can't be overridden and can cause builds to break
17
+ #s.required_ruby_version = '>= 2.3.0'
18
+ s.metadata = {
19
+ 'bug_tracker_uri' => 'https://github.com/asciidoctor/asciidoctor-pdf/issues',
20
+ 'changelog_uri' => 'https://github.com/asciidoctor/asciidoctor-pdf/blob/master/CHANGELOG.adoc',
21
+ 'mailing_list_uri' => 'http://discuss.asciidoctor.org',
22
+ 'source_code_uri' => 'https://github.com/asciidoctor/asciidoctor-pdf'
23
+ }
24
+
25
+ # NOTE the logic to build the list of files is designed to produce a usable package even when the git command is not available
26
+ begin
27
+ files = (result = `git ls-files -z`.split ?\0).empty? ? Dir['**/*'] : result
23
28
  rescue
24
- Dir['**/*']
29
+ files = Dir['**/*']
25
30
  end
26
- s.files = files.grep %r/^(?:(?:data|lib)\/.+|docs\/theming-guide\.adoc|Gemfile|Rakefile|(?:CHANGELOG|LICENSE|NOTICE|README)\.adoc|#{s.name}\.gemspec)$/
27
- # FIXME optimize-pdf is currently a shell script, so listing it here won't work
28
- #s.executables = ['asciidoctor-pdf', 'optimize-pdf']
29
- s.executables = ['asciidoctor-pdf']
30
- s.test_files = files.grep %r/^(?:test|spec|feature)\/.*$/
31
-
31
+ s.files = files.grep %r/^(?:(?:data|lib)\/.+|docs\/theming-guide\.adoc|(?:CHANGELOG|LICENSE|NOTICE|README)\.adoc|\.yardopts|#{s.name}\.gemspec)$/
32
+ s.executables = (files.grep %r/^bin\//).map {|f| File.basename f }
32
33
  s.require_paths = ['lib']
33
-
34
- s.has_rdoc = true
35
- s.rdoc_options = ['--charset=UTF-8', '--title="Asciidoctor PDF"', '--main=README.adoc', '-ri']
36
- s.extra_rdoc_files = ['CHANGELOG.adoc', 'LICENSE.adoc', 'NOTICE.adoc', 'README.adoc']
37
-
38
- s.add_development_dependency 'rake'
39
- #s.add_development_dependency 'rdoc', '~> 4.1.0'
40
-
41
- s.add_runtime_dependency 'asciidoctor', '>= 1.5.0'
42
- # prawn >= 2.0.0 requires Ruby >= 2.0.0, so we must cast a wider net to support Ruby 1.9.3
43
- s.add_runtime_dependency 'prawn', '>= 1.3.0', '< 2.3.0'
44
- s.add_runtime_dependency 'prawn-table', '0.2.2'
45
- # prawn-templates >= 0.0.5 requires prawn >= 2.2.0, so we must cast a wider net to support Ruby 1.9.3
46
- s.add_runtime_dependency 'prawn-templates', '>= 0.0.3', '<= 0.1.1'
47
- # prawn-svg >= 0.22.1 requires Ruby >= 2.0.0, so we must cast a wider net to support Ruby 1.9.3
48
- s.add_runtime_dependency 'prawn-svg', '>= 0.21.0', '< 0.28.0'
49
- s.add_runtime_dependency 'prawn-icon', '1.3.0'
50
- s.add_runtime_dependency 'safe_yaml', '~> 1.0.4'
51
- s.add_runtime_dependency 'thread_safe', '~> 0.3.6'
52
- # For our usage, treetop 1.6.2 is slower than 1.5.3
53
- s.add_runtime_dependency 'treetop', '1.5.3'
34
+ #s.test_files = files.grep %r/^(?:test|spec|feature)\/.*$/
35
+
36
+ s.add_runtime_dependency 'asciidoctor', '>= 1.5.3', '< 3.0.0'
37
+ s.add_runtime_dependency 'prawn', '~> 2.2.0'
38
+ # NOTE ttfunk 1.6 generates TT instructions ghostscript cannot process, so lock the version of ttfunk
39
+ s.add_runtime_dependency 'ttfunk', ['~> 1.5.0'], ['>= 1.5.1']
40
+ # NOTE must use prawn-table from master branch (defined in Gemfile) for full functionality
41
+ s.add_runtime_dependency 'prawn-table', '~> 0.2.0'
42
+ s.add_runtime_dependency 'prawn-templates', '~> 0.1.0'
43
+ s.add_runtime_dependency 'prawn-svg', '~> 0.30.0'
44
+ s.add_runtime_dependency 'prawn-icon', '~> 2.5.0'
45
+ s.add_runtime_dependency 'safe_yaml', '~> 1.0.0'
46
+ s.add_runtime_dependency 'thread_safe', '~> 0.3.0'
47
+ s.add_runtime_dependency 'concurrent-ruby', '~> 1.1.0'
48
+ s.add_runtime_dependency 'treetop', '~> 1.6.0'
49
+
50
+ s.add_development_dependency 'rake', '~> 13.0.0'
51
+ s.add_development_dependency 'rspec', '~> 3.9.0'
52
+ s.add_development_dependency 'pdf-inspector', '~> 1.3.0'
53
+ # Asciidoctor PDF supports Rouge >= 2 (verified in CI build using 2.0.0)
54
+ s.add_development_dependency 'rouge', '~> 3.0'
55
+ s.add_development_dependency 'coderay', '~> 1.1.0'
56
+ s.add_development_dependency 'chunky_png', '~> 1.3.0'
54
57
  end
data/bin/asciidoctor-pdf CHANGED
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- if File.exist?(asciidoctor_pdf = (File.expand_path '../../lib/asciidoctor-pdf', __FILE__))
4
+ if File.file?(asciidoctor_pdf = (File.expand_path '../../lib/asciidoctor/pdf.rb', __FILE__))
4
5
  require asciidoctor_pdf
5
6
  else
6
- require 'asciidoctor-pdf'
7
+ require 'asciidoctor/pdf'
7
8
  end
8
9
  require 'asciidoctor/cli'
9
10
 
@@ -11,13 +12,8 @@ options = Asciidoctor::Cli::Options.new backend: 'pdf', header_footer: true
11
12
 
12
13
  # FIXME provide an API in Asciidoctor for sub-components to print version information
13
14
  unless ARGV != ['-v'] && (ARGV & ['-V', '--version']).empty?
14
- $stdout.write %(Asciidoctor PDF #{Asciidoctor::Pdf::VERSION} using )
15
- # NOTE the print_version method was added in Asciidoctor 1.5.2
16
- if options.respond_to? :print_version
17
- options.print_version
18
- else
19
- puts %(Asciidoctor #{::Asciidoctor::VERSION} [http://asciidoctor.org])
20
- end
15
+ $stdout.write %(Asciidoctor PDF #{Asciidoctor::PDF::VERSION} using )
16
+ options.print_version
21
17
  exit 0
22
18
  end
23
19
 
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ optimizer = File.absolute_path '../lib/asciidoctor/pdf/optimizer.rb', __dir__
5
+ if File.exist? optimizer
6
+ require optimizer
7
+ else
8
+ require 'asciidoctor/pdf/optimizer'
9
+ end
10
+
11
+ args = ARGV.dup
12
+
13
+ unless (filename = args.pop)
14
+ warn 'asciidoctor-pdf-optimize: Please specify a PDF file to optimize.'
15
+ exit 1
16
+ end
17
+
18
+ quality = args[0] == '--quality' ? args[1].to_s : ''
19
+
20
+ (Asciidoctor::PDF::Optimizer.new quality).generate_file filename
@@ -0,0 +1,26 @@
1
+ M+ fonts are generated from the M+ outline fonts TESTFLIGHT 63a retrieved from http://mplus-fonts.osdn.jp/mplus-outline-fonts/download/index-en.html.
2
+
3
+ The following changes were made using fontforge to produce mplus1mn-*-ascii.ttf fonts:
4
+
5
+ * Subsetted to include (ascii variant):
6
+ ** Non-visible Characters (U+00a0)
7
+ ** Basic Latin (U+0020–U+007e)
8
+ ** Enclosed Numbers (U+2460–U+2473, U+2776–U+277f, U+24eb–U+24f4) (M+ 1mn Regular only)
9
+ ** Box Drawing Symbols (U+2500–U+257f)
10
+ ** .notdef glyph
11
+ * Subsetted to include (subset variant):
12
+ ** Non-visible Characters (U+00a0)
13
+ ** Basic Latin (U+0020–U+007e)
14
+ ** Latin-1 Supplement (U+00a0–U+00fd)
15
+ ** Latin Extended-A (U+0100–U+017f)
16
+ ** Greek Alphabet (U+0391–U+03c9)
17
+ ** Cyrillic (U+0400–U+04ff)
18
+ ** Assorted Symbols (U+20ac)
19
+ ** Enclosed Numbers (U+2460–U+2473, U+2776–U+277f, U+24eb–U+24f4) (mplus1mn-regular only)
20
+ ** Box Drawing Symbols (U+2500–U+257f)
21
+ ** .notdef glyph
22
+ * Added BOM (U+feff) and line feed (U+000a) characters (from blank)
23
+ * Generated old-style kern table (neither Apple or OpenType) (required to make kerning work in Prawn) (flags: 0x90)
24
+ * Removed Truetype instructions (information not used by Prawn) (flags: 0x08)
25
+ * Generated with PS Glyph Names option enabled (didn't use 0x04 flag)
26
+ * Generate flags used, in total: 0x90 + 0x08
@@ -0,0 +1,26 @@
1
+ M+ fonts are generated from the M+ outline fonts TESTFLIGHT 63a retrieved from http://mplus-fonts.osdn.jp/mplus-outline-fonts/download/index-en.html.
2
+
3
+ The following changes were made using fontforge to produce mplus1p-regular-fallback.ttf font:
4
+
5
+ * Subsetted to include:
6
+ ** Non-visible Characters (U+00a0)
7
+ ** Basic Latin (U+0020–U+007e)
8
+ ** Latin-1 Supplement (U+00a0–U+00fd)
9
+ ** Latin Extended-A (U+0100–U+017f)
10
+ ** Latin Extended-B (U+0180–U+024f)
11
+ ** IPA (U+0259, U+02b0–U+02ff)
12
+ ** Greek (U+0370–U+03ff)
13
+ ** Cyrillic (U+0400–U+04ff)
14
+ ** Vietnamese (U+01a0–U01b0, U+1ea0–U1ef9)
15
+ ** CJK (U+4e00–U+9fff, U+3000–U+303f) (mostly Japanese, limited selection based on what M+ supports)
16
+ ** Mathematical Operators (U+2200–U+22ff)
17
+ ** General Punctuation (U+2000–U203a)
18
+ ** Geometric Shapes (U+25a0–U25ff)
19
+ ** Assorted Symbols (U+20ac, U+2122, U+21d0–U+21d5, U+2190–U+2195, U+2610–U+2611, U+2713)
20
+ ** .notdef glyph
21
+ * Added BOM (U+feff), hair space (U+200a), zero-width space (U+200b) and line feed (U+000a) characters (from blank)
22
+ * Manually added non-breaking hyphen (U+2011) from hyphen (U+002d)
23
+ * Generated old-style kern table (neither Apple or OpenType) (required to make kerning work in Prawn) (flags: 0x90)
24
+ * Removed Truetype instructions (information not used by Prawn) (flags: 0x08)
25
+ * Generated with PS Glyph Names option enabled (didn't use 0x04 flag)
26
+ * Generate flags used, in total: 0x90 + 0x08
@@ -0,0 +1,3 @@
1
+ Noto Emoji font is generated from the google-noto-emoji-fonts (commit 16151a2312a1f8a7d79e91789d3cfe24559d61f7).
2
+
3
+ Some glyphs have been removed that conflict with the other built-in fonts to produce the notoemoji-subset.ttf font.
@@ -0,0 +1,26 @@
1
+ Noto Serif fonts are generated from the google-noto-serif-fonts-20161022 Fedora RPM package (commit 86b2e553c3e3e4d6614dadd1fa0a7a6dafd74552).
2
+
3
+ The following changes were made using fontforge to produce the notoserif-*-subset.ttf fonts:
4
+
5
+ * Mapped single arrows <- (U+2190) and -> (U+2192) to double arrows <= (U+21d0) and => (U+21d2)
6
+ * Manually added non-breaking hyphen (U+2011) from hyphen (U+002d)
7
+ * Moved arrows (U+21d0, U+21d2, U+2190, U+2192) up in line to align with middle of X
8
+ * Subsetted to include:
9
+ ** Non-visible Characters (U+feff, U+00a0)
10
+ ** Basic Latin (U+0020–U+007e)
11
+ ** Latin-1 Supplement (U+00a0–U+00fd)
12
+ ** Latin Extended-A (U+0100–U+017f)
13
+ ** Greek (U+0370–U+03ff)
14
+ ** Cyrillic (U+0400–U+04ff)
15
+ ** Vietnamese (U+01a0–U01b0, U+1ea0–U1ef9)
16
+ ** Mathematical Operators (U+2200–U+22ff)
17
+ ** General Punctuation (U+2000–U203a)
18
+ ** Geometric Shapes (U+25a0–U25ff)
19
+ ** Assorted Symbols (U+20ac, U+2122, U+21d0, U+21d2, U+2190, U+2192)
20
+ ** .notdef glyph
21
+ * Imported ballot boxes from Font Awesome (U+2610, U+2611) (Noto Serif Regular only)
22
+ * Added line feed character (U+000a)
23
+ * Generated old-style kern table (neither Apple or OpenType) (required to make kerning work in Prawn) (flags: 0x90)
24
+ * Removed Truetype instructions (information not used by Prawn)
25
+ * Generated with PS Glyph Names option enabled (didn't use 0x04 flag)
26
+ * Generate flags used, in total: 0x90 + 0x08
@@ -1,4 +1,4 @@
1
- M+ FONTS Copyright (C) 2002-2014 M+ FONTS PROJECT
1
+ M+ FONTS Copyright (C) 2002-2019 M+ FONTS PROJECT
2
2
 
3
3
  -
4
4
 
@@ -13,4 +13,4 @@ or without modification, either commercially or noncommercially.
13
13
  THESE FONTS ARE PROVIDED "AS IS" WITHOUT WARRANTY.
14
14
 
15
15
 
16
- http://mplus-fonts.sourceforge.jp/mplus-outline-fonts/
16
+ http://mplus-fonts.osdn.jp
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -3,6 +3,7 @@
3
3
  vertical_spacing: 12
4
4
  page_background_color: 'FFFFFF'
5
5
  page_layout: portrait
6
+ page_initial_zoom: FitH
6
7
  # 36 is equivalent to 0.5in
7
8
  page_margin: 36
8
9
  page_margin_inner: 48
@@ -15,12 +16,23 @@ base_font_color: '000000'
15
16
  base_font_family: Helvetica
16
17
  base_font_size: 12
17
18
  # QUESTION should we rename to min_font_size?
18
- base_font_size_min: 9
19
+ base_font_size_min: 6
19
20
  base_font_style: normal
20
21
  base_line_height: 1.15
21
- base_line_height_length: 13.8
22
22
  base_border_color: 'EEEEEE'
23
23
  base_border_width: 0.5
24
+ role_line-through_text_decoration: line-through
25
+ role_underline_text_decoration: underline
26
+ role_big_font_size: 14
27
+ role_small_font_size: 10
28
+ role_subtitle_font_size: 0.8em
29
+ button_content: '[%s]'
30
+ button_font_family: Courier
31
+ button_font_style: bold
32
+ key_font_family: Courier
33
+ key_font_style: italic
34
+ mark_background_color: ffff00
35
+ mark_border_offset: 1
24
36
  link_font_color: '0000EE'
25
37
  literal_font_family: Courier
26
38
  heading_font_style: bold
@@ -33,6 +45,7 @@ heading_h6_font_size: 10
33
45
  heading_line_height: 1.15
34
46
  heading_margin_top: 4
35
47
  heading_margin_bottom: 12
48
+ heading_min_height_after: 20
36
49
  title_page_align: center
37
50
  title_page_line_height: 1.15
38
51
  title_page_logo_top: 10%
@@ -62,15 +75,19 @@ admonition_padding: [0, 12, 0, 12]
62
75
  admonition_label_font_style: bold
63
76
  admonition_label_text_transform: uppercase
64
77
  blockquote_border_color: 'EEEEEE'
65
- blockquote_border_width: 4
78
+ blockquote_border_left_width: 4
66
79
  blockquote_padding: [6, 12, -6, 14]
80
+ verse_border_color: 'EEEEEE'
81
+ verse_border_left_width: 4
82
+ verse_padding: [6, 12, -6, 14]
67
83
  code_font_family: Courier
68
- code_font_size: 10.5
84
+ code_font_size: 10.8
69
85
  code_line_height: 1.2
70
86
  code_padding: 9
71
87
  code_border_color: 'EEEEEE'
72
88
  code_border_width: 0.5
73
89
  conum_line_height: 1.15
90
+ conum_glyphs: circled
74
91
  example_background_color: 'FFFFFF'
75
92
  example_border_color: 'EEEEEE'
76
93
  example_border_width: 0.5
@@ -91,9 +108,14 @@ table_border_style: solid
91
108
  table_border_width: 0.5
92
109
  table_cell_padding: 2
93
110
  table_head_font_style: bold
111
+ table_head_border_bottom_width: 1.25
94
112
  table_body_stripe_background_color: 'EEEEEE'
95
113
  thematic_break_border_color: 'EEEEEE'
96
114
  thematic_break_border_style: solid
97
115
  thematic_break_border_width: 0.5
98
116
  toc_indent: 15
99
117
  toc_line_height: 1.4
118
+ footnotes_font_size: 9
119
+ footnotes_item_space: 3
120
+ footer_recto_right_content: '{page-number}'
121
+ footer_verso_left_content: '{page-number}'
@@ -8,22 +8,14 @@ font:
8
8
  bold_italic: notoserif-bold_italic-subset.ttf
9
9
  # M+ 1mn supports ASCII and the circled numbers used for conums
10
10
  M+ 1mn:
11
- normal: mplus1mn-regular-ascii-conums.ttf
12
- bold: mplus1mn-bold-ascii.ttf
13
- italic: mplus1mn-italic-ascii.ttf
14
- bold_italic: mplus1mn-bold_italic-ascii.ttf
15
- # M+ 1p supports Latin, Latin-1 Supplement, Latin Extended, Greek, Cyrillic, Vietnamese, Japanese & an assortment of symbols
16
- # It also provides arrows for ->, <-, => and <= replacements in case these glyphs are missing from font
17
- M+ 1p Fallback:
18
- normal: mplus1p-regular-fallback.ttf
19
- bold: mplus1p-regular-fallback.ttf
20
- italic: mplus1p-regular-fallback.ttf
21
- bold_italic: mplus1p-regular-fallback.ttf
22
- fallbacks:
23
- - M+ 1p Fallback
11
+ normal: mplus1mn-regular-subset.ttf
12
+ bold: mplus1mn-bold-subset.ttf
13
+ italic: mplus1mn-italic-subset.ttf
14
+ bold_italic: mplus1mn-bold_italic-subset.ttf
24
15
  page:
25
- background_color: ffffff
16
+ background_color: FFFFFF
26
17
  layout: portrait
18
+ initial_zoom: FitH
27
19
  margin: [0.5in, 0.67in, 0.67in, 0.67in]
28
20
  # margin_inner and margin_outer keys are used for recto/verso print margins when media=prepress
29
21
  margin_inner: 0.75in
@@ -57,9 +49,21 @@ base:
57
49
  font_size_small: round($base_font_size * 0.85)
58
50
  font_size_min: $base_font_size * 0.75
59
51
  font_style: normal
60
- border_color: eeeeee
52
+ border_color: EEEEEE
61
53
  border_radius: 4
62
54
  border_width: 0.5
55
+ role:
56
+ line-through:
57
+ text_decoration: line-through
58
+ underline:
59
+ text_decoration: underline
60
+ big:
61
+ font_size: $base_font_size_large
62
+ small:
63
+ font_size: $base_font_size_small
64
+ subtitle:
65
+ font_size: 0.8em
66
+ font_color: 999999
63
67
  # FIXME vertical_rhythm is weird; we should think in terms of ems
64
68
  #vertical_rhythm: $base_line_height_length * 2 / 3
65
69
  # correct line height for Noto Serif metrics (comes with built-in line height)
@@ -68,19 +72,32 @@ horizontal_rhythm: $base_line_height_length
68
72
  # QUESTION should vertical_spacing be block_spacing instead?
69
73
  vertical_spacing: $vertical_rhythm
70
74
  link:
71
- font_color: 428bca
75
+ font_color: 428BCA
72
76
  # literal is currently used for inline monospaced in prose and table cells
73
77
  literal:
74
- font_color: b12146
78
+ font_color: B12146
75
79
  font_family: M+ 1mn
76
- menu_caret_content: " <font size=\"1.15em\"><color rgb=\"b12146\">\u203a</color></font> "
80
+ button:
81
+ content: "[\u2009%s\u2009]"
82
+ font_style: bold
83
+ key:
84
+ background_color: F5F5F5
85
+ border_color: CCCCCC
86
+ border_offset: 2
87
+ border_radius: 2
88
+ border_width: 0.5
89
+ font_family: $literal_font_family
90
+ separator: "\u202f+\u202f"
91
+ mark:
92
+ background_color: FFFF00
93
+ border_offset: 1
94
+ menu:
95
+ caret_content: " <font size=\"1.15em\"><color rgb=\"b12146\">\u203a</color></font> "
77
96
  heading:
78
97
  align: left
79
- #font_color: 181818
80
98
  font_color: $base_font_color
81
- font_family: $base_font_family
82
99
  font_style: bold
83
- # h1 is used for part titles (book doctype only)
100
+ # h1 is used for part titles (book doctype) or the doctitle (article doctype)
84
101
  h1_font_size: floor($base_font_size * 2.6)
85
102
  # h2 is used for chapter titles (book doctype only)
86
103
  h2_font_size: floor($base_font_size * 2.15)
@@ -93,6 +110,7 @@ heading:
93
110
  line_height: 1
94
111
  margin_top: $vertical_rhythm * 0.4
95
112
  margin_bottom: $vertical_rhythm * 0.9
113
+ min_height_after: $base_line_height_length * 1.5
96
114
  title_page:
97
115
  align: right
98
116
  logo:
@@ -127,7 +145,7 @@ lead:
127
145
  font_size: $base_font_size_large
128
146
  line_height: 1.4
129
147
  abstract:
130
- font_color: 5c6266
148
+ font_color: 5C6266
131
149
  font_size: $lead_font_size
132
150
  line_height: $lead_line_height
133
151
  font_style: italic
@@ -135,7 +153,6 @@ abstract:
135
153
  title:
136
154
  align: center
137
155
  font_color: $heading_font_color
138
- font_family: $heading_font_family
139
156
  font_size: $heading_h4_font_size
140
157
  font_style: $heading_font_style
141
158
  admonition:
@@ -144,21 +161,29 @@ admonition:
144
161
  padding: [0, $horizontal_rhythm, 0, $horizontal_rhythm]
145
162
  #icon:
146
163
  # tip:
147
- # name: fa-lightbulb-o
164
+ # name: far-lightbulb
148
165
  # stroke_color: 111111
149
166
  # size: 24
150
167
  label:
151
168
  text_transform: uppercase
152
169
  font_style: bold
153
170
  blockquote:
154
- font_color: $base_font_color
155
171
  font_size: $base_font_size_large
156
172
  border_color: $base_border_color
157
- border_width: 5
173
+ border_width: 0
174
+ border_left_width: 5
158
175
  # FIXME disable negative padding bottom once margin collapsing is implemented
159
- padding: [0, $horizontal_rhythm, $block_margin_bottom * -0.75, $horizontal_rhythm + $blockquote_border_width / 2]
176
+ padding: [0, $horizontal_rhythm, $block_margin_bottom * -0.75, $horizontal_rhythm + $blockquote_border_left_width / 2]
160
177
  cite_font_size: $base_font_size_small
161
178
  cite_font_color: 999999
179
+ verse:
180
+ font_size: $blockquote_font_size
181
+ border_color: $blockquote_border_color
182
+ border_width: $blockquote_border_width
183
+ border_left_width: $blockquote_border_left_width
184
+ padding: $blockquote_padding
185
+ cite_font_size: $blockquote_cite_font_size
186
+ cite_font_color: $blockquote_cite_font_color
162
187
  # code is used for source blocks (perhaps change to source or listing?)
163
188
  code:
164
189
  font_color: $base_font_color
@@ -168,20 +193,21 @@ code:
168
193
  line_height: 1.25
169
194
  # line_gap is an experimental property to control how a background color is applied to an inline block element
170
195
  line_gap: 3.8
171
- background_color: f5f5f5
172
- border_color: cccccc
196
+ background_color: F5F5F5
197
+ border_color: CCCCCC
173
198
  border_radius: $base_border_radius
174
199
  border_width: 0.75
175
200
  conum:
176
- font_family: M+ 1mn
201
+ font_family: $literal_font_family
177
202
  font_color: $literal_font_color
178
203
  font_size: $base_font_size
179
204
  line_height: 4 / 3
205
+ glyphs: circled
180
206
  example:
181
207
  border_color: $base_border_color
182
208
  border_radius: $base_border_radius
183
209
  border_width: 0.75
184
- background_color: ffffff
210
+ background_color: $page-background-color
185
211
  # FIXME reenable padding bottom once margin collapsing is implemented
186
212
  padding: [$vertical_rhythm, $horizontal_rhythm, 0, $horizontal_rhythm]
187
213
  image:
@@ -190,8 +216,8 @@ prose:
190
216
  margin_top: $block_margin_top
191
217
  margin_bottom: $block_margin_bottom
192
218
  sidebar:
193
- background_color: eeeeee
194
- border_color: e1e1e1
219
+ background_color: EEEEEE
220
+ border_color: E1E1E1
195
221
  border_radius: $base_border_radius
196
222
  border_width: $base_border_width
197
223
  # FIXME reenable padding bottom once margin collapsing is implemented
@@ -199,7 +225,6 @@ sidebar:
199
225
  title:
200
226
  align: center
201
227
  font_color: $heading_font_color
202
- font_family: $heading_font_family
203
228
  font_size: $heading_h4_font_size
204
229
  font_style: $heading_font_style
205
230
  thematic_break:
@@ -219,53 +244,44 @@ outline_list:
219
244
  item_spacing: $vertical_rhythm / 2
220
245
  table:
221
246
  background_color: $page_background_color
222
- #head_background_color: <hex value>
223
- #head_font_color: $base_font_color
224
- head_font_style: bold
225
- #body_background_color: <hex value>
226
- body_stripe_background_color: f9f9f9
227
- foot_background_color: f0f0f0
228
- border_color: dddddd
247
+ border_color: DDDDDD
229
248
  border_width: $base_border_width
230
249
  cell_padding: 3
250
+ head:
251
+ font_style: bold
252
+ border_bottom_width: $base_border_width * 2.5
253
+ body:
254
+ stripe_background_color: F9F9F9
255
+ foot:
256
+ background_color: F0F0F0
231
257
  toc:
232
258
  indent: $horizontal_rhythm
233
259
  line_height: 1.4
234
260
  dot_leader:
235
261
  #content: ". "
236
- font_color: a9a9a9
262
+ font_color: A9A9A9
237
263
  #levels: 2 3
238
- # NOTE in addition to footer, header is also supported
264
+ footnotes:
265
+ font_size: round($base_font_size * 0.75)
266
+ item_spacing: $outline_list_item_spacing / 2
267
+ header:
268
+ font_size: $base_font_size_small
269
+ line_height: 1
270
+ vertical_align: middle
239
271
  footer:
240
272
  font_size: $base_font_size_small
241
273
  # NOTE if background_color is set, background and border will span width of page
242
- border_color: dddddd
274
+ border_color: DDDDDD
243
275
  border_width: 0.25
244
276
  height: $base_line_height_length * 2.5
245
277
  line_height: 1
246
278
  padding: [$base_line_height_length / 2, 1, 0, 1]
247
279
  vertical_align: top
248
- #image_vertical_align: <alignment> or <number>
249
- # additional attributes for content:
250
- # * {page-count}
251
- # * {page-number}
252
- # * {document-title}
253
- # * {document-subtitle}
254
- # * {chapter-title}
255
- # * {section-title}
256
- # * {section-or-chapter-title}
257
280
  recto:
258
281
  #columns: "<50% =0% >50%"
259
282
  right:
260
283
  content: '{page-number}'
261
- #content: '{section-or-chapter-title} | {page-number}'
262
- #content: '{document-title} | {page-number}'
263
- #center:
264
- # content: '{page-number}'
265
284
  verso:
266
285
  #columns: $footer_recto_columns
267
286
  left:
268
287
  content: $footer_recto_right_content
269
- #content: '{page-number} | {chapter-title}'
270
- #center:
271
- # content: '{page-number}'
@@ -0,0 +1,9 @@
1
+ extends: default
2
+ font:
3
+ catalog:
4
+ merge: true
5
+ # M+ 1p supports Latin, Latin-1 Supplement, Latin Extended, Greek, Cyrillic, Vietnamese, Japanese & an assortment of symbols
6
+ # It also provides arrows for ->, <-, => and <= replacements in case these glyphs are missing from font
7
+ M+ 1p Fallback: mplus1p-regular-fallback.ttf
8
+ Noto Emoji: notoemoji-subset.ttf
9
+ fallbacks: [M+ 1p Fallback, Noto Emoji]