Skip to content

Commit 560f5fc

Browse files
pismutelethee
authored andcommitted
fix korean fonts for pdf, #114
1 parent 857e0c1 commit 560f5fc

File tree

4 files changed

+36
-8
lines changed

4 files changed

+36
-8
lines changed

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
source 'https://rubygems.org'
22

33
gem 'rake', '13.0.3'
4-
gem 'asciidoctor', '2.0.12'
4+
gem 'asciidoctor', '2.0.15'
55

66
gem 'json', '2.5.1'
77
gem 'awesome_print', '1.9.2'
@@ -15,4 +15,4 @@ gem 'coderay', '1.1.3'
1515
gem 'pygments.rb', '2.2.0'
1616
gem 'thread_safe', '0.3.6'
1717
gem 'epubcheck-ruby', '4.2.5.0'
18-
gem 'html-proofer', '3.18.8'
18+
gem 'html-proofer', '3.19.0'

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ namespace :book do
103103
check_contrib()
104104

105105
puts 'Converting to PDF... (this one takes a while)'
106-
`bundle exec asciidoctor-pdf #{params} -r asciidoctor-pdf-cjk-kai_gen_gothic -a pdf-style=KaiGenGothicKR progit.asc `
106+
`bundle exec asciidoctor-pdf #{params} -a scripts=cjk -a pdf-theme=./korean-theme.yml -a pdf-fontsdir=$(ruby -r asciidoctor-pdf-cjk-kai_gen_gothic -e "print File.expand_path '../fonts', (Gem.datadir 'asciidoctor-pdf-cjk-kai_gen_gothic')") progit.asc 2>/dev/null`
107107
puts ' -- PDF output at progit.pdf'
108108
end
109109

korean-theme.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
extends: default
2+
font:
3+
catalog:
4+
merge: true
5+
kaiGen-gothic-kr:
6+
normal: KaiGenGothicKR-Regular.ttf
7+
bold: KaiGenGothicKR-Bold.ttf
8+
italic: KaiGenGothicKR-Regular-Italic.ttf
9+
bold_italic: KaiGenGothicKR-Bold-Italic.ttf
10+
Noto Serif:
11+
normal: GEM_FONTS_DIR/notoserif-regular-subset.ttf
12+
bold: GEM_FONTS_DIR/notoserif-bold-subset.ttf
13+
italic: GEM_FONTS_DIR/notoserif-italic-subset.ttf
14+
bold_italic: GEM_FONTS_DIR/notoserif-bold_italic-subset.ttf
15+
# M+ 1mn supports ASCII and the circled numbers used for conums
16+
M+ 1mn:
17+
normal: GEM_FONTS_DIR/mplus1mn-regular-subset.ttf
18+
bold: GEM_FONTS_DIR/mplus1mn-bold-subset.ttf
19+
italic: GEM_FONTS_DIR/mplus1mn-italic-subset.ttf
20+
bold_italic: GEM_FONTS_DIR/mplus1mn-bold_italic-subset.ttf
21+
fallbacks:
22+
- kaiGen-gothic-kr
23+
base:
24+
font-family: kaiGen-gothic-kr
25+
heading:
26+
font-family: $base-font-family
27+
abstract:
28+
title:
29+
font-family: $heading-font-family
30+
sidebar:
31+
title:
32+
font-family: $heading-font-family

progit.asc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
Pro Git
2-
=======
1+
= Pro Git
32
Scott Chacon; Ben Straub
4-
$$VERSION$$, $$DATE$$
53
:doctype: book
64
:docinfo:
75
:toc:
@@ -10,8 +8,6 @@ $$VERSION$$, $$DATE$$
108
:front-cover-image: image:book/cover.png[width=1050,height=1600]
119
:icons: font
1210

13-
ifdef::ebook-format[:leveloffset: -1]
14-
1511
include::book/license.asc[]
1612

1713
include::book/preface_schacon.asc[]

0 commit comments

Comments
 (0)