diff options
| -rw-r--r-- | data/fonts/mplus1mn-regular-ascii-conums.ttf | bin | 21544 -> 26728 bytes | |||
| -rw-r--r-- | docs/theming-guide.adoc | 3 | ||||
| -rw-r--r-- | lib/asciidoctor-pdf/converter.rb | 4 | ||||
| -rwxr-xr-x | scripts/subset-fonts.pe | 5 | ||||
| -rw-r--r-- | spec/list_spec.rb | 23 |
5 files changed, 29 insertions, 6 deletions
diff --git a/data/fonts/mplus1mn-regular-ascii-conums.ttf b/data/fonts/mplus1mn-regular-ascii-conums.ttf Binary files differindex 35a381bb..883b0039 100644 --- a/data/fonts/mplus1mn-regular-ascii-conums.ttf +++ b/data/fonts/mplus1mn-regular-ascii-conums.ttf diff --git a/docs/theming-guide.adoc b/docs/theming-guide.adoc index ce846628..e0ad0285 100644 --- a/docs/theming-guide.adoc +++ b/docs/theming-guide.adoc @@ -1994,7 +1994,8 @@ The keys in this category are used to control the style of callout numbers (i.e. . Currently, the font must contain the circle numbers starting at glyph U+2460. . font-family, font-size, font-style, and line-height are only used for markers in a colist. These properties are inherited for conums inside a verbatim block. -. The glyphs can be specified as a comma-separated list of ranges, where the range values are Unicode numbers (e.g., \u2460). +. The font must provide the required glyphs. +The glyphs can be specified as a comma-separated list of ranges, where the range values are Unicode numbers (e.g., \u2460). [#keys-button] === Button diff --git a/lib/asciidoctor-pdf/converter.rb b/lib/asciidoctor-pdf/converter.rb index 29a8a1f5..e87a08f1 100644 --- a/lib/asciidoctor-pdf/converter.rb +++ b/lib/asciidoctor-pdf/converter.rb @@ -89,9 +89,7 @@ class Converter < ::Prawn::Document } ConumSets = { 'circled' => (?\u2460..?\u2473).to_a, - # 'double-circled' => ..., - 'filled' => (?\u278a..?\u2793).to_a + (?\u24eb..?\u24f4).to_a, - # 'parenthesized' => ..., + 'filled' => (?\u2776..?\u277f).to_a + (?\u24eb..?\u24f4).to_a, } SimpleAttributeRefRx = /(?<!\\)\{\w+(?:[\-]\w+)*\}/ MeasurementRxt = '\\d+(?:\\.\\d+)?(?:in|cm|mm|p[txc])?' diff --git a/scripts/subset-fonts.pe b/scripts/subset-fonts.pe index 17651367..8acd0e20 100755 --- a/scripts/subset-fonts.pe +++ b/scripts/subset-fonts.pe @@ -332,8 +332,11 @@ while (fi < num_code_fonts) # Box drawing symbols for unix `tree` output SelectMore(0u2500,0u257f) if (new_basename == "mplus1mn-regular") - # Enclosed numbers (1-20) + # Enclosed numbers (1-20 circled and filled) SelectMore(0u2460,0u2473) + SelectMore(0u2776,0u277f) + SelectMore(0u24eb,0u24f4) + SelectMore(0u278a,0u2793) new_suffix = "-ascii-conums.ttf" endif SelectInvert() diff --git a/spec/list_spec.rb b/spec/list_spec.rb index 9e09c62d..5c0cdf51 100644 --- a/spec/list_spec.rb +++ b/spec/list_spec.rb @@ -301,7 +301,28 @@ describe 'Asciidoctor::PDF::Converter - List' do end end - it 'should allow conum glyphs to be customized' do + it 'should support filled conum glyphs if specified in theme' do + pdf = to_pdf <<~'EOS', pdf_theme: { conum_glyphs: 'filled' }, analyze: true + .... + line one <1> + line two + line three <2> + .... + <1> First line + <2> Last line + EOS + + one_text = pdf.find_text ?\u2776 + two_text = pdf.find_text ?\u2777 + (expect one_text).to have_size 2 + (expect two_text).to have_size 2 + (one_text + two_text).each do |text| + (expect text[:font_name]).to eql 'mplus1mn-regular' + (expect text[:font_color]).to eql 'B12146' + end + end + + it 'should allow conum glyphs to be specified explicitly' do pdf = to_pdf <<~'EOS', pdf_theme: { conum_glyphs: '\u0031-\u0039' }, analyze: true .... line one <1> |
