Giter Club home page Giter Club logo

Comments (3)

mojavelinux avatar mojavelinux commented on May 28, 2024

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.

jxxcarlson avatar jxxcarlson commented on May 28, 2024

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.

mojavelinux avatar mojavelinux commented on May 28, 2024

For more information, see https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc.

from asciidoctor-pdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.