asciidoctor-epub3 1.0.0.alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.adoc +22 -0
- data/NOTICE.adoc +53 -0
- data/README.adoc +744 -0
- data/Rakefile +78 -0
- data/bin/adb-push-ebook +25 -0
- data/bin/asciidoctor-epub3 +15 -0
- data/data/fonts/assorted-icons.ttf +0 -0
- data/data/fonts/fontawesome-icons.ttf +0 -0
- data/data/fonts/mplus1mn-bold-ascii.ttf +0 -0
- data/data/fonts/mplus1mn-bolditalic-ascii.ttf +0 -0
- data/data/fonts/mplus1mn-italic-ascii.ttf +0 -0
- data/data/fonts/mplus1mn-regular-ascii-conums.ttf +0 -0
- data/data/fonts/mplus1p-bold-latin-cyrillic.ttf +0 -0
- data/data/fonts/mplus1p-bold-latin-ext.ttf +0 -0
- data/data/fonts/mplus1p-bold-latin.ttf +0 -0
- data/data/fonts/mplus1p-bold-multilingual.ttf +0 -0
- data/data/fonts/mplus1p-light-latin-cyrillic.ttf +0 -0
- data/data/fonts/mplus1p-light-latin-ext.ttf +0 -0
- data/data/fonts/mplus1p-light-latin.ttf +0 -0
- data/data/fonts/mplus1p-light-multilingual.ttf +0 -0
- data/data/fonts/mplus1p-regular-latin-cyrillic.ttf +0 -0
- data/data/fonts/mplus1p-regular-latin-ext.ttf +0 -0
- data/data/fonts/mplus1p-regular-latin.ttf +0 -0
- data/data/fonts/mplus1p-regular-multilingual.ttf +0 -0
- data/data/fonts/notoserif-bold-latin-cyrillic.ttf +0 -0
- data/data/fonts/notoserif-bold-latin-ext.ttf +0 -0
- data/data/fonts/notoserif-bold-latin.ttf +0 -0
- data/data/fonts/notoserif-bold-multilingual.ttf +0 -0
- data/data/fonts/notoserif-bolditalic-latin-cyrillic.ttf +0 -0
- data/data/fonts/notoserif-bolditalic-latin-ext.ttf +0 -0
- data/data/fonts/notoserif-bolditalic-latin.ttf +0 -0
- data/data/fonts/notoserif-bolditalic-multilingual.ttf +0 -0
- data/data/fonts/notoserif-italic-latin-cyrillic.ttf +0 -0
- data/data/fonts/notoserif-italic-latin-ext.ttf +0 -0
- data/data/fonts/notoserif-italic-latin.ttf +0 -0
- data/data/fonts/notoserif-italic-multilingual.ttf +0 -0
- data/data/fonts/notoserif-regular-latin-cyrillic.ttf +0 -0
- data/data/fonts/notoserif-regular-latin-ext.ttf +0 -0
- data/data/fonts/notoserif-regular-latin.ttf +0 -0
- data/data/fonts/notoserif-regular-multilingual.ttf +0 -0
- data/data/images/default-avatar.jpg +0 -0
- data/data/images/default-avatar.png +0 -0
- data/data/images/default-avatar.svg +67 -0
- data/data/images/default-cover-large.png +0 -0
- data/data/images/default-cover.png +0 -0
- data/data/images/default-cover.svg +53 -0
- data/data/images/default-headshot.jpg +0 -0
- data/data/images/default-headshot.png +0 -0
- data/data/samples/asciidoctor-epub3-readme.adoc +744 -0
- data/data/samples/asciidoctor-js-extension.adoc +46 -0
- data/data/samples/asciidoctor-js-introduction.adoc +91 -0
- data/data/samples/i18n.adoc +161 -0
- data/data/samples/images/asciidoctor-js-chrome-extension.png +0 -0
- data/data/samples/images/avatars/graphitefriction.png +0 -0
- data/data/samples/images/avatars/mogztter.png +0 -0
- data/data/samples/images/avatars/mojavelinux.png +0 -0
- data/data/samples/images/correct-text-justification.png +0 -0
- data/data/samples/images/incorrect-text-justification.png +0 -0
- data/data/samples/images/screenshots/chapter-title-day.png +0 -0
- data/data/samples/images/screenshots/chapter-title.png +0 -0
- data/data/samples/images/screenshots/figure-admonition.png +0 -0
- data/data/samples/images/screenshots/section-title-paragraph.png +0 -0
- data/data/samples/images/screenshots/sidebar.png +0 -0
- data/data/samples/images/screenshots/table.png +0 -0
- data/data/samples/images/screenshots/text.png +0 -0
- data/data/samples/sample-book.adoc +20 -0
- data/data/samples/sample-content.adoc +168 -0
- data/data/styles/color-palette.css +28 -0
- data/data/styles/epub3-css3-only.css +161 -0
- data/data/styles/epub3-fonts.css +94 -0
- data/data/styles/epub3.css +1293 -0
- data/lib/asciidoctor-epub3.rb +5 -0
- data/lib/asciidoctor-epub3/converter.rb +859 -0
- data/lib/asciidoctor-epub3/core_ext/string.rb +7 -0
- data/lib/asciidoctor-epub3/font_icon_map.rb +376 -0
- data/lib/asciidoctor-epub3/packager.rb +466 -0
- data/lib/asciidoctor-epub3/spine_item_processor.rb +72 -0
- data/lib/asciidoctor-epub3/version.rb +5 -0
- data/scripts/generate-font-subsets.pe +225 -0
- metadata +192 -0
| @@ -0,0 +1,72 @@ | |
| 1 | 
            +
            module Asciidoctor
         | 
