Comments (3)
I have good news for you. I've built a theme mechanism into Asciidoctor PDF that controls all of the font metrics and much of the spacings. (Though, it's not yet documented).
You can see the default theme definition here:
https://github.com/asciidoctor/asciidoctor-pdf/blob/master/data/themes/default-theme.yml
To provide your own theme, simply copy that file (or start a new one), tweak it and pass it to the pdf-style
attribute:
$ asciidoctor-pdf -a pdf-style=/path/to/custom-theme.yml
The file must end in -theme.yml
for now.
Here's how you control the master font size and line spacing in particular:
base:
font_size: 9
line_height_length: 10
Note that the font size is roughly equivalent to the "x-height" of the font. Font metrics are a bit different in the PDF environment and I'll need to thoroughly document how to think about them. I'm still sorting it out myself. Of course, you can just play around with the numbers until you get the output you want. The sizes can be decimal values (e.g., 9.45).
from asciidoctor-pdf.
Your good news is always very good!
I will check it out tomorrow.
On Sep 8, 2014, at 12:02 AM, Dan Allen [email protected] wrote:
I have good news for you. I've built a theme mechanism into Asciidoctor PDF that controls all of the font metrics and much of the spacings. (Though, it's not yet documented).
You can see the default theme definition here:
https://github.com/asciidoctor/asciidoctor-pdf/blob/master/data/themes/default-theme.yml
To provide your own theme, simply copy that file (or start a new one), tweak it and pass it to the pdf-style attribute:
$ asciidoctor-pdf -a pdf-style=/path/to/custom-theme.yml
The file must end in -theme.yml for now.Here's how you control the master font size and line spacing in particular:
base:
font_size: 9
line_height_length: 10
Note that the font size is roughly equivalent to the "x-height" of the font. Font metrics are a bit different in the PDF environment and I'll need to thoroughly document how to think about them. I'm still sorting it out myself. Of course, you can just play around with the numbers until you get the output you want. The sizes can be decimal values (e.g., 9.45).—
Reply to this email directly or view it on GitHub.
from asciidoctor-pdf.
For more information, see https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc.
from asciidoctor-pdf.
Related Issues (20)
- Surrounding text in content key of running content is dropped if image macro is on its own line
- Embedding of "built-in" fonts HOT 2
- Deactivate header/footer in inserted blank pages in prepress mode HOT 2
- listing block font-size is a fixed value? HOT 1
- Customise a block according to its type HOT 1
- Ordered list starting from 0 HOT 2
- Source location not reported if description in horizontal dlist is truncated
- Upgrade prawn-svg to 0.34.x HOT 1
- Remove link from entry in TOC
- Support prawn-icon 3.1.x in v2.3.x branch HOT 1
- Lock ttfunk to 1.7.x in 2.3.x release line HOT 2
- Producer set to Author instead of producing software in document properties
- Document exceptions to the nobreak role and non-breaking characters HOT 6
- Add support for SVG to image referece in SVG encoded as a data URI (SVG data loader) HOT 1
- Alternative to prawn-gmagick? HOT 3
- asciidoctor: WARNING: unknown unordered list style: something HOT 2
- A custom title page HOT 1
- Add theme support for indent for admonition and sidebar HOT 1
- prose_margin_inner has no effect on prose in table cells HOT 1
- line break in theme attribute "with_email" not working any more HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asciidoctor-pdf.