| 2 | 
            +
            module Epub3
         | 
| 3 | 
            +
            class SpineItemProcessor < Extensions::IncludeProcessor
         | 
| 4 | 
            +
              def initialize document
         | 
| 5 | 
            +
                @document = document
         | 
| 6 | 
            +
              end
         | 
| 7 | 
            +
             | 
| 8 | 
            +
              # NOTE only fires for includes in spine document if registered directly on the instance of the spine document
         | 
| 9 | 
            +
              def process doc, reader, target, attributes
         | 
| 10 | 
            +
                spine_doc = doc
         | 
| 11 | 
            +
                unless ::File.exist?(include_file = (spine_doc.normalize_system_path target, reader.dir, nil, target_name: 'include file'))
         | 
| 12 | 
            +
                  warn %(asciidoctor: WARNING: #{reader.line_info}: include file not found: #{include_file})
         | 
| 13 | 
            +
                  return
         | 
| 14 | 
            +
                end
         | 
| 15 | 
            +
                inherited_attributes = spine_doc.attributes.dup
         | 
| 16 | 
            +
                %w(spine doctitle docfile docdir docname).each {|key| inherited_attributes.delete key }
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                # parse header to get author information
         | 
| 19 | 
            +
                spine_item_doc_meta = ::Asciidoctor.load_file include_file,
         | 
| 20 | 
            +
                    safe: spine_doc.safe,
         | 
| 21 | 
            +
                    backend: 'epub3-xhtml5',
         | 
| 22 | 
            +
                    doctype: :article,
         | 
| 23 | 
            +
                    parse_header_only: true 
         | 
| 24 | 
            +
             | 
| 25 | 
            +
                # blank out author information if present in sub-document
         | 
| 26 | 
            +
                # FIXME this is a huge hack...we need a cleaner way to do this; perhaps an API method that retrieves all the author attribute names
         | 
| 27 | 
            +
                if spine_item_doc_meta.attr? 'author'
         | 
| 28 | 
            +
                  %w(author firstname lastname email authorinitials authors authorcount).each {|key| inherited_attributes.delete key }
         | 
| 29 | 
            +
                  idx = 1
         | 
| 30 | 
            +
                  while inherited_attributes.key? %(author_#{idx})
         | 
| 31 | 
            +
                    %W(author_#{idx} firstname_#{idx} lastname_#{idx} email_#{idx} authorinitials_#{idx}).each {|key| inherited_attributes.delete key }
         | 
| 32 | 
            +
                    idx += 1
         | 
| 33 | 
            +
                  end
         | 
| 34 | 
            +
                end
         | 
| 35 | 
            +
             | 
| 36 | 
            +
                # REVIEW reaching into converter to resolve document id feels like a hack; should happen in Asciidoctor parser
         | 
| 37 | 
            +
                # also, strange that "id" doesn't work here
         | 
| 38 | 
            +
                inherited_attributes['css-signature'] = DocumentIdGenerator.generate_id spine_item_doc_meta
         | 
| 39 | 
            +
                inherited_attributes['docreldir'] = ::File.dirname target
         | 
| 40 | 
            +
             | 
| 41 | 
            +
                # NOTE can't assign spine document as parent since there's too many assumptions in the Asciidoctor processor
         | 
| 42 | 
            +
                spine_item_doc = ::Asciidoctor.load_file include_file,
         | 
| 43 | 
            +
                    # setting base_dir breaks if outdir is not a subdirectory of spine_doc.base_dir
         | 
| 44 | 
            +
                    #base_dir: spine_doc.base_dir,
         | 
| 45 | 
            +
                    # NOTE won't write to correct directory if safe mode is :secure
         | 
| 46 | 
            +
                    safe: spine_doc.safe,
         | 
| 47 | 
            +
                    backend: 'epub3-xhtml5',
         | 
| 48 | 
            +
                    doctype: :article,
         | 
| 49 | 
            +
                    header_footer: true,
         | 
| 50 | 
            +
                    attributes: inherited_attributes
         | 
| 51 | 
            +
             | 
| 52 | 
            +
                # restore attributes to those defined in the document header
         | 
| 53 | 
            +
                spine_item_doc.restore_attributes
         | 
| 54 | 
            +
             | 
| 55 | 
            +
                (spine_doc.references[:spine_items] ||= []) << spine_item_doc
         | 
| 56 | 
            +
                # NOTE if there are attribute assignments between the include directives,
         | 
| 57 | 
            +
                # then this ordered list is not continguous, so bailing on the idea
         | 
| 58 | 
            +
                #reader.replace_line %(. link:#{::File.basename(spine_item_doc.attr 'outfile')}[#{spine_item_doc.doctitle}])
         | 
| 59 | 
            +
              end
         | 
| 60 | 
            +
             | 
| 61 | 
            +
              # handles? should get the attributes on include directive as the second argument
         | 
| 62 | 
            +
              def handles? target
         | 
| 63 | 
            +
                (@document.attr? 'spine') && (ASCIIDOC_EXTENSIONS.include? ::File.extname(target))
         | 
| 64 | 
            +
              end
         | 
| 65 | 
            +
             | 
| 66 | 
            +
              # FIXME this method shouldn't be required
         | 
| 67 | 
            +
              def update_config config
         | 
| 68 | 
            +
                (@config ||= {}).update config
         | 
| 69 | 
            +
              end
         | 
| 70 | 
            +
            end
         | 
| 71 | 
            +
            end
         | 
| 72 | 
            +
            end
         | 
| @@ -0,0 +1,225 @@ | |
| 1 | 
            +
            #!/usr/bin/env fontforge
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            # Run using:
         | 
| 4 | 
            +
            #
         | 
| 5 | 
            +
            # $ ./generate-font-subsets.pe <target directory>
         | 
| 6 | 
            +
            #
         | 
| 7 | 
            +
            # NOTE: Ignore "GID out of range" warnings; fontforge has to kick the tires a bit to flush out these dead references
         | 
| 8 | 
            +
            #
         | 
| 9 | 
            +
            # Use with Noto Serif fonts from https://code.google.com/p/noto/source/browse/#svn%2Ftrunk%2Ffonts%2Findividual%2Funhinted
         | 
| 10 | 
            +
            # Use with M+ fonts from http://mplus-fonts.sourceforge.jp/mplus-outline-fonts/download/index-en.html
         | 
| 11 | 
            +
            #
         | 
| 12 | 
            +
            # TODO: Add cjkv profile
         | 
| 13 | 
            +
            #
         | 
| 14 | 
            +
            # IMPORTANT: Must generate Apple format (0x10) or include old-fashioned 'kern' table for kerning to work in Prawn
         | 
| 15 | 
            +
            #
         | 
| 16 | 
            +
            # generate flags (additive):
         | 
| 17 | 
            +
            # * 0x00 - OpenType
         | 
| 18 | 
            +
            # * 0x10 - Apple
         | 
| 19 | 
            +
            # * 0x80 - OpenType and Apple
         | 
| 20 | 
            +
            # * 0x90 - Neither OpenType or Apple
         | 
| 21 | 
            +
            # * 0x800 - Generate old-style 'kern' table
         | 
| 22 | 
            +
            # * 0x08 - exclude TrueType instructions
         | 
| 23 | 
            +
            #
         | 
| 24 | 
            +
            # QUESTION: do we need to apply RoundToInt() after ClearInstrs()?
         | 
| 25 | 
            +
            # FIXME: need to generate cjk font
         | 
| 26 | 
            +
             | 
| 27 | 
            +
            genflags = 0x08
         | 
| 28 | 
            +
            #genflags = 0x18
         | 
| 29 | 
            +
            copy_fonts = ["NotoSerif-Regular.ttf", "NotoSerif-Bold.ttf", "NotoSerif-Italic.ttf", "NotoSerif-BoldItalic.ttf", "mplus-1p-regular.ttf", "mplus-1p-bold.ttf", "mplus-1p-light.ttf"]
         | 
| 30 | 
            +
            #copy_fonts = ["NotoSerif-Regular.ttf", "NotoSerif-Bold.ttf", "NotoSerif-Italic.ttf", "NotoSerif-BoldItalic.ttf"]
         | 
| 31 | 
            +
            #copy_fonts = ["LiberationMono-Regular.ttf", "LiberationMono-Bold.ttf", "LiberationMono-Italic.ttf", "LiberationMono-BoldItalic.ttf"]
         | 
| 32 | 
            +
            #copy_fonts = ["NotoSerif-Regular.ttf"]
         | 
| 33 | 
            +
            #copy_fonts = []
         | 
| 34 | 
            +
            num_copy_fonts = SizeOf(copy_fonts)
         | 
| 35 | 
            +
            copy_scripts = ["latin", "latin-ext", "latin-cyrillic", "multilingual"]
         | 
| 36 | 
            +
            #copy_scripts = ["latin"]
         | 
| 37 | 
            +
            num_copy_scripts = SizeOf(copy_scripts)
         | 
| 38 | 
            +
            code_fonts = ["mplus-1mn-light.ttf", "mplus-1mn-regular.ttf", "mplus-1mn-medium.ttf", "mplus-1mn-bold.ttf"]
         | 
| 39 | 
            +
            #code_fonts = []
         | 
| 40 | 
            +
            num_code_fonts = SizeOf(code_fonts)
         | 
| 41 | 
            +
            if ($argc == 2)
         | 
| 42 | 
            +
              output_dir = $argv[1]
         | 
| 43 | 
            +
            else
         | 
| 44 | 
            +
              #output_dir = "../data/fonts"
         | 
| 45 | 
            +
              output_dir = "generated"
         | 
| 46 | 
            +
            endif
         | 
| 47 | 
            +
             | 
| 48 | 
            +
            fi = 0
         | 
| 49 | 
            +
            while (fi < num_copy_fonts)
         | 
| 50 | 
            +
              new_basename = ToLower(copy_fonts[fi]:r)
         | 
| 51 | 
            +
              is_mplus = Strstr(new_basename, "mplus") >= 0
         | 
| 52 | 
            +
              # remove hyphen from mplus-1
         | 
| 53 | 
            +
              if (is_mplus)
         | 
| 54 | 
            +
                new_basename = "mplus1" + StrJoin(StrSplit(new_basename, "mplus-1"), "")
         | 
| 55 | 
            +
              endif
         | 
| 56 | 
            +
              si = 0
         | 
| 57 | 
            +
              while (si < num_copy_scripts)
         | 
| 58 | 
            +
                script = copy_scripts[si]
         | 
| 59 | 
            +
                Open(copy_fonts[fi])
         | 
| 60 | 
            +
                SelectAll()
         | 
| 61 | 
            +
                # Remove TrueType instructions
         | 
| 62 | 
            +
                ClearInstrs()
         | 
| 63 | 
            +
                SelectNone()
         | 
| 64 | 
            +
                # Basic Latin (e.g., English)
         | 
| 65 | 
            +
                SelectMore(0u0020,0u007e)
         | 
| 66 | 
            +
                # Latin-1 Supplement (covers core Western European languages)
         | 
| 67 | 
            +
                SelectMore(0u00a0,0u00ff)
         | 
| 68 | 
            +
                # Mathematical Operators (e.g., infinity, sum, partial differential)
         | 
| 69 | 
            +
                SelectMore(0u2200,0u22ff)
         | 
| 70 | 
            +
                # General Punctuation (most of it) (e.g., dashes, smart quotes, bullet)
         | 
| 71 | 
            +
                SelectMore(0u2000,0u203a)
         | 
| 72 | 
            +
                # Trademark sign (selected from Letterlike Symbols set)
         | 
| 73 | 
            +
                SelectMore(0u2122)
         | 
| 74 | 
            +
                # Geometric Shapes (e.g., list bullets)
         | 
| 75 | 
            +
                SelectMore(0u25a0,0u25ff)
         | 
| 76 | 
            +
                # Greek (frequently used for math and bullets)
         | 
| 77 | 
            +
                SelectMore(0u0370,0u03ff)
         | 
| 78 | 
            +
                # Additional Currency Symbols (QUESTION: do we need all of them in basic latin?)
         | 
| 79 | 
            +
                SelectMore(0u20a0,0u20d0)
         | 
| 80 | 
            +
                if (script == "latin-ext" || script == "latin-cyrillic" || script == "multilingual")
         | 
| 81 | 
            +
                  # Latin Extended-A, Latin Extended-B
         | 
| 82 | 
            +
                  SelectMore(0u0100,0u024f)
         | 
| 83 | 
            +
                  # IPA Extensions (i.e., core phonetics)
         | 
| 84 | 
            +
                  #SelectMore(0u0250,0u02af)
         | 
| 85 | 
            +
                  # Upside-down e (from IPA Extensions)
         | 
| 86 | 
            +
                  SelectMore(0u0259)
         | 
| 87 | 
            +
                  # Spacing Modifier Letters (e.g., diacritics)
         | 
| 88 | 
            +
                  SelectMore(0u02b0,0u02ff)
         | 
| 89 | 
            +
                  # Latin Ligatures (e.g., fi) (Noto Serif doesn't auto-detect them, so leave them off)
         | 
| 90 | 
            +
                  #SelectMore(0ufb00,0ufb06)
         | 
| 91 | 
            +
                endif
         | 
| 92 | 
            +
                if (script == "latin-cyrillic" || script == "multilingual")
         | 
| 93 | 
            +
                  # Cyrillic
         | 
| 94 | 
            +
                  SelectMore(0u0400,0u04ff)
         | 
| 95 | 
            +
                  # Cyrillic Supplement (QUESTION should this go in multilingual only?)
         | 
| 96 | 
            +
                  SelectMore(0u0500,0u052f)
         | 
| 97 | 
            +
                endif
         | 
| 98 | 
            +
                if (script == "multilingual")
         | 
| 99 | 
            +
                  # Greek Extended
         | 
| 100 | 
            +
                  SelectMore(0u1f00,0u1fff)
         | 
| 101 | 
            +
                  # Latin Extended Additional (Vietnamese, Hindi, ...)
         | 
| 102 | 
            +
                  SelectMore(0u1e00,0u1eff)
         | 
| 103 | 
            +
                endif
         | 
| 104 | 
            +
                # BOM
         | 
| 105 | 
            +
                SelectMore(0ufeff)
         | 
| 106 | 
            +
                # No-break space
         | 
| 107 | 
            +
                SelectMore(0u00a0)
         | 
| 108 | 
            +
                # Non-marking return (QUESTION do we really need this?)
         | 
| 109 | 
            +
                #SelectMore(0u000d)
         | 
| 110 | 
            +
                SelectInvert()
         | 
| 111 | 
            +
                Clear()
         | 
| 112 | 
            +
                SelectNone()
         | 
| 113 | 
            +
                # Generate BOM from no-break space (for M+ fonts)
         | 
| 114 | 
            +
                if (is_mplus)
         | 
| 115 | 
            +
                  Select(0u00a0)
         | 
| 116 | 
            +
                  Copy()
         | 
| 117 | 
            +
                  SelectNone()
         | 
| 118 | 
            +
                  Select(0ufeff)
         | 
| 119 | 
            +
                  Paste()
         | 
| 120 | 
            +
                  SetWidth(0)
         | 
| 121 | 
            +
                  SelectNone()
         | 
| 122 | 
            +
                endif
         | 
| 123 | 
            +
             | 
| 124 | 
            +
                # Generate line feed from no-break space (works around error "cmap format 14 is not supported" in ttfunk)
         | 
| 125 | 
            +
                Select(0u00a0)
         | 
| 126 | 
            +
                Copy()
         | 
| 127 | 
            +
                SelectNone()
         | 
| 128 | 
            +
                Select(0u000a)
         | 
| 129 | 
            +
                Paste()
         | 
| 130 | 
            +
                SetWidth(0)
         | 
| 131 | 
            +
                SelectNone()
         | 
| 132 | 
            +
             | 
| 133 | 
            +
                new_filename = new_basename + "-" + script + ".ttf"
         | 
| 134 | 
            +
                new_filepath = output_dir + "/" + new_filename
         | 
| 135 | 
            +
                Print("Generating " + new_filename + "...")
         | 
| 136 | 
            +
                Generate(new_filepath, "", genflags)
         | 
| 137 | 
            +
                Close()
         | 
| 138 | 
            +
                if (is_mplus)
         | 
| 139 | 
            +
                  # Regenerate to drop invalid cmap format 14 table (ignore warnings)
         | 
| 140 | 
            +
                  Open(new_filepath)
         | 
| 141 | 
            +
                  Generate(new_filepath, "", genflags)
         | 
| 142 | 
            +
                  Close()
         | 
| 143 | 
            +
                endif
         | 
| 144 | 
            +
                si = si + 1
         | 
| 145 | 
            +
              endloop
         | 
| 146 | 
            +
              fi = fi + 1
         | 
| 147 | 
            +
            endloop
         | 
| 148 | 
            +
             | 
| 149 | 
            +
            fi = 0
         | 
| 150 | 
            +
            while (fi < num_code_fonts)
         | 
| 151 | 
            +
              new_basename = code_fonts[fi]:r
         | 
| 152 | 
            +
              # remove hyphen from mplus-1
         | 
| 153 | 
            +
              new_basename = "mplus1" + StrJoin(StrSplit(new_basename, "mplus-1"), "")
         | 
| 154 | 
            +
              new_suffix = "-ascii.ttf"
         | 
| 155 | 
            +
              Open(code_fonts[fi])
         | 
| 156 | 
            +
              SelectAll()
         | 
| 157 | 
            +
              # NOTE: M+ fonts don't have hinting, so technically this is redundant
         | 
| 158 | 
            +
              ClearInstrs()
         | 
| 159 | 
            +
              SelectNone()
         | 
| 160 | 
            +
              # Basic Latin (e.g., Code)
         | 
| 161 | 
            +
              SelectMore(0u0020,0u007e)
         | 
| 162 | 
            +
              # No-break space
         | 
| 163 | 
            +
              SelectMore(0u00a0)
         | 
| 164 | 
            +
              if (new_basename == "mplus1mn-regular")
         | 
| 165 | 
            +
                # Enclosed numbers (1-20)
         | 
| 166 | 
            +
                SelectMore(0u2460,0u2473)
         | 
| 167 | 
            +
                new_suffix = "-ascii-conums.ttf"
         | 
| 168 | 
            +
              endif
         | 
| 169 | 
            +
              SelectInvert()
         | 
| 170 | 
            +
              Clear()
         | 
| 171 | 
            +
              SelectNone()
         | 
| 172 | 
            +
              SetFontNames(new_basename, "M+ 1mn")
         | 
| 173 | 
            +
              # repurpose light as italic
         | 
| 174 | 
            +
              if (new_basename == "mplus1mn-light")
         | 
| 175 | 
            +
                SetFontNames("mplus1mn-italic", "M+ 1mn", "M+ 1mn Italic")
         | 
| 176 | 
            +
                SetOS2Value("Weight", 400)
         | 
| 177 | 
            +
                SetPanose(2, 5)
         | 
| 178 | 
            +
                SetTTFName(0x409, 2, "Italic")
         | 
| 179 | 
            +
                SetTTFName(0x409, 16, "")
         | 
| 180 | 
            +
                SetTTFName(0x409, 17, "")
         | 
| 181 | 
            +
                SetTTFName(0x411, 16, "")
         | 
| 182 | 
            +
                SetTTFName(0x411, 17, "")
         | 
| 183 | 
            +
                new_basename = "mplus1mn-italic"
         | 
| 184 | 
            +
              # repurpose medium as bold
         | 
| 185 | 
            +
              elseif (new_basename == "mplus1mn-medium")
         | 
| 186 | 
            +
                SetFontNames("mplus1mn-bold", "M+ 1mn", "M+ 1mn Bold")
         | 
| 187 | 
            +
                SetOS2Value("Weight", 700)
         | 
| 188 | 
            +
                SetPanose(2, 8)
         | 
| 189 | 
            +
                SetTTFName(0x409, 2, "Bold")
         | 
| 190 | 
            +
                SetTTFName(0x409, 16, "")
         | 
| 191 | 
            +
                SetTTFName(0x409, 17, "")
         | 
| 192 | 
            +
                SetTTFName(0x411, 16, "")
         | 
| 193 | 
            +
                SetTTFName(0x411, 17, "")
         | 
| 194 | 
            +
                new_basename = "mplus1mn-bold"
         | 
| 195 | 
            +
              # repurpose bold as bold italic
         | 
| 196 | 
            +
              elseif (new_basename == "mplus1mn-bold")
         | 
| 197 | 
            +
                SetFontNames("mplus1mn-bolditalic", "M+ 1mn", "M+ 1mn Bold Italic")
         | 
| 198 | 
            +
                SetOS2Value("Weight", 700)
         | 
| 199 | 
            +
                SetPanose(2, 8)
         | 
| 200 | 
            +
                SetTTFName(0x409, 2, "Bold Italic")
         | 
| 201 | 
            +
                SetTTFName(0x409, 16, "")
         | 
| 202 | 
            +
                SetTTFName(0x409, 17, "")
         | 
| 203 | 
            +
                SetTTFName(0x411, 16, "")
         | 
| 204 | 
            +
                SetTTFName(0x411, 17, "")
         | 
| 205 | 
            +
                new_basename = "mplus1mn-bolditalic"
         | 
| 206 | 
            +
              endif
         | 
| 207 | 
            +
              # Generate BOM from no-break space (for M+ fonts)
         | 
| 208 | 
            +
              Select(0u00a0)
         | 
| 209 | 
            +
              Copy()
         | 
| 210 | 
            +
              SelectNone()
         | 
| 211 | 
            +
              Select(0ufeff)
         | 
| 212 | 
            +
              Paste()
         | 
| 213 | 
            +
              SetWidth(0)
         | 
| 214 | 
            +
              SelectNone()
         | 
| 215 | 
            +
              new_filename = new_basename + new_suffix
         | 
| 216 | 
            +
              new_filepath = output_dir + "/" + new_filename
         | 
| 217 | 
            +
              Print("Generating " + new_filename + "...")
         | 
| 218 | 
            +
              Generate(new_filepath, "", genflags)
         | 
| 219 | 
            +
              Close()
         | 
| 220 | 
            +
              # Regenerate to drop invalid cmap format 14 table (ignore warnings)
         | 
| 221 | 
            +
              Open(new_filepath)
         | 
| 222 | 
            +
              Generate(new_filepath, "", genflags)
         | 
| 223 | 
            +
              Close()
         | 
| 224 | 
            +
              fi = fi + 1
         | 
| 225 | 
            +
            endloop
         | 
    
        metadata
    ADDED
    
    | @@ -0,0 +1,192 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification
         | 
| 2 | 
            +
            name: asciidoctor-epub3
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            +
              version: 1.0.0.alpha.1
         | 
| 5 | 
            +
            platform: ruby
         | 
| 6 | 
            +
            authors:
         | 
| 7 | 
            +
            - Dan Allen
         | 
| 8 | 
            +
            - Sarah White
         | 
| 9 | 
            +
            autorequire: 
         | 
| 10 | 
            +
            bindir: bin
         | 
| 11 | 
            +
            cert_chain: []
         | 
| 12 | 
            +
            date: 2014-07-29 00:00:00.000000000 Z
         | 
| 13 | 
            +
            dependencies:
         | 
| 14 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 15 | 
            +
              name: rake
         | 
| 16 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 17 | 
            +
                requirements:
         | 
| 18 | 
            +
                - - "~>"
         | 
| 19 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 20 | 
            +
                    version: '10.0'
         | 
| 21 | 
            +
              type: :development
         | 
| 22 | 
            +
              prerelease: false
         | 
| 23 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 24 | 
            +
                requirements:
         | 
| 25 | 
            +
                - - "~>"
         | 
| 26 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 27 | 
            +
                    version: '10.0'
         | 
| 28 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 29 | 
            +
              name: asciidoctor
         | 
| 30 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 31 | 
            +
                requirements:
         | 
| 32 | 
            +
                - - ">="
         | 
| 33 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 34 | 
            +
                    version: 1.5.0.rc.2
         | 
| 35 | 
            +
                - - "<"
         | 
| 36 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 37 | 
            +
                    version: 1.6.0
         | 
| 38 | 
            +
              type: :runtime
         | 
| 39 | 
            +
              prerelease: false
         | 
| 40 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 41 | 
            +
                requirements:
         | 
| 42 | 
            +
                - - ">="
         | 
| 43 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 44 | 
            +
                    version: 1.5.0.rc.2
         | 
| 45 | 
            +
                - - "<"
         | 
| 46 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 47 | 
            +
                    version: 1.6.0
         | 
| 48 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 49 | 
            +
              name: gepub
         | 
| 50 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 51 | 
            +
                requirements:
         | 
| 52 | 
            +
                - - "~>"
         | 
| 53 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 54 | 
            +
                    version: 0.6.9.2
         | 
| 55 | 
            +
              type: :runtime
         | 
| 56 | 
            +
              prerelease: false
         | 
| 57 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 58 | 
            +
                requirements:
         | 
| 59 | 
            +
                - - "~>"
         | 
| 60 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            +
                    version: 0.6.9.2
         | 
| 62 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 63 | 
            +
              name: thread_safe
         | 
| 64 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 65 | 
            +
                requirements:
         | 
| 66 | 
            +
                - - "~>"
         | 
| 67 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 68 | 
            +
                    version: 0.3.4
         | 
| 69 | 
            +
              type: :runtime
         | 
| 70 | 
            +
              prerelease: false
         | 
| 71 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 72 | 
            +
                requirements:
         | 
| 73 | 
            +
                - - "~>"
         | 
| 74 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 75 | 
            +
                    version: 0.3.4
         | 
| 76 | 
            +
            description: |
         | 
| 77 | 
            +
              An extension for Asciidoctor that converts AsciiDoc documents to EPUB3 and KF8/MOBI (Kindle) e-book archives.
         | 
| 78 | 
            +
            email: dan@opendevise.io
         | 
| 79 | 
            +
            executables:
         | 
| 80 | 
            +
            - asciidoctor-epub3
         | 
| 81 | 
            +
            - adb-push-ebook
         | 
| 82 | 
            +
            extensions: []
         | 
| 83 | 
            +
            extra_rdoc_files:
         | 
| 84 | 
            +
            - README.adoc
         | 
| 85 | 
            +
            - LICENSE.adoc
         | 
| 86 | 
            +
            - NOTICE.adoc
         | 
| 87 | 
            +
            files:
         | 
| 88 | 
            +
            - LICENSE.adoc
         | 
| 89 | 
            +
            - NOTICE.adoc
         | 
| 90 | 
            +
            - README.adoc
         | 
| 91 | 
            +
            - Rakefile
         | 
| 92 | 
            +
            - bin/adb-push-ebook
         | 
| 93 | 
            +
            - bin/asciidoctor-epub3
         | 
| 94 | 
            +
            - data/fonts/assorted-icons.ttf
         | 
| 95 | 
            +
            - data/fonts/fontawesome-icons.ttf
         | 
| 96 | 
            +
            - data/fonts/mplus1mn-bold-ascii.ttf
         | 
| 97 | 
            +
            - data/fonts/mplus1mn-bolditalic-ascii.ttf
         | 
| 98 | 
            +
            - data/fonts/mplus1mn-italic-ascii.ttf
         | 
| 99 | 
            +
            - data/fonts/mplus1mn-regular-ascii-conums.ttf
         | 
| 100 | 
            +
            - data/fonts/mplus1p-bold-latin-cyrillic.ttf
         | 
| 101 | 
            +
            - data/fonts/mplus1p-bold-latin-ext.ttf
         | 
| 102 | 
            +
            - data/fonts/mplus1p-bold-latin.ttf
         | 
| 103 | 
            +
            - data/fonts/mplus1p-bold-multilingual.ttf
         | 
| 104 | 
            +
            - data/fonts/mplus1p-light-latin-cyrillic.ttf
         | 
| 105 | 
            +
            - data/fonts/mplus1p-light-latin-ext.ttf
         | 
| 106 | 
            +
            - data/fonts/mplus1p-light-latin.ttf
         | 
| 107 | 
            +
            - data/fonts/mplus1p-light-multilingual.ttf
         | 
| 108 | 
            +
            - data/fonts/mplus1p-regular-latin-cyrillic.ttf
         | 
| 109 | 
            +
            - data/fonts/mplus1p-regular-latin-ext.ttf
         | 
| 110 | 
            +
            - data/fonts/mplus1p-regular-latin.ttf
         | 
| 111 | 
            +
            - data/fonts/mplus1p-regular-multilingual.ttf
         | 
| 112 | 
            +
            - data/fonts/notoserif-bold-latin-cyrillic.ttf
         | 
| 113 | 
            +
            - data/fonts/notoserif-bold-latin-ext.ttf
         | 
| 114 | 
            +
            - data/fonts/notoserif-bold-latin.ttf
         | 
| 115 | 
            +
            - data/fonts/notoserif-bold-multilingual.ttf
         | 
| 116 | 
            +
            - data/fonts/notoserif-bolditalic-latin-cyrillic.ttf
         | 
| 117 | 
            +
            - data/fonts/notoserif-bolditalic-latin-ext.ttf
         | 
| 118 | 
            +
            - data/fonts/notoserif-bolditalic-latin.ttf
         | 
| 119 | 
            +
            - data/fonts/notoserif-bolditalic-multilingual.ttf
         | 
| 120 | 
            +
            - data/fonts/notoserif-italic-latin-cyrillic.ttf
         | 
| 121 | 
            +
            - data/fonts/notoserif-italic-latin-ext.ttf
         | 
| 122 | 
            +
            - data/fonts/notoserif-italic-latin.ttf
         | 
| 123 | 
            +
            - data/fonts/notoserif-italic-multilingual.ttf
         | 
| 124 | 
            +
            - data/fonts/notoserif-regular-latin-cyrillic.ttf
         | 
| 125 | 
            +
            - data/fonts/notoserif-regular-latin-ext.ttf
         | 
| 126 | 
            +
            - data/fonts/notoserif-regular-latin.ttf
         | 
| 127 | 
            +
            - data/fonts/notoserif-regular-multilingual.ttf
         | 
| 128 | 
            +
            - data/images/default-avatar.jpg
         | 
| 129 | 
            +
            - data/images/default-avatar.png
         | 
| 130 | 
            +
            - data/images/default-avatar.svg
         | 
| 131 | 
            +
            - data/images/default-cover-large.png
         | 
| 132 | 
            +
            - data/images/default-cover.png
         | 
| 133 | 
            +
            - data/images/default-cover.svg
         | 
| 134 | 
            +
            - data/images/default-headshot.jpg
         | 
| 135 | 
            +
            - data/images/default-headshot.png
         | 
| 136 | 
            +
            - data/samples/asciidoctor-epub3-readme.adoc
         | 
| 137 | 
            +
            - data/samples/asciidoctor-js-extension.adoc
         | 
| 138 | 
            +
            - data/samples/asciidoctor-js-introduction.adoc
         | 
| 139 | 
            +
            - data/samples/i18n.adoc
         | 
| 140 | 
            +
            - data/samples/images/asciidoctor-js-chrome-extension.png
         | 
| 141 | 
            +
            - data/samples/images/avatars/graphitefriction.png
         | 
| 142 | 
            +
            - data/samples/images/avatars/mogztter.png
         | 
| 143 | 
            +
            - data/samples/images/avatars/mojavelinux.png
         | 
| 144 | 
            +
            - data/samples/images/correct-text-justification.png
         | 
| 145 | 
            +
            - data/samples/images/incorrect-text-justification.png
         | 
| 146 | 
            +
            - data/samples/images/screenshots/chapter-title-day.png
         | 
| 147 | 
            +
            - data/samples/images/screenshots/chapter-title.png
         | 
| 148 | 
            +
            - data/samples/images/screenshots/figure-admonition.png
         | 
| 149 | 
            +
            - data/samples/images/screenshots/section-title-paragraph.png
         | 
| 150 | 
            +
            - data/samples/images/screenshots/sidebar.png
         | 
| 151 | 
            +
            - data/samples/images/screenshots/table.png
         | 
| 152 | 
            +
            - data/samples/images/screenshots/text.png
         | 
| 153 | 
            +
            - data/samples/sample-book.adoc
         | 
| 154 | 
            +
            - data/samples/sample-content.adoc
         | 
| 155 | 
            +
            - data/styles/color-palette.css
         | 
| 156 | 
            +
            - data/styles/epub3-css3-only.css
         | 
| 157 | 
            +
            - data/styles/epub3-fonts.css
         | 
| 158 | 
            +
            - data/styles/epub3.css
         | 
| 159 | 
            +
            - lib/asciidoctor-epub3.rb
         | 
| 160 | 
            +
            - lib/asciidoctor-epub3/converter.rb
         | 
| 161 | 
            +
            - lib/asciidoctor-epub3/core_ext/string.rb
         | 
| 162 | 
            +
            - lib/asciidoctor-epub3/font_icon_map.rb
         | 
| 163 | 
            +
            - lib/asciidoctor-epub3/packager.rb
         | 
| 164 | 
            +
            - lib/asciidoctor-epub3/spine_item_processor.rb
         | 
| 165 | 
            +
            - lib/asciidoctor-epub3/version.rb
         | 
| 166 | 
            +
            - scripts/generate-font-subsets.pe
         | 
| 167 | 
            +
            homepage: https://github.com/asciidoctor/asciidoctor-epub3
         | 
| 168 | 
            +
            licenses:
         | 
| 169 | 
            +
            - MIT
         | 
| 170 | 
            +
            metadata: {}
         | 
| 171 | 
            +
            post_install_message: 
         | 
| 172 | 
            +
            rdoc_options:
         | 
| 173 | 
            +
            - --charset=UTF-8 --title="Asciidoctor EPUB3" --main=README.adoc -ri
         | 
| 174 | 
            +
            require_paths:
         | 
| 175 | 
            +
            - lib
         | 
| 176 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 177 | 
            +
              requirements:
         | 
| 178 | 
            +
              - - ">="
         | 
| 179 | 
            +
                - !ruby/object:Gem::Version
         | 
| 180 | 
            +
                  version: '1.9'
         | 
| 181 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 182 | 
            +
              requirements:
         | 
| 183 | 
            +
              - - ">"
         | 
| 184 | 
            +
                - !ruby/object:Gem::Version
         | 
| 185 | 
            +
                  version: 1.3.1
         | 
| 186 | 
            +
            requirements: []
         | 
| 187 | 
            +
            rubyforge_project: 
         | 
| 188 | 
            +
            rubygems_version: 2.2.2
         | 
| 189 | 
            +
            signing_key: 
         | 
| 190 | 
            +
            specification_version: 4
         | 
| 191 | 
            +
            summary: Converts AsciiDoc documents to EPUB3 and KF8/MOBI (Kindle) e-book formats
         | 
| 192 | 
            +
            test_files: []
         |